mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
308e272b10
* feat(ui): expand theme system to 49 themes with matched syntax highlighting Add 25 new themes sourced from shiki's bundled TextMate themes (Everforest, Nord, Solarized, GitHub, One Dark Pro, Night Owl, Material, Vitesse, Vesper, Poimandres, Ayu Dark, Houston, Laserwave, Andromeeda, Aurora X, Dark+/Light+, Min, One Light, Plastic, Red, Slack, Snazzy Light, Vitesse Black). Each theme was audited against the shiki source JSON to ensure correct color mapping. Wire pierre/diffs syntax highlighting to match the active UI theme via a SHIKI_THEME_MAP (35 of 49 themes get matched syntax token colors in diffs). Add theme preview mode — a compact bottom-docked picker that lets users browse themes while seeing the page update live behind it. Settings panel enhancements: - Syntax highlighting badge on themes with diff color matching - Mode unavailability dimming (dark-only themes dim in light mode) - Plannotator pinned first, rest alphabetical * fix(themes): address review feedback — contrast, stale CSS, syntax mode safety 1. Material light: foreground #90A4AE → #546E7A (Blue Grey 600) for readable UI text (~7:1 contrast on white). Primary-foreground #FAFAFA → #263238 for contrast on teal buttons. 2. DiffHunkPreview: add colorTheme to useEffect deps so unsafeCSS (bg/gutter injection) recomputes when themes change, preventing stale mixed-theme state in mounted tooltips during preview mode. 3. SHIKI_THEME_MAP: make mode-aware with null entries for modes lacking a shiki counterpart. resolveSyntaxTheme() returns undefined when the current mode has no match, so pierre falls back to its defaults rather than applying dark token colors on a light background (fixes Tokyo Night light). * fix(review): self-review cleanup — memo, double-call, escape key - DiffHunkPreview: extract resolveSyntaxTheme to a variable instead of calling it twice in the spread expression - PierreDiffContent memo: compare syntaxTheme by dark/light string values instead of reference equality (resolver returns new objects each call) - Preview mode: add Escape key handler to return to full settings * fix(ui): consume Escape event in theme preview to prevent leaking to page
63 lines
1.5 KiB
CSS
63 lines
1.5 KiB
CSS
/* Everforest — by sainnhe (medium contrast, default) */
|
|
.theme-everforest {
|
|
--background: #2D353B;
|
|
--foreground: #D3C6AA;
|
|
--card: #343F44;
|
|
--card-foreground: #D3C6AA;
|
|
--popover: #3D484D;
|
|
--popover-foreground: #D3C6AA;
|
|
--primary: #A7C080;
|
|
--primary-foreground: #2D353B;
|
|
--secondary: #475258;
|
|
--secondary-foreground: #D3C6AA;
|
|
--muted: #475258;
|
|
--muted-foreground: #859289;
|
|
--accent: #83C092;
|
|
--accent-foreground: #2D353B;
|
|
--destructive: #E67E80;
|
|
--destructive-foreground: #2D353B;
|
|
--border: #475258;
|
|
--input: #343F44;
|
|
--ring: #A7C080;
|
|
--success: #83C092;
|
|
--success-foreground: #2D353B;
|
|
--warning: #DBBC7F;
|
|
--warning-foreground: #2D353B;
|
|
|
|
--font-sans: system-ui, sans-serif;
|
|
--font-mono: 'Fira Code', ui-monospace, monospace;
|
|
--radius: 0.625rem;
|
|
|
|
--code-bg: #232A2E;
|
|
--focus-highlight: #7FBBB3;
|
|
}
|
|
|
|
.theme-everforest.light {
|
|
--background: #FDF6E3;
|
|
--foreground: #5C6A72;
|
|
--card: #F4F0D9;
|
|
--card-foreground: #5C6A72;
|
|
--popover: #EFEBD4;
|
|
--popover-foreground: #5C6A72;
|
|
--primary: #8DA101;
|
|
--primary-foreground: #FDF6E3;
|
|
--secondary: #E6E2CC;
|
|
--secondary-foreground: #5C6A72;
|
|
--muted: #E6E2CC;
|
|
--muted-foreground: #939F91;
|
|
--accent: #35A77C;
|
|
--accent-foreground: #FDF6E3;
|
|
--destructive: #F85552;
|
|
--destructive-foreground: #FDF6E3;
|
|
--border: #E6E2CC;
|
|
--input: #F4F0D9;
|
|
--ring: #8DA101;
|
|
--success: #35A77C;
|
|
--success-foreground: #FDF6E3;
|
|
--warning: #DFA000;
|
|
--warning-foreground: #FDF6E3;
|
|
|
|
--code-bg: #EFEBD4;
|
|
--focus-highlight: #3A94C5;
|
|
}
|