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

Commit 3fbff60

Browse files
docs: replace webfonts in doc-components
Signed-off-by: Florian-Schoenherr <[email protected]>
1 parent 67949bf commit 3fbff60

18 files changed

+104
-78
lines changed
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
<svelte:options immutable={true} />
2+
13
<script context="module">
24
const icons = {
3-
info: 'information',
4-
danger: 'alert',
5-
warning: 'alert-octagram',
6-
success: 'check',
5+
info: mdiInformation,
6+
danger: mdiAlert,
7+
warning: mdiAlertOctagram,
8+
success: mdiCheck,
79
};
810
</script>
911

1012
<script>
1113
import { Alert, Icon } from 'svelte-materialify/src';
14+
import { mdiInformation, mdiAlert, mdiAlertOctagram, mdiCheck } from '@mdi/js';
1215
1316
export let type = 'info';
1417
const icon = icons[type];
@@ -20,11 +23,9 @@
2023
}
2124
</style>
2225

23-
<svelte:options immutable={true} />
24-
2526
<Alert class="s-alert--doc {type}-text" border="left" text>
2627
<div slot="icon">
27-
<Icon class="mdi mdi-{icon}" />
28+
<Icon path={icon} />
2829
</div>
2930
<slot />
3031
</Alert>

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
<svelte:options immutable={true} />
2+
13
<script>
24
import { theme } from '@/util/stores';
35
import links from '@/util/links';
46
import { onMount } from 'svelte';
57
import { slide } from 'svelte/transition';
68
import Markup from './Markup.svelte';
79
import { Icon, Button } from 'svelte-materialify/src';
10+
import { mdiInvertColors, mdiGithub, mdiCodeTags } from '@mdi/js';
811
912
export let file = '';
1013
export let style = null;
@@ -35,8 +38,6 @@
3538
}
3639
</style>
3740

38-
<svelte:options immutable={true} />
39-
4041
<div class="example">
4142
<div class="example-toolbar text-right pa-1">
4243
{#if colorInvertable}
@@ -46,7 +47,7 @@
4647
size="small"
4748
aria-label="invert color"
4849
on:click={() => (codeThemeDark = !codeThemeDark)}>
49-
<Icon class="mdi mdi-invert-colors" />
50+
<Icon path={mdiInvertColors} />
5051
</Button>
5152
{/if}
5253
<a
@@ -55,7 +56,7 @@
5556
rel="noopener noreferrer"
5657
target="_blank">
5758
<Button fab icon size="small" aria-label="GitHub" class="text--primary">
58-
<Icon class="mdi mdi-github" />
59+
<Icon path={mdiGithub} />
5960
</Button>
6061
</a>
6162
<Button
@@ -64,7 +65,7 @@
6465
size="small"
6566
aria-label="Show Code"
6667
on:click={() => (codeVisible = !codeVisible)}>
67-
<Icon class="mdi mdi-code-tags" />
68+
<Icon path={mdiCodeTags} />
6869
</Button>
6970
</div>
7071
{#if codeVisible}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
<svelte:options immutable={true} />
2+
13
<script>
24
import Clipboard from 'clipboard';
35
import { Button, Icon } from 'svelte-materialify/src';
6+
import { mdiContentCopy } from '@mdi/js';
47
58
export let lang = '';
69
function copy(node) {
@@ -50,17 +53,16 @@
5053
}
5154
</style>
5255

53-
<svelte:options immutable={true} />
54-
5556
<div class="code-block" use:copy>
56-
<pre class="language-{lang}">
57+
<pre
58+
class="language-{lang}">
5759
<code
5860
class="language-{lang}">
5961
<slot />
6062
</code>
6163
</pre>
6264
<Button fab depressed size="small" style="position:absolute" aria-label="Copy">
63-
<Icon size="20px" class="mdi mdi-content-copy" />
65+
<Icon size="20px" path={mdiContentCopy} />
6466
</Button>
6567
<span aria-hidden="true">{lang}</span>
6668
</div>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Ripple,
1414
ListItem,
1515
} from 'svelte-materialify/src';
16+
import { mdiInvertColors } from '@mdi/js';
1617
1718
export let values;
1819
export let controls;
@@ -82,7 +83,7 @@
8283
<div class="playground__toolbar justify-space-between pl-2 pr-2">
8384
<div class="text-h6">Options</div>
8485
<Button icon on:click={toggleTheme}>
85-
<Icon class="mdi mdi-invert mdi-invert-colors" />
86+
<Icon path={mdiInvertColors} />
8687
</Button>
8788
</div>
8889
<div class="pa-2">

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
<svelte:options immutable={true} />
2+
13
<script>
24
import { Row, Col, ListItem, Icon } from 'svelte-materialify/src';
5+
import {
6+
mdiViewDashboardOutline,
7+
mdiSpeedometer,
8+
mdiPaletteOutline,
9+
mdiFlaskEmptyOutline,
10+
mdiFunction,
11+
} from '@mdi/js';
312
413
export let related;
514
const items = related.map((x) => x.split('/'));
@@ -12,11 +21,14 @@
1221
}
1322
1423
const icons = {
15-
components: 'view-dashboard-outline indigo-text',
16-
'getting-started': 'speedometer green-text',
17-
styles: 'palette-outline deep-purple-text',
18-
api: 'flask-empty-outline amber-text',
19-
actions: 'function indigo-text',
24+
components: {
25+
path: mdiViewDashboardOutline,
26+
color: 'view-dashboard-outline indigo-text',
27+
},
28+
'getting-started': { path: mdiSpeedometer, color: 'speedometer green-text' },
29+
styles: { path: mdiPaletteOutline, color: 'palette-outline deep-purple-text' },
30+
api: { path: mdiFlaskEmptyOutline, color: 'flask-empty-outline amber-text' },
31+
actions: { path: mdiFunction, color: 'function indigo-text' },
2032
};
2133
</script>
2234

