Unify colour scheme and CSS as one Style list in settings UI (ticket 047)
The settings panel had two separate sections — "Colour scheme" (built-in palettes) and "CSS" (imported/linked stylesheets) — even though the data model (tickets 012/020) already treats both as equally-selectable themes via custom_theme_id. Merge them into one "Style" section presenting a single list: built-in scheme pills plus imported/linked entries, any of which can be a palette swap or a full layout override, with copy that no longer implies "colour scheme" and "CSS" are separate features. Traced and manually verified (via a running dev server) that a user-supplied stylesheet is not constrained to --c-* variable overrides: import_css/get_css_content in src/api.rs and src/settings.rs store and serve the raw content unmodified (no sanitization or selector scoping), and applyCustomThemeCss injects it as a plain unscoped <link> tag — a stylesheet with e.g. `flex-direction`/`font-size` rules on real selectors applies exactly as authored, alongside the required --c-* declarations. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
7c331e76b1
commit
5b31f51526
@@ -1,4 +1,10 @@
|
||||
// A theme file is a CSS file with one `:root { --c-*: ...; }` block defining every variable in `THEME_CSS_VARS`; `useSettingsPanel` applies the selected one as an unscoped stylesheet only while no built-in `html.<scheme>` class is present, so it wins the cascade without rewriting the selector.
|
||||
// A user-supplied style is any CSS file that defines every variable in `THEME_CSS_VARS` somewhere in
|
||||
// a `:root { --c-*: ...; }` block (ticket 020/047: styles are selectable on equal footing with the
|
||||
// built-ins, and there's no requirement that this block be the *only* thing the file contains — a
|
||||
// style is free to also target any other selector, e.g. to restyle layout, spacing, or fonts, not
|
||||
// just the palette). `useSettingsPanel` applies the selected one as an unscoped stylesheet only
|
||||
// while no built-in `html.<scheme>` class is present, so it wins the cascade without rewriting the
|
||||
// selector.
|
||||
|
||||
/** Canonical list of every `--c-*` variable every theme in `index.css` defines. */
|
||||
export const THEME_CSS_VARS = [
|
||||
|
||||
Reference in New Issue
Block a user