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

Commit 64bb734

Browse files
docs: fix inject
Signed-off-by: Florian-Schoenherr <[email protected]>
1 parent bb0c0fa commit 64bb734

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

packages/docs/scripts/examples.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ export default {
77
if (id.includes('examples')) {
88
// some files still have CRLF line-endings, that's why the last 3 replaces aren't combined
99
// when that's solved, do .replace('</script>\n', '</script>\n\n<MaterialApp>') instead
10-
const codeWithMaterialAppAdded = `${code
10+
const codeWithInject1 = code
1111
.replace(' } from \'svelte-materialify/src\'', ', MaterialApp } from \'svelte-materialify/src\'')
1212
.replace('</script>', '</script>\n\n<MaterialApp>')
1313
.replace('<MaterialApp>\n', '<MaterialApp>')
14-
.replace('<MaterialApp>\r\n', '<MaterialApp>')}</MaterialApp>`;
15-
const highlighted = Prism.highlight(codeWithMaterialAppAdded, Prism.languages.svelte, 'svelte');
14+
.replace('<MaterialApp>\r\n', '<MaterialApp>');
15+
const codeWithInject2 = codeWithInject1.includes('<MaterialApp>') ? `${codeWithInject1}</MaterialApp>` : codeWithInject1;
16+
const highlighted = Prism.highlight(codeWithInject2, Prism.languages.svelte, 'svelte');
1617
const output = `<script context="module">export const source = ${JSON.stringify(
1718
highlighted,
1819
)}</script>`;

packages/docs/src/examples/ClickOutside/usage.svelte

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,14 @@
1212
}
1313
</script>
1414

15-
<style>
16-
div {
17-
margin: 12px auto;
18-
display: flex;
19-
justify-content: center;
20-
align-items: center;
21-
width: 250px;
22-
height: 250px;
23-
}
24-
</style>
25-
2615
<div
2716
class="elevation-4 rounded text-h6"
17+
style="margin: 12px auto;
18+
display: flex;
19+
justify-content: center;
20+
align-items: center;
21+
width: 250px;
22+
height: 250px;"
2823
class:primary-color={active}
2924
class:white-text={active}
3025
use:ClickOutside

0 commit comments

Comments
 (0)