From fe23a7ddb8b18cc4c00f09c734578815a13d0e37 Mon Sep 17 00:00:00 2001 From: Kelsey Jackson Date: Mon, 11 Dec 2023 11:51:53 -0600 Subject: [PATCH 1/2] add list of curated fonts --- docs/_includes/default.njk | 1 + docs/pages/experimental/themer.md | 144 ++++++++++++++++++++++++++---- 2 files changed, 129 insertions(+), 16 deletions(-) diff --git a/docs/_includes/default.njk b/docs/_includes/default.njk index a34f47bbb..cb4b4de39 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 8af13ad08..f51ad6884 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 From 0c95c701921895f95cc8cafdb2664c6381882f5a Mon Sep 17 00:00:00 2001 From: Kelsey Jackson Date: Wed, 3 Jan 2024 11:30:16 -0600 Subject: [PATCH 2/2] updated spacing issue --- docs/pages/experimental/themer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/experimental/themer.md b/docs/pages/experimental/themer.md index d81ebc925..d9dd7bf42 100644 --- a/docs/pages/experimental/themer.md +++ b/docs/pages/experimental/themer.md @@ -116,7 +116,7 @@ toc: false break; case 'roboto-serif': fontFamily = `'Roboto Serif', serif`; - break; + break; case 'roboto-slab': fontFamily = `'Roboto Slab', serif`; break;