Skip to content

Commit d35bbf8

Browse files
Merge pull request #29 from minimaldesign/collapse-atoms-layer
Collapse the atoms cascade layer into components
2 parents 3d7c072 + 8c17dc9 commit d35bbf8

34 files changed

Lines changed: 294 additions & 477 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: |
4141
set -e
4242
# layers survived the build (the preset-env polyfill must stay off)
43-
grep -q '@layer settings, base, elements, global, atoms, components, pages, helpers;' dist/mcss.css
43+
grep -q '@layer settings, base, elements, global, components, pages, helpers;' dist/mcss.css
4444
! grep -q ':not(#' dist/mcss.css
4545
# no unresolved custom media or mixins shipped
4646
# (plain '@custom-media' appears in a comment; check real syntax)

DESIGN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ Class naming is BEM-like with mCSS separators: `.block`, `.block_element`, `.blo
208208

209209
## Do's and Don'ts
210210

211-
Do preserve the native cascade-layer setup: framework files import into named layers (`settings, base, elements, global, atoms, components, pages, helpers`) via `src/styles/framework/mcss.css`; site-only files import unlayered via `src/styles/_global.css`.
211+
Do preserve the native cascade-layer setup: framework files import into named layers (`settings, base, elements, global, components, pages, helpers`) via `src/styles/framework/mcss.css`; site-only files import unlayered via `src/styles/_global.css`.
212212

213-
Do add new CSS files with the correct layer prefix, such as `component.name.css`, `atom.name.css`, or `help.name.css`, then import them with `layer(<name>)` in `framework/mcss.css` (framework) or plainly in `_global.css` (site).
213+
Do add new CSS files with the correct layer prefix, such as `component.name.css` or `help.name.css`, then import them with `layer(<name>)` in `framework/mcss.css` (framework) or plainly in `_global.css` (site).
214214

215215
Do use semantic theme tokens when they exist. Raw palette tokens are fine for new semantic roles, but component CSS should converge on named component properties.
216216

217217
Do keep all formatting at 2 spaces (CSS, Astro, JS, TS), per `.editorconfig`.
218218

219-
Don't use page-specific CSS when a reusable component or atom is the better fit.
219+
Don't use page-specific CSS when a reusable component is the better fit.
220220

221221
Don't bypass dark mode by hard-coding light-only text, border, or surface colors.
222222

agents/content.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ Do not use the em dash character (`—`) in blog posts. Use commas, a colon, par
3434
| `title` | string | yes |
3535
| `lastUpdate` | date | yes |
3636
| `version` | number | yes |
37-
| `type` | `"intro"` \| `"atom"` \| `"component"` | yes |
37+
| `type` | `"intro"` \| `"component"` | yes |
38+
| `cssOnly` | boolean (optional) | no |
39+
40+
`cssOnly: true` marks class-only components with no Astro file (badge, button, toggle); it drives the "(CSS-only)" label in `/llms.txt`.
3841

3942
`version` tracks the maturity of the documented component itself (not the doc): `< 1` = API may still change, `1.0` = stable contract, bump on breaking changes. Keep it honest — a component with open bugs isn't `1.0`.
4043

agents/css.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mCSS uses **native CSS cascade layers** (`@layer`) on top of an ITCSS-inspired f
99
## Cascade rules (load-bearing)
1010

1111
1. Framework layers, in priority order (later wins):
12-
`settings, base, elements, global, atoms, components, pages, helpers`
12+
`settings, base, elements, global, components, pages, helpers`
1313
2. **Unlayered CSS beats every layer for normal declarations.** That's the consumer guarantee ("your CSS wins") and why site CSS is unlayered.
1414
3. **Helpers are the exception: every helper declaration carries `!important`.** Important layered declarations beat unlayered CSS (the cascade inverts for important), so helpers win over site and consumer CSS too. They're element-level overrides, like inline styling. For important declarations layer order also inverts (earlier layer wins), which is why the reduced-motion block in `base.reset.css` still beats helpers.
1515
4. `!important` is REQUIRED in every helper declaration and banned everywhere else in the framework, except the reduced-motion block in `base.reset.css` and third-party override files (see `site/external.astro.css`). `help.colors.css` and `help.spacing.css` get it from their generators.
@@ -23,8 +23,7 @@ mCSS uses **native CSS cascade layers** (`@layer`) on top of an ITCSS-inspired f
2323
| base | `base.*` | Reset only (`base.reset.css`) |
2424
| elements | `elements.*` | Bare HTML element styles (text, form, media) |
2525
| global | `global.*` | Structural patterns (a11y, grid, layout, prose, wrap) |
26-
| atoms | `atom.*` | Small single-purpose UI (button, toggle) |
27-
| components | `component.*` | Library components (card, hero, notice, …) |
26+
| components | `component.*` | Library components (card, hero, notice, …), including CSS-only single-class ones (badge, button, toggle) |
2827
| pages | `page.*` | Page-specific styles that helpers may override |
2928
| helpers | `help.*` | Utility overrides (colors, spacing, typography), all `!important`: beats everything, including unlayered CSS |
3029

agents/structure.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ src/
2727
| --------------------- | --------------------------------- | ----------------------------------------------------------------------- |
2828
| New page route | `src/pages/` ||
2929
| New reusable UI | `src/components/` | If it needs CSS: add `component.<name>.css` (see rows below) |
30-
| New atom style | `src/styles/framework/atom.<name>.css` | Import with `layer(atoms)` in `framework/mcss.css` |
3130
| New library component style | `src/styles/framework/component.<name>.css` | Import with `layer(components)` in `framework/mcss.css` |
3231
| New site-only style | `src/styles/site/<prefix>.<name>.css` | Import (unlayered) in `_global.css` |
3332
| New blog post | `src/content/blog/` | Match schema (see agents/content.md) |

dist/css/component.articleCard.css

Lines changed: 0 additions & 108 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ xxl: 1920px
2424

2525
/* truncate single line of text and adds … */
2626

27-
@layer atoms {
27+
@layer components {
2828
/* BADGE */
2929

3030
.badge {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ xxl: 1920px
2424

2525
/* truncate single line of text and adds … */
2626

27-
@layer atoms {
27+
@layer components {
2828
.button,
2929
.bt {
3030
display: inline-flex;

dist/css/component.card.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ xxl: 1920px
109109
transform: translate(var(--xs2), calc(var(--xs2) * -1));
110110
}
111111

112-
/* Badge visuals come from the .badge atom (atom.badge.css); the Card
113-
component renders class="badge card_badge" on each badge. */
112+
/* Badge visuals come from the badge component (component.badge.css); the
113+
Card component renders class="badge card_badge" on each badge. */
114114

115115
.card_tags {
116116
/* keep the tags clickable above the stretched .card_link */

dist/css/component.postList.css

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)