Extract the color palette into --yw-* custom properties (a formal theme)
Preparation for the yamocir migration: same computed colors as before, now expressed as reusable, documented tokens instead of literals baked into each rule. Also documents scope in README.md's new Theming section -- this module ships exactly one theme; per-project theming (e.g. yaais's light/dark toggle) belongs in that project, not here.
This commit is contained in:
1 parent
5d7f67b3d3
commit
ef0714e213
2 files changed
+75
-29
No files matched your search
@@ -59,6 +59,25 @@ Stays in each consuming project: page-specific templates
|
||||
(`templates/pages/*.html.tmpl`), page-content CSS (cards, tables, badges,
|
||||
forms, buttons, markdown, ...), and anything else specific to that tool.
|
||||
|
||||
## Theming
|
||||
|
||||
`static/style.css`'s palette is exposed as `--yw-*` CSS custom properties
|
||||
on `:root` (`--yw-bg`, `--yw-text`, `--yw-chrome-bg`, `--yw-accent`,
|
||||
`--yw-nav-link`, `--yw-success-*`/`--yw-danger-*`, ...) rather than baked
|
||||
directly into each rule — it's a documented, reusable theme, not just an
|
||||
implementation detail. This is the *only* theme the module ships: fixed
|
||||
dark, no `prefers-color-scheme`, no light mode. Don't add one here on a
|
||||
per-project basis (redefining `--yw-*` globally in one consumer would
|
||||
silently reskin every future consumer sharing this CSS file); a project
|
||||
that genuinely needs a different look — e.g. a light/dark toggle, like
|
||||
`yaais` has — should own that itself rather than pushing multi-theme
|
||||
complexity into this module, since `yaais` shows that need doesn't
|
||||
actually require *this* module either (it's a client-rendered SPA, not a
|
||||
server-rendered Go-template dashboard). If a real case for a second theme
|
||||
*in* this module shows up later, the `--yw-*` tokens are exactly the
|
||||
seam to add one through — redefine them under a `[data-theme="..."]`
|
||||
selector the way `yaais`'s own stylesheet does.
|
||||
|
||||
## Consuming this module
|
||||
|
||||
```go
|
||||
|
||||
Reference in new issue
Block a user