Modern style as the new default; style axis, slate palette, nav groups and icons

A third appearance axis, PageHeader.Style (<html data-style>), with
StyleModern -- the default when Style is empty -- and StyleClassic, the
look up to v0.4.x. The modern style is one [data-style="modern"] block
at the end of style.css over the classic rules: navbar without a rule,
the sidebar as a floating rounded card with group headings, icons and
a pill for the active entry, rounder and quieter Bootstrap components.
In it inactive sidebar links use the text color; #0b82b8 now only
colors them in the classic style (owner decision 2026-11-28).

- appearance menu: "Style"/"Stil" section, cookie yw_style
- palette slate (dark slate and lavender)
- NavItem.Group (sidebar group headings) and NavItem.Icon (names from
  the new NavIcons set, shown only in the modern style)
- cmd/webui-demo: a sample page for comparing styles, palettes and modes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
terminarandClaude Opus 5.5 committed 2026-11-28 11:11:28 +01:00
1 parent 7afb6a022a
commit 33dfebab9e
13 files changed
+771 -28

No files matched your search

+30 -3
View File
@@ -30,14 +30,41 @@ forms, buttons, markdown, ...), and anything else specific to that tool.
## Theming
Two independent axes, both set on `<html>` and resolved on the server:
Three independent axes, all set on `<html>` and resolved on the server:
| Axis | `PageHeader` field | Attribute | Values |
|---|---|---|---|
| Mode | `Theme` | `data-theme` | `layout.ThemeDark` (also `""`, unset), `ThemeLight`, `ThemeSystem` (follows `prefers-color-scheme`) |
| Colors | `Palette` | `data-palette` | `layout.PaletteDefault` (also `""`), `PaletteGraphite` (grey/violet, after nessajina.tv), `PaletteContrast` (high contrast) |
| Colors | `Palette` | `data-palette` | `layout.PaletteDefault` (also `""`), `PaletteGraphite` (grey/violet, after nessajina.tv), `PaletteContrast` (high contrast), `PaletteSlate` (slate/lavender) |
| Shape | `Style` | `data-style` | `layout.StyleModern` (also `""`, the default since v0.5.0), `StyleClassic` (the look up to v0.4.x) |
A consumer that sets neither keeps the original dark look.
A consumer that sets none gets the modern style, dark, palette Yetano.
### Styles: modern (default) and classic
Since v0.5.0 the default is the modern style: navbar without a rule,
the sidebar as a floating rounded card with small group headings,
icons and a pill for the active entry, and rounder, quieter Bootstrap
components (cards, buttons, form fields, tables, list groups, tinted
status badges). It is one block of `[data-style="modern"]` rules at
the end of `static/style.css` over the classic rules; the template
always sets `data-style` (`modern` when `Style` is empty), so
`data-style="classic"` still gives exactly the old look. Visitors pick
either in the appearance menu ("Style"/"Stil", cookie `yw_style`); a
consumer that wants the old look by default sets `Style: StyleClassic`
before `ApplyAppearance`.
Two optional `NavItem` fields feed it: `Group` (a heading above the
first item of each run of equal groups, shown in both styles) and
`Icon`, a name from `layout.NavIcons` (`dashboard`, `server`, `box`,
`users`, `key`, `shield`, `settings`, ...; shown only in the modern
style). In the modern style inactive sidebar links use the text color;
the cross-project `#0b82b8` (`--yw-nav-link` of the default palette)
now only colors them in the classic style (owner decision 2026-11-28).
`go run ./cmd/webui-demo` serves a sample page (http://127.0.0.1:8097/)
for comparing styles, palettes and modes; `?style=`, `?palette=` and
`?theme=` set the same cookies as the menu.
How `static/style.css` does it: