Files
ottyl/tickets/020-css-themes-full-replacement.md
T
2026-09-05 19:29:01 +01:00

2.2 KiB

Make imported/linked CSS always a full theme replacement

From WISHLIST.md: colour schemes should be full CSS replacements — there should be no "use as theme" tickbox distinguishing a selectable alternative theme from an always-on overlay. Every imported/linked stylesheet should just work the same way as the built-in colour schemes: a selectable, full replacement.

Currently NavMenu.tsx's CSS section has an is_theme/"Use as theme" checkbox (cssIsTheme/cssLinkIsTheme state, panel.importCssEntry(filename, content, isTheme) / panel.linkCssEntry(url, isTheme)) that decides whether an entry becomes a selectable theme (validated against the canonical --c-* variable set, toggled via panel.setCustomTheme) or an always-on CSS overlay applied on top of the active colour scheme. This ticket removes that distinction: every imported/linked stylesheet is validated as a theme and becomes a selectable alternative to the built-in colour schemes, same as today's is_theme: true path.

Acceptance criteria

  • The "Use as theme" checkboxes are removed from both the CSS import form and the CSS link form in NavMenu.tsx.
  • Imported/linked CSS is always validated against the canonical --c-* theme variable set (parseThemeCss) and always becomes a selectable theme entry (today's is_theme: true behavior) — the "always-on overlay" mode is removed.
  • The explanatory text "imported/linked stylesheets — check 'Use as theme' to make one a selectable alternative to the built-in colour schemes above instead of an always-on overlay" is deleted/rewritten to reflect the simpler model (every entry is a selectable theme).
  • The CSS filename input's placeholder changes from "name.css" to "enter name".
  • Backend/CssEntry/is_theme plumbing (src/settings.rs, src/api.rs, src/dto.rs, webapp/src/lib/api.ts) is simplified accordingly if is_theme becomes always-true and dead as a variable — remove it if no longer meaningful, or confirm it's still needed for backward compatibility with existing saved entries.
  • Existing saved CSS entries (including any persisted with is_theme: false) keep working — decide and document how they're treated (e.g. migrated to always selectable) rather than silently breaking.