Accent tone setting with macOS-style swatches (indigo default)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -95,6 +95,7 @@
|
||||
--color-border: var(--border);
|
||||
--color-input: var(--input);
|
||||
--color-ring: var(--ring);
|
||||
--color-cursor-tint: var(--cursor-tint);
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
@@ -125,6 +126,43 @@
|
||||
--path-ctl-h: 32px;
|
||||
}
|
||||
|
||||
/* Accent tone (data-accent set by SettingsService; absent = graphite/zinc).
|
||||
Each tone is one hue+chroma line; the formula blocks below derive --primary,
|
||||
--ring and the cursor-row tint for light and both dark states. The dark
|
||||
formula blocks (0,3,0) outrank the base dark token blocks and the light
|
||||
formula block (0,2,0) in every dark state; graphite matches no [data-accent]
|
||||
selector and keeps the zinc tokens untouched. */
|
||||
:root {
|
||||
/* graphite: cursor row identical to the old bg-accent highlight */
|
||||
--cursor-tint: var(--accent);
|
||||
}
|
||||
:root[data-accent='blue'] { --tone-h: 255; --tone-c: 0.17; }
|
||||
:root[data-accent='indigo'] { --tone-h: 277; --tone-c: 0.19; }
|
||||
:root[data-accent='purple'] { --tone-h: 305; --tone-c: 0.17; }
|
||||
:root[data-accent='rose'] { --tone-h: 8; --tone-c: 0.17; }
|
||||
/* darkest orange that still reads orange; white button text lands ≈ 4.3:1 */
|
||||
:root[data-accent='orange'] { --tone-h: 50; --tone-c: 0.18; --tone-l: 0.58; }
|
||||
:root[data-accent='green'] { --tone-h: 150; --tone-c: 0.15; }
|
||||
:root[data-accent='teal'] { --tone-h: 185; --tone-c: 0.12; }
|
||||
|
||||
:root[data-accent] {
|
||||
--primary: oklch(var(--tone-l, 0.55) var(--tone-c) var(--tone-h));
|
||||
--ring: oklch(0.62 calc(var(--tone-c) * 0.55) var(--tone-h));
|
||||
--cursor-tint: color-mix(in oklab, var(--primary) 8%, transparent);
|
||||
}
|
||||
:root[data-theme='dark'][data-accent] {
|
||||
--primary: oklch(0.72 calc(var(--tone-c) * 0.85) var(--tone-h));
|
||||
--ring: oklch(0.62 calc(var(--tone-c) * 0.55) var(--tone-h));
|
||||
--cursor-tint: color-mix(in oklab, var(--primary) 12%, transparent);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root[data-accent]:not([data-theme='light']) {
|
||||
--primary: oklch(0.72 calc(var(--tone-c) * 0.85) var(--tone-h));
|
||||
--ring: oklch(0.62 calc(var(--tone-c) * 0.55) var(--tone-h));
|
||||
--cursor-tint: color-mix(in oklab, var(--primary) 12%, transparent);
|
||||
}
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user