2
2
< html >
3
3
4
4
< head >
5
- < title id ="title "> Pattern Lab</ title >
6
- < meta charset ="UTF-8 ">
5
+ < title id ="title "> Pattern Lab</ title >
6
+ < meta charset ="UTF-8 ">
7
7
< meta name ="viewport " content ="width=device-width " />
8
- < meta name ="theme-color " content ="#ababab "/>
9
-
10
- < link inline href ="styleguide/css/pattern-lab.critical.css " />
8
+ < meta name ="theme-color " content ="#ababab " />
11
9
12
10
< link rel ="preload " as ="script " href ="styleguide/js/patternlab-viewer.js ">
13
- < link rel ="preload " href ="styleguide/css/pattern-lab.css " as ="style " onload ="this.onload=null;this.rel='stylesheet' ">
14
-
15
- < noscript >
16
- < link rel ="stylesheet " href ="styleguide/css/pattern-lab.css " media ="all " />
17
- </ noscript >
18
-
19
- < script inline async src ="styleguide/js/cssrelpreload.min.js "> </ script >
11
+ < link rel ="stylesheet " href ="styleguide/css/pattern-lab.css " media ="all " />
20
12
21
13
</ head >
22
14
23
15
< body class ="pl-c-body ">
24
16
25
- @@include ('./partials/header.html')
26
- @@include ('./partials/iframe.html')
27
- @@include ('./partials/modal.html')
17
+ ${require ('./partials/header.html') }
18
+ ${require ('./partials/iframe.html') }
19
+ ${require ('./partials/modal.html') }
28
20
29
- <!-- mustache templates -->
30
- < script type ="text/mustache " class ="pl-js-pattern-nav-template ">
31
- @@include ( './partials/pattern-nav.html' )
21
+ < script type ="text/mustache " class ="pl-js-pattern-nav-template ">
22
+ $ { require ( './partials/pattern-nav.html' ) }
32
23
</ script >
33
24
34
- < script type ="text/mustache " class ="pl-js-ish-controls-template ">
35
- @@ include ( './partials/controls.html' )
25
+ < script type ="text/mustache " class ="pl-js-ish-controls-template ">
26
+ $ { require ( './partials/controls.html' ) }
36
27
</ script >
37
28
38
- <!-- the template for the modal slider -->
39
- < script type ="text/mustache " class ="pl-js-panel-template-base ">
40
- @@ include ( './partials/base-template.html' )
29
+ <!-- the template for the modal slider -->
30
+ < script type ="text/mustache " class ="pl-js-panel-template-base ">
31
+ $ { require ( './partials/base-template.html' ) }
41
32
</ script >
42
33
43
- <!-- the template for code-related tabs in the code view slider -->
44
- < script type ="text/mustache " id ="pl-panel-template-code ">
45
- @@ include ( './partials/panel-code-template.html' )
34
+ <!-- the template for code-related tabs in the code view slider -->
35
+ < script type ="text/mustache " id ="pl-panel-template-code ">
36
+ $ { require ( './partials/panel-code-template.html' ) }
46
37
</ script >
47
38
48
- <!-- load Pattern Lab data -->
49
- < script src ="styleguide/data/patternlab-data.js " defer > </ script >
39
+ <!-- load Pattern Lab data -->
40
+ < script src ="styleguide/data/patternlab-data.js " defer > </ script >
50
41
51
42
<!-- applying theme config to get classes on before PL renders so there's no flash of unstyled content -->
52
43
<!-- @todo fold this into it's own standalone JS component -->
53
44
< script >
54
45
// need to make sure that window.config is defined first on acccount of us async loading everything ;)
55
46
window . patternlab = window . patternlab || { } ;
56
- window . patternlab . applyTheme = function ( ) {
47
+ window . patternlab . applyTheme = function ( ) {
57
48
if ( window . config . theme . color === 'light' ) {
58
49
document . body . classList . add ( 'pl-c-body--theme-light' ) ;
59
50
}
81
72
}
82
73
</ script >
83
74
84
- < script src ="annotations/annotations.js " defer > </ script >
75
+ < script src ="annotations/annotations.js " defer > </ script >
85
76
86
- <!-- load the Pattern Lab viewer js -->
87
- < script inline src ="styleguide/js/whenDefined.min.js "> </ script >
77
+ <!-- load the Pattern Lab viewer js -->
78
+ < script >
79
+ $ { require ( 'raw-loader!../../node_modules/whendefined/dist/whendefined.min.js' ) }
80
+ </ script >
88
81
< script src ="styleguide/js/patternlab-viewer.js " defer > </ script >
89
82
90
83
<!-- temp workaround to allow everything to be asynced / deffered with current setup. @todo: remove once refactored components + improved build process is in place. -->
91
84
< script >
92
- whenDefined ( window , 'config' , function ( ) {
93
- if ( window . config . theme ) {
85
+ whenDefined ( window , 'config' , function ( ) {
86
+ if ( window . config . theme ) {
94
87
window . patternlab . applyTheme ( ) ;
95
88
}
96
89
} ) ;
108
101
109
102
</ body >
110
103
111
- </ html >
112
-
104
+ </ html >
0 commit comments