@@ -26,8 +38,6 @@
2638
}
2739
</style>
2840

29-
<svelte:options immutable={true} />
30-
3141
<section>
3242
<h2 class="text-h4 mb-3">Ready For More?</h2>
3343
<p>
@@ -39,7 +49,7 @@
3949
<a href="/{dir}/{page}/">
4050
<ListItem ripple class="rounded ready-for-more">
4151
<div slot="prepend">
42-
<Icon class="mdi mdi-{icons[dir]}" />
52+
<Icon path={icons[dir].path} class={icons[dir].color} />
4353
</div>
4454
{fmt(page)}
4555
<span slot="subtitle">{fmt(dir)}</span>

packages/docs/src/components/navigation/LeftNavigationDrawer.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<script>
88
import { stores } from '@sapper/app';
99
import { ListGroup, ListItem, Icon } from 'svelte-materialify/src';
10+
import { mdiChevronDown } from '@mdi/js';
1011
1112
const { page } = stores();
1213
export let item;
@@ -31,12 +32,12 @@
3132
<ListGroup class="secondary-text" eager {offset} bind:active={expanded}>
3233
<div slot="prepend">
3334
{#if item.icon}
34-
<Icon class="mdi mdi-{expanded ? item.openIcon : item.icon}" />
35+
<Icon path={expanded ? item.openIcon : item.icon} />
3536
{/if}
3637
</div>
3738
<slot slot="activator">{item.text}</slot>
3839
<div slot="append">
39-
<Icon class="mdi mdi-chevron-down" rotate={expanded ? 180 : 0} />
40+
<Icon path={mdiChevronDown} rotate={expanded ? 180 : 0} />
4041
</div>
4142
{#each item.items as children}
4243
{#if children.items}

packages/docs/src/components/navigation/SiteNavigation.svelte

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626
{/each}
2727
</List>
2828
</NavigationDrawer>
29-
<Overlay
30-
index="3"
31-
active={mobile && sidenav}
32-
on:click={() => (sidenav = false)}
33-
fadeOptions={{ duration: 250 }} />
29+
<Overlay index="3" active={mobile && sidenav} on:click={() => (sidenav = false)} />
3430

3531
{#if !mobile}
3632
<NavigationDrawer

packages/docs/src/playground/Alert.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import Playground from '@/components/doc/Playground.svelte';
33
import { Alert, Icon } from 'svelte-materialify/src';
4+
import { mdiHome } from '@mdi/js';
45
56
const variants = ['dense', 'outlined', 'text', 'tile'];
67
@@ -43,10 +44,10 @@
4344
{...formatVariant(values.variants)}>
4445
<span slot="icon">
4546
{#if values.icon}
46-
<Icon class="mdi mdi-home" />
47+
<Icon path={mdiHome} />
4748
{/if}
4849
</span>
49-
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Omnis itaque excepturi
50-
suscipit possimus blanditiis, illum libero sequi a deleniti sapiente.
50+
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Omnis itaque excepturi suscipit
51+
possimus blanditiis, illum libero sequi a deleniti sapiente.
5152
</Alert>
5253
</Playground>

packages/docs/src/playground/AppBar.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import Playground from '@/components/doc/Playground.svelte';
33
import { AppBar, Button, Icon } from 'svelte-materialify/src';
4+
import { mdiMenu, mdiMagnify } from '@mdi/js';
45
56
const variants = ['dense', 'prominent', 'flat'];
67
const controls = {
@@ -27,13 +28,13 @@
2728
{...formatVariant(values.variants)}>
2829
<span slot="icon">
2930
<Button text fab>
30-
<Icon class="mdi mdi-menu" />
31+
<Icon path={mdiMenu} />
3132
</Button>
3233
</span>
3334
<span slot="title"> Title </span>
3435
<div style="flex-grow:1" />
3536
<Button text fab>
36-
<Icon class="mdi mdi-magnify" />
37+
<Icon path={mdiMagnify} />
3738
</Button>
3839
</AppBar>
3940
</Playground>

packages/docs/src/playground/Avatar.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import Playground from '@/components/doc/Playground.svelte';
33
import { Avatar, Icon } from 'svelte-materialify/src';
4+
import { mdiHome } from '@mdi/js';
45
56
const controls = {
67
size: { type: 'slider' },
@@ -24,7 +25,7 @@
2425
<Playground {controls} bind:values>
2526
<Avatar tile={values.tile} size="{values.size}px" class="{values.color[0]}-color">
2627
{#if values.icon}
27-
<Icon class="mdi mdi-home" />
28+
<Icon path={mdiHome} />
2829
{:else}MS{/if}
2930
</Avatar>
3031
</Playground>

0 commit comments

Comments
 (0)