From ca02182f8925fc4aaf3fa39854bc923632a0f191 Mon Sep 17 00:00:00 2001 From: Luca Pattocchio <15154851+Kasui92@users.noreply.github.com> Date: Sun, 6 Sep 2026 19:24:32 +0200 Subject: [PATCH 1/6] fix: restore border-box on the showcase chrome --- www/src/styles/site.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/src/styles/site.css b/www/src/styles/site.css index ca005c1..2c70bcf 100644 --- a/www/src/styles/site.css +++ b/www/src/styles/site.css @@ -7,6 +7,14 @@ --site-page-padding: var(--identity-page-padding); } +/* JAAD gets this from Tailwind's preflight; without it, padding is added to + width and .site-main overflows the viewport by its own padding. */ +*, +*::before, +*::after { + box-sizing: border-box; +} + html { background-color: var(--identity-background); color: var(--identity-foreground); From 6906cf3516cadf0eecad9d67e91f4f57a87600c3 Mon Sep 17 00:00:00 2001 From: Luca Pattocchio <15154851+Kasui92@users.noreply.github.com> Date: Sun, 6 Sep 2026 19:24:43 +0200 Subject: [PATCH 2/6] feat: add the theme picker to the showcase --- tests/build/smoke.mjs | 40 ++++++++++++++ www/astro.config.mjs | 27 +++++++++- www/src/components/SiteThemePicker.astro | 61 ++++++++++++++++++++++ www/src/components/SiteThemeToggle.astro | 66 ------------------------ www/src/layouts/SiteLayout.astro | 53 ++++++++++++++++--- www/src/styles/jaamd.css | 23 +++++++-- www/src/styles/site.css | 48 +++++++++-------- www/src/themes.ts | 25 +++++++++ 8 files changed, 239 insertions(+), 104 deletions(-) create mode 100644 www/src/components/SiteThemePicker.astro delete mode 100644 www/src/components/SiteThemeToggle.astro create mode 100644 www/src/themes.ts diff --git a/tests/build/smoke.mjs b/tests/build/smoke.mjs index 4b14f0b..0f78c92 100644 --- a/tests/build/smoke.mjs +++ b/tests/build/smoke.mjs @@ -138,6 +138,46 @@ check( "the anchor icon stays invisible on the deeper levels", ); +// ─── themes ────────────────────────────────────────────────────────────────── + +const themeSlugs = [ + ...new Set([...html.matchAll(/html\[data-jaamd-theme="([a-z0-9-]+)"\]/g)].map((m) => m[1])), +]; + +check( + `themes: ${themeSlugs.length} scoped in the page`, + themeSlugs.length > 0, + "the layout did not inject the re-scoped theme CSS", +); + +// Authored on :root, so without re-scoping only the last import would ever win. +check( + "themes: none left on bare :root", + !/(^|\})\s*:root\s*\{[^}]*--jaamd-color-primary/.test(html), + "a theme reached the page unscoped and will override every other one", +); + +check( + "themes: the site bridge is scoped too", + /\[data-jaamd-theme=("?)jaamd\1\]/.test(css), + "an unscoped bridge outranks the themes, so only secondary colours would change", +); + +// One Shiki variable per theme is what lets code follow the switch. +for (const slug of themeSlugs) { + check( + `themes: ${slug} has its Shiki colours baked`, + html.includes(`--shiki-${slug}:`), + `add ${slug} to shikiConfig.themes, or its code blocks keep the previous theme`, + ); +} + +check( + "themes: the picker lists every theme plus the site's own", + countOf(/