feat(dashboard): glance-style theming — 17 server-resolved presets#66
Open
ndandan wants to merge 10 commits into
Open
feat(dashboard): glance-style theming — 17 server-resolved presets#66ndandan wants to merge 10 commits into
ndandan wants to merge 10 commits into
Conversation
… auto option, i18n
…no-op) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The sticky search/topbar used a hardcoded rgba(17,17,17,.95), so on any non-midnight theme (e.g. Nord) it stayed near-black and read as a dark gap above the themed page background. Emit a translucent --prismarr-topbar-bg (theme bg + .95 alpha, preserving the blur backdrop) and consume it; border also follows --prismarr-border. Drop the now-redundant light-mode bg override. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ual refresh base.html.twig is served under Turbo Drive, which keeps the persistent <html> element across visits. data-bs-theme is a server-rendered <html> attribute, so after saving a new theme Turbo swapped the body but left the old data-bs-theme, making text unreadable until a manual refresh. Move the themed :root vars into their own <style data-turbo-track="reload"> block: identical on every page (normal visits stay fast), but a theme/accent change makes it differ so Turbo forces a full reload that re-parses data-bs-theme and the vars together. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds glance's documented themes (exact HSL from glance docs/themes.md): Catppuccin Latte/Frappe/Macchiato/Mocha, Dracula, Gruvbox Dark, Kanagawa Dark, Teal City, Camouflage, Tucan, Shades of Purple, Neon Pink, Peachy, Zebra. Updates Catppuccin Mocha + Gruvbox to glance's exact values (gruvbox -> gruvbox_dark), drops the generic clean_light (glance lights cover it), keeps midnight (default no-op), nord, solarized_light. Omitted glance positive/negative get a sensible green/red; omitted multipliers -> 1.0. DISPLAY_OPTIONS + en/fr labels kept in sync (sync test enforces it). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dashboard theming (glance-style presets)
Adds a single admin-chosen instance theme to Settings → Display (beside the existing accent picker), restyling the whole UI from a curated catalogue of 17 presets adapted from glance's
docs/themes.md.What it does
--tblr-primary-rgbis precomputed) and injected intobase.html.twig.Visual no-op by default
The default preset (
midnight) reproduces the previous dark look exactly (bg#111111, cards#1c1c1c, footer#161616, sidebar#0d0d0d, primary#6366f1) — the HSL values are calibrated so integer round-trips land on those hexes. Existing installs see no change until a theme is picked.Architecture
App\Theme\ColorMath(HSL→hex/rgb) →App\Theme\ThemePresets(the 17-preset data table) →App\Service\ThemeService::resolve()(returns{key, light, primary_hex, primary_rgb, css},ResetInterface-cached) →App\Twig\ThemeExtension(theme()fn).display_themeis a<select>inAdminSettingsController, kept in sync withThemePresetsby a test.Two non-obvious fixes (called out in case they're useful elsewhere)
<html>across visits, so a server-set theme attribute won't flip on a Turbo navigation. The themed:rootvars live in a<style data-turbo-track="reload">block, so a theme change forces one full reload; normal navigation stays fast.--prismarr-topbar-bg(theme bg + .95 alpha) rather than a hardcodedrgba(17,17,17,.95), or it would show a near-black gap on every non-midnighttheme.Definition of Done
make check(lint +lint:twig+ full PHPUnit) is green — 647 tests, 1839 assertions — run in a booted production container (the CI path). New tests:ColorMathTest,ThemePresetsTest,ThemeServiceTest,AdminSettingsThemeTest,ThemeRenderTest, plusDisplayPreferencesServiceTestupdates.CHANGELOG.md[Unreleased]andREADME.mdupdated.