theming
Skill12 starsChanged 11 days agoMITView on GitHub
Use when semantic roles must map coherently across light, dark, forced-colors, or saved theme preferences without contrast or no-flash regressions.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- pierrecomputer/pierretheir own version, first seen Oct 8, 2026
- alfredobs97/flutter_agentic_templatetheir own version, first seen Sep 24, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- pierrecomputer/pierre★ 6.5ksame name
- nimadorostkar/Claude-Skills-collection★ 33same name
- alfredobs97/flutter_agentic_template★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- a11y-passSkill
- art-directionSkill
- cognitive-a11ySkill
- color-systemSkill
- component-statesSkill
- data-vizSkill
- design-system-interviewSkill
- deslop-uiSkill
- empty-statesSkill
- form-uxSkill
- humanize-copySkill
- i18n-readySkill
- improve-existing-websiteSkill
- micro-motionSkill
- responsive-layoutSkill
- spacing-systemSkill
- tastecheck-passSkill
- tasterollSkill
- web-typographySkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Choose the product baseline: Start with the default supported mode.
- Very specific: line 29
Resolve preferences deliberately: Use prefers-color-scheme, persist selectable themes, and set color-scheme so native controls follow.
- Very specific: line 72
Use assets/theme-starter.css.
- Very specific: line 75
Early saved-theme resolution: when a persistent control exists, apply the validated override before render.
- Very specific: line 93
When color-scheme drives the switch (no persisted override), light-dark() avoids media-query duplication: background: light-dark(oklch(96% …
- Very specific: line 130
Stop / handoff: Pause when semantic roles are missing and theme values would be raw-color copies (+1 in contract.json).
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Theming
A theme system keeps component roles stable while modes remap values. Components reference
semantic tokens such as --color-bg, --color-text, and --color-focus; measure every mode
before claiming accessibility. Dark is not inverted light; authored high contrast is not
forced colors.
The decision order
- Semantic tokens first. Define roles (
--color-bg,--color-surface-1/2(-3if elevation needs it),--color-text,--color-text-muted,--color-border,--color-primary,--color-primary-hover,--color-primary-ink,--color-accent,--color-accent-ink,--color-success,--color-error,--color-warning,--color-info,--color-focus— canonical contract names). Components use these only; palette comes fromcolor-system. - Choose the product baseline. Start with the default supported mode; set structure and role relationships there.
- Tune every additional mapping, never invert it. For dark, use a lighter-per-level
surface ramp, comfortable text contrast, and retuned accents. See
references/surfaces-and-elevation.mdandcolor-and-contrast.md. - Separate authored contrast from forced colors.
prefers-contrast: moremay select a higher-contrast mapping;forced-colorsis system-controlled, so honor its colors. - Resolve preferences deliberately. Use
prefers-color-scheme, persist selectable themes, and setcolor-schemeso native controls follow. - Verify each theme on its actual surfaces.
Vary mappings, preserve contract
Starter values show role mapping, not a dark recipe. Derive mappings from roles, ambient conditions, brand, and platform constraints; keep role names, forced-colors respect, preference precedence, and measured pairs intact. Missing roles require named recovery; never invent component colors.
Non-negotiables
- One semantic-token source; components never hard-code colors. Re-theming remaps tokens only.
- Choose light surfaces from context. Pure or softened endpoints can both be valid; test contrast, glare, reading comfort, and preferences.
- Dark is tuned, not inverted: near-black is reliable, but pure black can suit OLED, projection, or a stark system. Distinguish elevation with surfaces/borders, tune text below glare-inducing white where appropriate, and remeasure accents.
- Ship a default and resolution policy. A supported user choice persists and outranks OS preference; a single-theme product needs no toggle.
color-schemedeclared per theme (native controls/scrollbars follow).- Respect
forced-colors/high-contrast — don't override system colors; useforced-color-adjustdeliberately and keep focus visible. - Contrast re-verified per theme (body ≥4.5, large/UI ≥3) against that theme's surfaces — a color that passes in light often fails in dark, and vice-versa.
Resolution and recovery
Separate role names, theme values, and selection. Document precedence: system forced-colors; supported user choice; OS preference; application default. For a control, define storage and fallback.
Forced-colors is an environment, not a palette: keep system colors/native controls authoritative and preserve warnings, errors, selections, and focus with text, icons, state, or shape. If a role is absent, record a failed recovery row and stop; reusing an accent changes its meaning.
Apply the theme early to minimize wrong-theme flash. State pre-paint behavior, unavailable
saved choices, and native-control color-scheme. No-flash needs a cold-load observation
naming theme, artifact, and timing.
Quick-start
Use assets/theme-starter.css; preserve roles, tuned mappings, forced-colors cooperation,
and early saved-preference resolution.
Early saved-theme resolution: when a persistent control exists, apply the validated
override before render. In a CSP-compatible implementation, this is commonly a small
nonced or hashed <head> script rather than a deferred bundle:
<script>/* inline, in <head>, before CSS paint */
try {
const t = localStorage.getItem("theme");
if (t === "dark" || t === "light") document.documentElement.dataset.theme = t;
} catch {
/* Storage is unavailable; CSS keeps the OS/application default authoritative. */
}
</script>Browser chrome, selection, and custom scrollbars are optional polish, not completion gates.
light-dark() shorthand
When color-scheme drives the switch (no persisted override), light-dark() avoids
media-query duplication: background: light-dark(oklch(96% .02 78), oklch(18% .024 64)).
Broad browser support (2024+); pair with [data-theme] so explicit choice and
forced-colors override. It is not the sole mechanism with a manual toggle.
Reference files
references/surfaces-and-elevation.md— dark ramp, elevation, borders, shadow limits.references/color-and-contrast.md— dark accents, state colors, contrast, OKLCH.references/light-and-contrast.md— light mappings, relationships, accents, rendered checks.references/high-contrast.md—prefers-contrast+forced-colors; override limits.references/decision-records.md— meta-patterns + ADR rules.
Ledger
Close with five-field ledger. Start Reason with the check ID; name mode/environment in Evidence.
| Status | Reason | Remediation | Evidence | Provenance |
| role-map — semantic roles across supported themes | ||||
| supported-maps — each requested mode is tuned rather than inverted | ||||
| resolution — preference, no-flash, and native-control behavior | ||||
| forced-colors — high-contrast environmental behavior | ||||
| contrast-handoff — per-theme proof and accessibility boundary |
How to deliver
Report roles, mappings, resolution, wrong-theme-flash behavior, and per-theme contrast, with scoped-environment and forced-colors proof when applicable. Hand source ramps, type, technical a11y, and cognitive concerns to adjacent skills. Provenance is credited and independent.
<!-- contract:v1:start -->Contract (generated)
Canonical detail: contract.json.
- Route: An interface needs coherent light, dark, high-contrast, or forced-colors mappings (+1 in contract.json); avoid: The request is to invent the source palette rather than map semantic roles (+1 in contract.json)
- Exclude: Do not invert a light palette and call it dark mode (+1 in contract.json)
- Stop / handoff: Pause when semantic roles are missing and theme values would be raw-color copies (+1 in contract.json); receives [color-system, design-system-interview, improve-existing-website, tasteroll] -> sends [a11y-pass, cognitive-a11y, responsive-layout, component-states]
- Output: Semantic mappings for every supported theme, plus forced-colors behavior, preference policy, and measured pairs
- Evidence:
table_with_evidencewithstatus,reason,remediation,evidence,provenance.
<!-- contract:v1:end -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

