From b35c30d5ab89117cebf6a2267a86845c1ea44898 Mon Sep 17 00:00:00 2001 From: Jokin Date: Sun, 16 Aug 2026 04:53:57 +0200 Subject: [PATCH] Stage 3: split styles.css into a shared base plus per-skin sheets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 919-line stylesheet had a clean seam: `main`'s version is 278 lines and this branch only ever APPENDED to it. Verified that directly — a diff of main's styles.css against our first 298 lines differs only by the @layer statement and the 7.css import. - ui/src/styles.css (296) keeps the shared half: the @layer statement, the Tailwind import, the OKLCH tokens, @theme inline, the data-text interface sizes, the animations and the accent axis. The @layer statement must stay first here — it is one of only two rule types allowed above @import, and it is what sorts `skin` above `utilities`. - app/skins/7like/7like.css (636) takes the whole win7 section plus the scoped-7.css import that feeds layer(skin). - app/skins/shadlike/shadlike.css is near-empty by nature, not by omission: that skin IS the shared token system plus inline Tailwind, so there is no framework to bridge and no cascade to invert. The file documents why, and what does/does not belong in it. Both are @imported from styles.css, so one bundle still ships both, scoped by `.win7` exactly as before. One real trap caught here: the @font-face url() is resolved relative to the stylesheet, so moving the win7 section three directories deeper would have silently 404'd Noto Sans — the build stays green and the app just falls back to a different font. Fixed by moving the fonts INTO the skin (they exist only for the Win7 look, where Noto Sans substitutes for Segoe UI), which keeps `./fonts/...` correct wherever the folder goes. Confirmed in the built output: both woff2 emitted as hashed assets with the url rewritten to ./media/. Verified: build clean, built CSS keeps `@layer theme,base,components, utilities,skin,skinfix` and all 7.css selectors, the live window's opaque interior is pixel-identical to the pre-refactor baseline, and both harness renders (light and dark) diff to exactly zero. A layer-assignment mistake here would not be subtle — 7.css would lose to ~1900 Tailwind utilities and the app would look nothing like this. Co-Authored-By: Claude --- ui/src/app/skins/7like/7like.css | 636 +++++++++++++++++ .../fonts/noto-sans-latin-400-normal.woff2 | Bin .../fonts/noto-sans-latin-700-normal.woff2 | Bin ui/src/app/skins/shadlike/shadlike.css | 27 + ui/src/styles.css | 637 +----------------- 5 files changed, 670 insertions(+), 630 deletions(-) create mode 100644 ui/src/app/skins/7like/7like.css rename ui/src/{ => app/skins/7like}/fonts/noto-sans-latin-400-normal.woff2 (100%) rename ui/src/{ => app/skins/7like}/fonts/noto-sans-latin-700-normal.woff2 (100%) create mode 100644 ui/src/app/skins/shadlike/shadlike.css diff --git a/ui/src/app/skins/7like/7like.css b/ui/src/app/skins/7like/7like.css new file mode 100644 index 0000000..47abcd8 --- /dev/null +++ b/ui/src/app/skins/7like/7like.css @@ -0,0 +1,636 @@ +/* The SCOPED 7.css build: postcss-prefix-selector rewrote every selector to + `.win7` (root rules) or `.win7 ` (the rest), so the whole framework is + inert until SettingsService.applySkin puts that class on . All 61 + icons are data URIs, so nothing needs copying into assets — and NOT the + `7.inline.css` build, which flattens away the --w7-* vars the dark palette + below depends on. The deep path is required: 7.css ships no `exports` map + and Tailwind's resolver only reads `style`/`mainFields`, so a bare + `@import "7.css"` finds no entry. */ +@import "7.css/dist/7.scoped.css" layer(skin); + +/* ========================================================================== + Windows 7 skin — SettingsService.applySkin puts `.win7` on + ========================================================================== + + Three tiers, and the split matters: + + - `@layer skin` (the 7.css import at the top of this file) owns the + CONTROLS: buttons, inputs, tabs, progress bars, tree views, the Aero + title bar. It sits ABOVE `utilities`, so a bare `button` rule in 7.css + beats `.rounded-md` on that same button. That inversion is the whole + trick — it restyles ~1900 inline utility classes with no template edits. + - This unlayered section owns the BRIDGE: it re-points the app's own + semantic tokens at Win7 values, so utilities Tailwind still controls + (bg-card, border-border, text-muted-foreground) also come out + Win7-correct. It adds NO new tokens on purpose — a new colour token + would need a matching `--color-*` line in `@theme inline`. + - `@layer skinfix` (last, above `skin`) hands individual properties BACK to + the utilities layer with `revert-layer`, for the places where 7.css's + Win7-dialog metrics are wrong for this app. + + WARNING for future edits: because `skin` outranks `utilities`, any Tailwind + utility added later to a