You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Scopeable styles** — emitted globally by default, optionally wrappable in `@scope`:
@@ -164,7 +164,7 @@ For users who need component isolation (`.no-nimble` opt-out), two paths are ava
164
164
1.**JS progressive enhancement (recommended):** Include `no-nimble.js` alongside the CSS. The script uses sentinel CSS custom properties to find the boundary between global and scopeable rules, wraps the scopeable portion in `@scope` at runtime, and auto-detects broken browsers.
165
165
2.**SCSS build-time opt-in:** Set `$exclude-selector: '.no-nimble'` for a pure-CSS solution (with the caveat that desktop Safari will be affected).
166
166
167
-
Layout utilities are intentionally global because they interact with the body grid (e.g., `.full-bleed` sets `grid-column: 1 / -1`). An element with `class="no-nimble full-bleed"` should still participate in the body grid layout even though nimble's component styles (typography, forms, etc.) don't apply inside it.
167
+
Layout utilities are intentionally global because they interact with the body grid (e.g., `.bleed-full` sets `grid-column: 1 / -1`). An element with `class="no-nimble bleed-full"` should still participate in the body grid layout even though nimble's component styles (typography, forms, etc.) don't apply inside it.
168
168
169
169
See [Section 15.2](#152-third-party-component-isolation-no-nimble-opt-out) for usage details and design rationale.
170
170
@@ -265,7 +265,7 @@ nimble.css takes a **middle path**: ~20 semantic custom properties on `:root`, p
265
265
/* --- Spacing & Layout --- */
266
266
--nc-radius: /* default border radius */
267
267
--nc-spacing: /* base spacing unit */
268
-
--nc-content-width: /* max-width for centered container (~720px) */
268
+
--nc-content-width: /* max-width for centered container (60ch, ~480-600px depending on font) */
269
269
}
270
270
```
271
271
@@ -277,7 +277,7 @@ Compared to the original draft's ~25, we cut:
277
277
-`transition` -- hardcoded `0.2s ease-in-out`
278
278
-`text-1` / `text-2` -- replaced by single `--nc-text`; muted text uses `color-mix()` inline
279
279
-`text-heading` -- headings differentiate via size, not color
280
-
-`wide-width` -- hardcoded in `.wide` utility
280
+
-`wide-width` -- hardcoded in `.bleed-wide` utility
Heading sizes are the same at all viewport widths. The previous phone-breakpoint scale-down (h1: 1.75rem, h2: 1.5rem, h3: 1.3rem) was removed — the differences were too small (3-4px) to justify a jarring layout shift, and `text-wrap: balance` handles long headings on narrow screens.
589
596
590
597
### 8.4 Vertical Rhythm
591
598
@@ -931,9 +938,10 @@ These interact with the body grid and must work everywhere, including on `.no-ni
@@ -964,7 +972,7 @@ These interact with the body grid and must work everywhere, including on `.no-ni
964
972
965
973
The `.no-nimble` class requires opt-in activation — either via `no-nimble.js` (recommended) or the `$exclude-selector` SCSS flag. Without activation, the class has no effect. See [Section15.2](#152-third-party-component-isolation-no-nimble-opt-out) for details.
966
974
967
-
**Total class count: ~10** (~9 utilities + `.no-nimble` opt-out).
975
+
**Total class count: ~11** (~10 utilities + `.no-nimble` opt-out).
968
976
969
977
## 11. Breakpoints
970
978
@@ -976,15 +984,17 @@ nimble.css uses:
976
984
977
985
| Name | Value | Purpose |
978
986
|---|---|---|
979
-
| `phone` | `max-width: 720px` | Scaledown headings, make form inputs full-width |
987
+
| `phone` | `max-width: 720px` | Make form inputs full-width, collapse `.grid` to single column |
980
988
| `tablet` (optional) | `max-width: 1024px` | May be used for wide-content breakout adjustments |
981
989
982
990
That's it. The grid-based centered layout is inherently responsive without breakpoints.
983
991
984
992
### 11.2 What Changes at the Phone Breakpoint
985
993
986
-
- Headings h1-h3 scale down (see Section 8.3).
987
994
- Form inputs, select, and textarea go full-width.
995
+
- `.grid` collapses to a single column.
996
+
997
+
The content shadow visibility is **not** controlled by the phone breakpoint — it uses a `clamp()` formula that snaps the shadow to 0 width when there isn't enough space for meaningful gaps between the shadow edge and viewport edge. This means the shadow disappears at acontent-width-dependent threshold, not at afixed pixel breakpoint.
988
998
989
999
## 12. File Structure & Build
990
1000
@@ -999,7 +1009,7 @@ nimble.css/
999
1009
_colors.scss # Color properties (oklch generation +light-dark())
@@ -1208,7 +1218,7 @@ Published via GitHub Pages, built by CI. No built CSS in the repo.
1208
1218
Lessons from MVP.css, new.css, and HN discussions:
1209
1219
1210
1220
-**MVP.css** abuses semantic HTML (using `aside` for cards, `a strong` for buttons) to avoid classes. This harms accessibility and confuses developers.
1211
-
-**Pure classless is insufficient** for real-world use. You need at least: a way to distinguish primary/secondary buttons, striped tables, layout modes, and full-bleed content.
1221
+
-**Pure classless is insufficient** for real-world use. You need at least: a way to distinguish primary/secondary buttons, striped tables, layout modes, and bleed/breakout content.
1212
1222
-**Minimum viable classes**: nimble.css uses ~9 classes total. Every class has a clear, non-overlapping purpose.
@@ -1229,17 +1239,17 @@ This means nimble's component styles apply everywhere **except** inside elements
1229
1239
1230
1240
```html
1231
1241
<!-- nimble styles apply here -->
1232
-
<mainclass="fluid full-bleed">
1242
+
<mainclass="fluid bleed-full">
1233
1243
<h1>Styled by nimble</h1>
1234
1244
1235
1245
<!-- nimble component styles do NOT apply inside this element -->
1236
-
<divclass="no-nimble full-bleed">
1246
+
<divclass="no-nimble bleed-full">
1237
1247
<ThirdPartyDataTable />
1238
1248
</div>
1239
1249
</main>
1240
1250
```
1241
1251
1242
-
Note that layout utilities (`.fluid`, `.full-bleed`, `.wide`, `.container`) are global, so they work on `.no-nimble` elements — you can still control layout while opting out of nimble's component styling.
1252
+
Note that layout utilities (`.fluid`, `.bleed-edge`, `.bleed-wide`, `.bleed-full`, `.container`) are global, so they work on `.no-nimble` elements — you can still control layout while opting out of nimble's component styling.
1243
1253
1244
1254
**Enabling `.no-nimble` — two paths:**
1245
1255
@@ -1459,15 +1469,15 @@ One partial per element group. Each can be implemented and visually tested indep
-[x] Fix input backgrounds — replaced `surface-3` with `color-mix(in oklch, surface-1, surface-2 20%)` via private `--_input-bg` variable
1465
1475
-[x]`demo/extended.html` — layout modes, button variants + groups (including same-type groups), form patterns (login/registration/search with pill-shaped search bar), surface hierarchy swatches, dark mode toggle, striped table, dialog demo
1466
1476
-[x] WCAG AA color audit — lowered `$primary-lightness` from 0.55 to 0.50; switched `primary-contrast` and `secondary-contrast` to `light-dark(#fff, oklch(0.15 0.005 250))` for dark-mode button readability. All pairings pass AA.
1467
1477
-[x] Light-mode `text-2` lightened from L=0.450 to L=0.580 for visible distinction from `text-1` (L=0.280)
1468
1478
-[x] Button group fixes — stripped margin on children, box-shadow dividers between same-type siblings, pill-shaped search groups via `[role="search"] [role="group"]`
-[x]`.wide` utility: added `width: 100%` so it stretches within `grid-column: 1 / -1`
1480
+
-[x]`.bleed-wide` utility (formerly `.wide`): added `width: 100%` so it stretches within `grid-column: 1 / -1`
1471
1481
-[x] Measure `dist/nimble.min.css` against size budget — 11,924 B min / **3,131 B gzipped** (budget: <8 KB min+gz)
1472
1482
-[x] Verify: all four feature flags (`$enable-dialog`, `$enable-switch`, `$enable-details`, `$enable-utilities`) correctly exclude output when disabled
1473
1483
- Output: `nimble.css` 15,467 B / `nimble.min.css` 11,924 B / gzipped ~3.1 KB
Copy file name to clipboardExpand all lines: specs/pico-migration.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,17 +80,19 @@ Pico's `.container` defaults to ~1200px (varies by breakpoint). nimble's centere
80
80
If your project uses third-party components (datatables, rich text editors, etc.) that nimble's element styles interfere with, add `class="no-nimble"` to their wrapper:
81
81
82
82
```html
83
-
<divclass="no-nimble full-bleed">
83
+
<divclass="no-nimble bleed-full">
84
84
<ThirdPartyDataTable />
85
85
</div>
86
86
```
87
87
88
-
nimble's component styles (typography, forms, tables, etc.) won't apply inside `.no-nimble` elements. Layout utilities (`.fluid`, `.full-bleed`, `.wide`, `.container`) still work. See the [nimble spec §15.2](nimble-css.md#152-third-party-component-isolation-no-nimble-opt-out) for details.
88
+
nimble's component styles (typography, forms, tables, etc.) won't apply inside `.no-nimble` elements. Layout utilities (`.fluid`, `.bleed-edge`, `.bleed-wide`, `.bleed-full`, `.container`) still work. See the [nimble spec §15.2](nimble-css.md#152-third-party-component-isolation-no-nimble-opt-out) for details.
89
89
90
90
### 1.6 Check for Pico-specific classes
91
91
92
92
Replace or remove any Pico-specific classes. See the [Feature Comparison Matrix](#2-feature-comparison-matrix) for mappings.
93
93
94
+
> **Note:** nimble.css v0.12+ renamed breakout classes: `.full-bleed` → `.bleed-full`, `.wide` → `.bleed-wide`, and added `.bleed-edge`. Migration log entries (§6.x) written before this rename still reference the old class names. Projects migrated before v0.12 should update: `.full-bleed` → `.bleed-full`, `.wide` → `.bleed-wide`.
95
+
94
96
### 1.7 Verify visually
95
97
96
98
Run the dev server and check each page. The main areas to inspect:
@@ -116,10 +118,11 @@ This is the **single largest source of layout dimension mismatches** — without
116
118
117
119
### 1.9 Full-bleed header backgrounds
118
120
119
-
Pico's `<header>` is a normal block element spanning the viewport. nimble's body grid constrains all children to the content column. If your header has a background color that should span full width:
121
+
Pico's `<header>` is a normal block element spanning the viewport. nimble's body grid constrains all children to the content column. If your header has a background color that should span full width, use a bleed utility class:
120
122
121
-
```css
122
-
header { grid-column: 1 / -1; }
123
+
```html
124
+
<headerclass="bleed-full">...</header> <!-- full viewport width -->
125
+
<headerclass="bleed-edge">...</header> <!-- aligns with shadow boundary -->
123
126
```
124
127
125
128
### 1.10 Override surface colors (if needed)
@@ -204,8 +207,9 @@ These work identically in both libraries (write semantic HTML, get styled output
204
207
| Centered content |`.container` class (max-width + breakpoints) | Body CSS Grid (automatic) | nimble centers by default; no class needed. |
205
208
| Content width |~1200px (varies by breakpoint) |`60ch` (`--nc-content-width`, aligns with OpenProps `--size-content-3`) | Overridable via CSS custom property. |
206
209
| Full-width layout | No built-in fluid mode |`.fluid` class on body ||
207
-
| Full-bleed breakout | Not supported |`.full-bleed` class ||
208
-
| Wide breakout | Not supported |`.wide` class ||
210
+
| Shadow-edge breakout | Not supported |`.bleed-edge` class | Aligns with shadow boundary; full-width when shadow hidden |
211
+
| Wide breakout | Not supported |`.bleed-wide` class | Up to 1200px, centered |
212
+
| Full-bleed breakout | Not supported |`.bleed-full` class | Full viewport width |
209
213
210
214
### 2.5 Theming / Customization
211
215
@@ -255,7 +259,7 @@ body > * { grid-column: 2; }
255
259
Content is always centered with real padding. No breakpoints needed. This means:
256
260
- You don't need `class="container"` on a wrapper element for basic centering.
257
261
- The `.container` class exists but serves a different purpose (re-centering inside `.fluid` layouts).
258
-
-Full-bleed content is possible with `grid-column: 1 / -1`.
**Migration note:** If your Pico project wraps everything in `<main class="container">`, you can keep it (nimble's `.container` applies `max-width` + `margin-inline: auto`), but you may not need it. The body grid already centers direct children at `--nc-content-width` (720px).
@@ -541,7 +541,7 @@ When nimble's element styles conflict with a component's own styling:
541
541
<TranscriptArea class="no-nimble" />
542
542
```
543
543
544
-
Layout utilities (`.fluid`, `.full-bleed`, `.wide`, `.container`) still work inside `.no-nimble`. Only nimble's component styles (typography, forms, tables) are excluded.
544
+
Layout utilities (`.fluid`, `.bleed-edge`, `.bleed-wide`, `.bleed-full`, `.container`) still work inside `.no-nimble`. Only nimble's component styles (typography, forms, tables) are excluded.
545
545
546
546
**Candidates for `.no-nimble` in these projects:**
0 commit comments