This repository was archived by the owner on Sep 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed
src/examples/ClickOutside Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ export default {
7
7
if ( id . includes ( 'examples' ) ) {
8
8
// some files still have CRLF line-endings, that's why the last 3 replaces aren't combined
9
9
// when that's solved, do .replace('</script>\n', '</script>\n\n<MaterialApp>') instead
10
- const codeWithMaterialAppAdded = ` ${ code
10
+ const codeWithInject1 = code
11
11
. replace ( ' } from \'svelte-materialify/src\'' , ', MaterialApp } from \'svelte-materialify/src\'' )
12
12
. replace ( '</script>' , '</script>\n\n<MaterialApp>' )
13
13
. 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' ) ;
16
17
const output = `<script context="module">export const source = ${ JSON . stringify (
17
18
highlighted ,
18
19
) } </script>`;
Original file line number Diff line number Diff line change 12
12
}
13
13
</script >
14
14
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
-
26
15
<div
27
16
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;"
28
23
class:primary-color ={active }
29
24
class:white-text ={active }
30
25
use:ClickOutside
You can’t perform that action at this time.
0 commit comments