Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit b99c9fe

Browse files
author
TheComputerM
committed
docs: optimise
1 parent e5f5541 commit b99c9fe

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module.exports = {
3737
'no-return-assign': ['error', 'except-parens'],
3838
'no-param-reassign': ['error', { props: false }],
3939
},
40-
globals: { ClipboardJS: 'readonly' },
4140
},
4241
],
4342
extends: ['eslint:recommended', 'airbnb-base'],

packages/docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@rollup/plugin-dynamic-import-vars": "^1.1.0",
2727
"@rollup/plugin-replace": "^2.3.4",
2828
"autoprefixer": "^10.0.2",
29+
"clipboard": "^2.0.6",
2930
"mdsvex": "^0.8.7",
3031
"postcss": "^8.1.7",
3132
"prism-svelte": "^0.4.7",

packages/docs/src/components/doc/Markup.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script>
2+
import Clipboard from 'clipboard';
23
import { Button, Icon } from 'svelte-materialify/src';
34
45
export let lang = '';
56
function copy(node) {
67
const toCopy = node.querySelector('pre').textContent;
7-
const clipboard = new ClipboardJS(node.querySelector('.s-btn'), {
8+
const clipboard = new Clipboard(node.querySelector('.s-btn'), {
89
text: () => toCopy,
910
});
1011
return {

packages/docs/src/routes/_layout.svelte

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@
5151
<svelte:window on:resize={checkMobile} />
5252

5353
<svelte:head>
54-
{#if $theme === 'light'}
55-
<link rel="stylesheet" href="prism/material-light.css" />
56-
{:else}
57-
<link rel="stylesheet" href="prism/material-dark.css" />
58-
{/if}
54+
<link rel="stylesheet" href="prism/material-light.css" disabled={$theme === 'dark'} />
55+
<link rel="stylesheet" href="prism/material-dark.css" disabled={$theme === 'light'} />
5956
</svelte:head>
6057

6158
<MaterialApp theme={$theme}>

packages/docs/src/template.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@
5858

5959
gtag('config', 'UA-156679564-3');
6060
</script>
61-
<script
62-
defer
63-
src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js"
64-
></script>
6561

6662
<!-- Sapper creates a <script> tag containing `src/client.js`
6763
and anything else it needs to hydrate the app and

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3410,7 +3410,7 @@ cli-width@^2.0.0:
34103410
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
34113411
integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==
34123412

3413-
clipboard@^2.0.0:
3413+
clipboard@^2.0.0, clipboard@^2.0.6:
34143414
version "2.0.6"
34153415
resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.6.tgz#52921296eec0fdf77ead1749421b21c968647376"
34163416
integrity sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==

0 commit comments

Comments
 (0)