css-architecture
Skill0 starsChanged 2 months agoMITView on GitHub
CSS that scales past 10k lines — design tokens, cascade layers, dark mode, container queries, and when to reach for utility classes vs components. Use when building styling systems or reviewing CSS for large frontends.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- novatic-cu/nova-skillstheir own version, first seen Sep 20, 2026
- jgamaraalv/delivery-looptheir own version, first seen Jul 4, 2026
- lawrips/skillstheir own version, first seen Apr 26, 2026
- Piyush8296/claude-workspacetheir own version, first seen Apr 23, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- lawrips/skills★ 2same name
- Piyush8296/claude-workspace★ 2same name
- novatic-cu/nova-skills★ 1same name
- jgamaraalv/delivery-loop★ 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 repository11 other files it gives its agents.
- api-contract-designSkill
- browser-debuggingSkill
- component-reviewSkill
- frontend-testing-strategySkill
- nextjs-performanceSkill
- performance-budgetSkill
- react-hooks-disciplineSkill
- state-managementSkill
- typescript-strictnessSkill
- vue3-compositionSkill
- web-a11ySkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Every color, spacing, radius, font-size, z-index lives in a token.
- Distinctive: line 54
Test shadows/borders in dark mode — the classic broken spots.
- Distinctive: line 60
If you repeat a utility combo 3+ times, promote it to a component class.
“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
CSS architecture for grown-ups
Tokens are the API
Every color, spacing, radius, font-size, z-index lives in a token; components consume tokens, never literals:
:root {
--space-1: 4px; --space-2: 8px; --space-4: 16px;
--color-bg: #fff; --color-fg: #111;
--z-modal: 100; --z-toast: 200;
}
[data-theme='dark'] {
--color-bg: #0b0d10; --color-fg: #e7ebf0;
}- New visual tweak = new/changed token, reviewed like API. Hardcoded hex in components is a review blocker.
- Z-index is a token ladder (
dropdown < sticky < modal < toast) — neverz-index: 9999.
Layers to win specificity wars
@layer reset, tokens, base, components, utilities;Third-party styles import into base; utilities win without !important; components stay mid-cascade. This one line ends most "why isn't my style applying" archaeology.
Scope by component, not by page
- One class per element (
.card__titleor co-located module class). Descendant selectors 4+ deep are a smell. - Global element selectors only in
reset/base. Anything else belongs to a component file.
Responsive: container over viewport when it's a component
Media queries for layout; container queries for reusable components that must adapt to where they're placed:
.card-wrap { container-type: inline-size; }
@container (min-width: 480px) {
.card { display: flex; }
}Dark mode without drift
- Tokens carry the theme (above). Components never branch on theme.
- Support
prefers-color-schemeand manual override viadata-theme; persist the choice. - Test shadows/borders in dark mode — the classic broken spots.
Utilities vs components
- Utilities (
flex,mt-2) for layout glue and one-offs. - Component classes for anything reused with meaning (
.btn,.card). - If you repeat a utility combo 3+ times, promote it to a component class.
Motion
- Transitions on
transform/opacityonly (compositor-friendly). - Wrap decorative animation in
@media (prefers-reduced-motion: no-preference).
Definition of done (agent checklist)
- No raw hex/px outside token files
- Cascade layers declared; utilities import into their layer
- Every interactive state has hover and focus-visible styles
- Dark mode verified on the touched surfaces
- No
!importantoutside layers rationale - Container queries for component-local responsiveness
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.

