Front-End CSS Tokens
render_header_scripts() loads a bundled system stylesheet (assets/css/synaptikCSS.php, combining the search overlay, shortcode, and gallery-layout CSS) on pages that need it. That stylesheet is intentionally theme-agnostic — it reads its colors, spacing, and typography from CSS custom properties, which your theme's style.css is expected to define.
Every token below now has a built-in fallback value. A theme defining none of them still renders a coherent, working dark-ish default — not an invisible or broken-color UI element. tests/Unit/CssFallbackTest.php parses all three stylesheets and fails the build if any var(--token) usage is missing a fallback (with two narrow, deliberate exceptions noted below), and tests/Unit/ThemeContractTokensTest.php locks in that theme/starter/css/style.css still declares the full reference set. Skipping the tokens below is never a hard error; it's purely a "does it match your brand" question.
gallery-layout.css's name is legacy and slightly misleading — the same stylesheet also styles collapsible/tabbed sections (.c-col, .tab-group), not only gallery grids.
Chained fallbacks — define a handful of general tokens, get everything
Most of the niche, component-specific tokens below fall back to a general-purpose token first, and only then to a hardcoded literal — the same way a CSS cascade already works, just one level deeper:
--search-accent: var(--color-primary, #2e7d46);
--search-accent-light: var(--color-primary-light, #4fa75c);
--search-radius: var(--border-radius-sm, 6px);
--color-background-secondary: var(--bg-accent, rgba(255,255,255,.05));
--color-text-primary: var(--text-main, #eee);
--color-text-secondary: var(--text-secondary, #9fb0a5);
--tab-color: var(--color-primary, #4fa75c);
In practice this means defining --color-primary, --color-primary-light, --border-radius-sm, --bg-accent, --text-main, and --text-secondary in your theme's :root already gets the search overlay and gallery/collapsible styling looking coherent with the rest of your design — without learning or setting a single search- or gallery-specific variable name. A theme that wants the search bar colored differently from its main accent still can, by defining the niche token directly: it wins over the chained fallback, exactly like any other CSS cascade.
Nothing was renamed and nothing was removed to make this work — every token that existed before still works exactly as before if you already defined it.
Core tokens (shortcodes, general admin-style borrowing)
| Token | Fallback | Used for |
|---|---|---|
--color-primary | #4fa75c | Accent color across the TOC, quotes, buttons, callout borders — and the general fallback source for --search-accent/--tab-color |
--color-primary-light | #61ce70 | Hover states — and the fallback source for --search-accent-light |
--color-secondary | #4f8aa7 | Secondary accents |
--color-warning | #c05656 | Warning-styled callouts |
--bg-darker | #161815 | Backgrounds for the TOC box and similar inset elements; also read by gallery-layout.css |
--text-main | Varies by element | Body text inside system components; fallback source for --color-text-primary |
--text-secondary | #666 (search.css) / #9fb0a5 (gallery-layout.css) | De-emphasized text; fallback source for --color-text-secondary |
--font-headings | 'Saira Extra Condensed', sans-serif | Headings inside system components (the TOC label, etc.) |
--border-radius-sm | 4px (shortcodes) / 6px (search radius fallback) | Corner rounding; fallback source for --search-radius |
--transition-fast | 0.2s ease | Hover/interaction transitions |
--space-xs / --space-sm / --space-md / --space-lg | 5px / 10px / 20px / 30px | Consistent spacing scale |
--font-size-xs / --font-size-sm | 0.7em / 0.875rem | Small print inside system components |
Gallery grid tokens (gallery-layout.css — also styles collapsibles/tabs)
Naming here is inconsistent (four different prefixes for what is conceptually one set of tokens) — an existing inconsistency in core, not something your theme needs to fix. Just define the ones you want to customize; everything else falls back.
| Token | Fallback | Used for |
|---|---|---|
--bg-accent | rgba(255,255,255,.08) | Gallery/collapsible surface background; fallback source for --color-background-secondary |
--color-background-secondary | var(--bg-accent, …) | Chained — see above |
--color-border-tertiary | rgba(255,255,255,.08) | Borders on gallery/collapsible elements — no general-purpose equivalent to chain to |
--color-text-primary | var(--text-main, #eee) | Chained — see above |
--color-text-secondary | var(--text-secondary, #9fb0a5) | Chained — see above |
--tab-color | var(--color-primary, #4fa75c) | Active tab indicator, chained since before the general #2 pass |
--transition-normal | 0.3s ease | Gallery/collapsible transitions — no general-purpose equivalent |
--c-bg / --c-color | (none — see below) | Per-collapsible accent color, set inline by the editor on the .c-col element itself |
--c-bg/--c-color are deliberately exempt from the fallback rule: .c-col sets them on itself (an inline style="--c-color:…" from the editor's per-collapsible color picker), so they're never read from a theme's :root in the first place — a :root fallback for them would be dead code.
Search overlay tokens (search.css)
| Token | Fallback | Used for |
|---|---|---|
--search-text | #ffffff | Search overlay text |
--search-accent | var(--color-primary, #2e7d46) | Active/focused state accent |
--search-accent-light | var(--color-primary-light, #4fa75c) | Hover states |
--search-accent-dark | #235c35 | Pressed/active-darker states — no general-purpose equivalent |
--search-overlay-bg | rgba(10, 15, 12, 0.92) | Full-screen overlay backdrop |
--search-card-bg / --search-card-bg-hover | #1c261f / #24312a | Result card background |
--search-checkbox-border | #4a5850 | Filter checkbox border |
--search-radius | var(--border-radius-sm, 6px) | Corner rounding on the overlay and cards |
--search-section-heading | #9fb0a5 | Section labels inside results |
:root {
/* Minimum you actually need to customize, thanks to chaining */
--color-primary: #4fa75c;
--color-primary-light: #61ce70;
--border-radius-sm: 4px;
--bg-accent: rgba(255,255,255,.08);
--text-main: #eee;
--text-secondary: #9fb0a5;
/* Only if you want these to differ from the chained defaults above */
--search-accent-dark: #235c35;
--search-overlay-bg: rgba(10, 15, 12, .92);
--search-card-bg: #1c261f;
--search-card-bg-hover: #24312a;
--search-checkbox-border: #4a5850;
--search-section-heading: #9fb0a5;
}
Where to define them
Set these once, at :root level, in your theme's css/style.css — the same file you're already writing for everything else. There's no separate registration step; the system stylesheet simply reads whatever is in scope by the time it renders. theme/starter/css/style.css defines the full reference set and is the one tests/Unit/ThemeContractTokensTest.php checks against.
Callout classes emitted by the shortcode system use single dashes (sc-callout-info, sc-callout-body) — see the callout warning in Shortcodes if you're styling them yourself instead of relying on the bundled defaults.
