From 41c22e4bb5d2db5fc09bca22e369d9b4e1134028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asger=20Geel=20Weirs=C3=B8e?= Date: Sun, 14 Jun 2026 16:20:00 +0200 Subject: [PATCH] Exact asger toggle (theme key + prefers-color-scheme), responsive container + full site-chrome components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - weirsoe-theme.js: match asger.weirsoe.dk exactly — localStorage['theme'], prefers-color-scheme default, light<->dark click delegation. - Container tokens + .wt-container(/--wide/--narrow/--bleed); Bulma adapter constrains content to a centred column past tablet (full-bleed on phones). - Site chrome extracted from agw/pw so it can drop its hardcoded CSS: .wt-header /.wt-nav/.wt-brand/.wt-nav-link/.wt-main/.wt-footer, postcard .wt-card(+date/ title/desc, --raised) and .wt-chip. README components table + theme-color note. --- README.md | 25 ++++++++++++++ adapters/bulma.css | 8 +++++ examples/demo.html | 10 +++--- weirsoe-theme.css | 81 ++++++++++++++++++++++++++++++++++++++++++---- weirsoe-theme.js | 70 +++++++++++++++++++-------------------- 5 files changed, 145 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 04b52f8..75b64c4 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,31 @@ card-styled. `wish.weircon.dk` (Christmas-Community fork) consumes it this way. Override any of them in your own `:root` to re-skin without forking. +## Components + +Semantic classes so a site can drop hand-written CSS entirely: + +| Class | What | +|---|---| +| `.wt-header` / `.wt-nav` / `.wt-brand` `.wt-brand-dot` | sticky blurred header + centred nav bar + wordmark | +| `.wt-nav-links` / `.wt-nav-link` (`.is-active` / `[aria-current=page]`) | nav link row | +| `.wt-main` | centred content column (= `.wt-container` + vertical padding) | +| `.wt-footer` / `.wt-footer-inner` | footer with border + responsive row | +| `.wt-card` (`--hover` `--raised` `--link`) + `.wt-card-date/-title/-desc` | post/list card | +| `.wt-chip` | pill tag-link | +| `.wt-btn` (`--primary`) / `.wt-input` / `.wt-tag` / `.wt-muted` | controls | +| `.prose` | long-form markdown | +| `.theme-toggle` + `.sun-and-moon` | the sun⇄moon toggle (wire with `weirsoe-theme.js`) | + +These mirror, 1:1, the chrome of `agw/pw` (asger.weirsøe.dk) — the goal is for +that site to delete `src/styles/global.css` + its inline utility soup and +`@import` this framework instead. Also set the browser UI colour in ``: + +```html + + +``` + ## Theme switching Set `data-theme` on ``: `dark` (default), `light`, or `terminal`. diff --git a/adapters/bulma.css b/adapters/bulma.css index a6934a9..76d5625 100644 --- a/adapters/bulma.css +++ b/adapters/bulma.css @@ -101,3 +101,11 @@ hr { background-color: var(--color-border); } /* Misc */ details summary { color: var(--color-accent); } .section { padding-top: 2rem; } + +/* Responsive content width: full-bleed on phones, a centred readable column on + large screens (so a wishlist doesn't stretch edge-to-edge on a desktop). The + app marks a wrapper with .container.fullwidth; constrain it past tablet. */ +@media (min-width: 769px) { + .container.fullwidth { max-width: 52rem; margin-left: auto; margin-right: auto; } + .container.fullwidth.is-wide { max-width: 72rem; } +} diff --git a/examples/demo.html b/examples/demo.html index cf3c424..8630bd8 100644 --- a/examples/demo.html +++ b/examples/demo.html @@ -4,7 +4,7 @@ weirsoe-theme demo - +