Rename bg/fg palette keys to background/foreground

The canonical colors.toml keys are now background/foreground, including
all permutations (dark_background, darker_background, lighter_background,
dark_foreground, light_foreground, bright_foreground). The old short
names are gone entirely, not kept as aliases; legacy alacritty-generated
themes still resolve through the ANSI color0/color7 fallback.

Theme files are also regrouped: accent/selection/muted first, then the
backgrounds, then the foregrounds, then the named colors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-18 16:24:51 -07:00
co-authored by Claude Fable 5
parent 72d7646c64
commit afa2839a5a
46 changed files with 747 additions and 718 deletions
+4 -9
View File
@@ -4,9 +4,8 @@ import Quickshell
import Quickshell.Io
import "BorderGeometry.js" as Geometry
// Color surfaces for the shell. Foundational palette (fg, bg, accent,
// urgent) comes from theme/colors.toml and is exposed here as
// foreground/background/accent/urgent. Per-surface roles come from
// Color surfaces for the shell. Foundational palette (foreground, background,
// accent, urgent) comes from theme/colors.toml. Per-surface roles come from
// theme/shell.toml — generated per theme from default/themed/shell.toml.tpl,
// or shipped directly by a theme to replace the generated file. Surfaces that
// don't appear in shell.toml fall back to the foundational palette.
@@ -146,8 +145,6 @@ QtObject {
var lines = String(raw || "").split("\n")
var foundAccent = false
var foundMuted = false
var foundForeground = false
var foundBackground = false
var loadedForeground = false
var loadedBackground = false
var color0Value = ""
@@ -157,10 +154,8 @@ QtObject {
for (var i = 0; i < lines.length; i++) {
var match = lines[i].match(/^\s*([A-Za-z0-9_-]+)\s*=\s*["']?(#[0-9A-Fa-f]{6})/)
if (!match) continue
if (match[1] === "foreground") { foreground = match[2]; foundForeground = true; loadedForeground = true }
else if (match[1] === "background") { background = match[2]; foundBackground = true; loadedBackground = true }
else if (match[1] === "fg" && !foundForeground) { foreground = match[2]; loadedForeground = true }
else if (match[1] === "bg" && !foundBackground) { background = match[2]; loadedBackground = true }
if (match[1] === "foreground") { foreground = match[2]; loadedForeground = true }
else if (match[1] === "background") { background = match[2]; loadedBackground = true }
// Prefer the explicit `accent` key; only fall back to color4 when the
// theme doesn't define a separate accent. color4 appears later in the
// file so the old single-property approach clobbered accent with it.