diff --git a/docs/_includes/default.njk b/docs/_includes/default.njk index ffd26d4c1..3076475bc 100644 --- a/docs/_includes/default.njk +++ b/docs/_includes/default.njk @@ -52,6 +52,7 @@ + {# Turbo + Scroll positioning #} diff --git a/docs/pages/experimental/themer.md b/docs/pages/experimental/themer.md index 77f8ae77f..d9dd7bf42 100644 --- a/docs/pages/experimental/themer.md +++ b/docs/pages/experimental/themer.md @@ -17,19 +17,39 @@ toc: false Playful Chic - - Theme default - Serif - Sans-serif - Monospace - Cursive + + Theme default + Assistant + Inter + Lora + Noto Sans + Noto Sans Display + Noto Sans Mono + Noto Serif + Open Sans + Playfair + Playfair Display + Quicksand + Roboto Flex + Roboto Mono + Roboto Serif + Roboto Slab - - Theme default - Serif - Sans-serif - Monospace - Cursive + + Theme default + Assistant + Inter + Lora + Noto Sans + Noto Sans Mono + Noto Serif + Open Sans + Playfair + Quicksand + Roboto Flex + Roboto Mono + Roboto Serif + Roboto Slab Solid @@ -53,13 +73,105 @@ toc: false }); // Heading text - container.querySelector('[name="heading-text"]').addEventListener('wa-input', event => { - document.documentElement.style.setProperty('--wa-font-family-heading', event.target.value); + container.querySelector('[name="heading-text"]').addEventListener('wa-change', event => { + let fontFamily; + switch(event.target.value) { + case 'assistant': + fontFamily = `'Assistant', sans-serif`; + break; + case 'inter': + fontFamily = `'inter', sans-serif`; + break; + case 'lora': + fontFamily = `'Lora', serif` + case 'noto-sans': + fontFamily = `'Noto Sans', sans-serif`; + break; + case 'noto-sans-display': + fontFamily = `'Noto Sans Display', sans-serif`; + break; + case 'noto-sans-mono': + fontFamily = `'Noto Sans Mono', monospace`; + break; + case 'noto-serif': + fontFamily = `'Noto Serif', serif`; + break; + case 'open-sans': + fontFamily = `'Open Sans', sans-serif`; + break; + case 'playfair': + fontFamily = `'Playfair', serif`; + break; + case 'playfair-display': + fontFamily = `'Playfair Display', serif`; + break; + case 'quicksand': + fontFamily = `'Quicksand', sans-serif`; + break; + case 'roboto-flex': + fontFamily = `'Roboto Flex', sans-serif`; + break; + case 'roboto-mono': + fontFamily = `'Roboto Mono', monospace`; + break; + case 'roboto-serif': + fontFamily = `'Roboto Serif', serif`; + break; + case 'roboto-slab': + fontFamily = `'Roboto Slab', serif`; + break; + default: + fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'; + } + document.documentElement.style.setProperty('--wa-font-family-heading', fontFamily); }); // Body text - container.querySelector('[name="body-text"]').addEventListener('wa-input', event => { - document.documentElement.style.setProperty('--wa-font-family-body', event.target.value); + container.querySelector('[name="body-text"]').addEventListener('wa-change', event => { + let fontFamily; + switch(event.target.value) { + case 'assistant': + fontFamily = `'Assistant', sans-serif`; + break; + case 'inter': + fontFamily = `'inter', sans-serif`; + break; + case 'lora': + fontFamily = `'Lora', serif` + case 'noto-sans': + fontFamily = `'Noto Sans', sans-serif`; + break; + case 'noto-sans-mono': + fontFamily = `'Noto Sans Mono', monospace`; + break; + case 'noto-serif': + fontFamily = `'Noto Serif', serif`; + break; + case 'open-sans': + fontFamily = `'Open Sans', sans-serif`; + break; + case 'playfair': + fontFamily = `'Playfair', serif`; + break; + case 'quicksand': + fontFamily = `'Quicksand', sans-serif`; + break; + case 'roboto-flex': + fontFamily = `'Roboto Flex', sans-serif`; + break; + case 'roboto-mono': + fontFamily = `'Roboto Mono', monospace`; + break; + case 'roboto-serif': + fontFamily = `'Roboto Serif', serif`; + break; + case 'roboto-slab': + fontFamily = `'Roboto Slab', serif`; + break; + default: + fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'; + } + document.documentElement.style.setProperty('--wa-font-family-body', fontFamily); }); // Corners