|
16 | 16 |
|
17 | 17 | <nav class="pl-c-nav pl-js-nav-target pl-js-nav-container" role="navigation">
|
18 | 18 |
|
| 19 | + <input class="pl-c-typeahead pl-js-typeahead" id="typeahead" type="text" placeholder="Find Pattern" /> |
| 20 | + |
19 | 21 | <ol class="pl-c-nav__list pl-js-pattern-nav-target">
|
20 | 22 | <!-- pattern lab nav will be inserted here -->
|
21 | 23 | </ol><!--end pl-c-nav__list-->
|
22 | 24 |
|
23 |
| - <input class="pl-c-typeahead pl-js-typeahead" id="typeahead" type="text" placeholder="Find Pattern" /> |
24 |
| - |
25 | 25 | </nav><!--end pl-c-nav-->
|
26 | 26 |
|
27 | 27 | <div class="pl-c-controls pl-js-controls">
|
@@ -342,6 +342,31 @@ <h3 class="pl-c-annotations__item-title">{{ title }}</h3>
|
342 | 342 |
|
343 | 343 | <!-- load Pattern Lab data -->
|
344 | 344 | <script src="styleguide/data/patternlab-data.js"></script>
|
| 345 | + |
| 346 | + <!-- applying theme config to get classes on before PL renders so there's no flash of unstyled content --> |
| 347 | + <!-- @todo Consider moving this to own file --> |
| 348 | + <script> |
| 349 | + if (config && config.theme) { |
| 350 | + if (config.theme.color === 'light') { |
| 351 | + document.body.classList.add('pl-c-body--theme-light'); |
| 352 | + } |
| 353 | + if (config.theme.layout === 'vertical') { |
| 354 | + document.body.classList.add('pl-c-body--theme-sidebar'); |
| 355 | + } |
| 356 | + switch (config.theme.density) { |
| 357 | + case 'cozy': |
| 358 | + document.body.classList.add('pl-c-body--theme-density-cozy'); |
| 359 | + break; |
| 360 | + case 'comfortable': |
| 361 | + document.body.classList.add('pl-c-body--theme-density-comfortable'); |
| 362 | + break; |
| 363 | + default: |
| 364 | + // not sure if you even need/want this |
| 365 | + document.body.classList.add('pl-c-body--theme-density-compact'); |
| 366 | + } |
| 367 | + } |
| 368 | + </script> |
| 369 | + |
345 | 370 | <script src="annotations/annotations.js"></script>
|
346 | 371 |
|
347 | 372 | <!-- load Pattern Lab external library js -->
|
|
0 commit comments