@brignano/design 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESIGN.md +27 -0
- package/README.md +1 -0
- package/controls.css +2251 -0
- package/package.json +5 -2
package/DESIGN.md
CHANGED
|
@@ -513,6 +513,30 @@ Import order matters — Tailwind first, then tokens, then the bridge:
|
|
|
513
513
|
@import "@brignano/design/tailwind.css";
|
|
514
514
|
```
|
|
515
515
|
|
|
516
|
+
To use the components in a Tailwind site, import **`controls.css`**, not
|
|
517
|
+
`components.css`, and put the design layer below Tailwind's utilities:
|
|
518
|
+
|
|
519
|
+
```css
|
|
520
|
+
@layer theme, base, brignano.components, components, utilities;
|
|
521
|
+
@import "tailwindcss";
|
|
522
|
+
@import "@brignano/design/tokens.css";
|
|
523
|
+
@import "@brignano/design/tailwind.css";
|
|
524
|
+
@import "@brignano/design/controls.css";
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
- `controls.css` is `components.css` without the layout primitives
|
|
528
|
+
(`.container`, `.stack`, `.cluster`, `.grid`, `.section`, `.divider`,
|
|
529
|
+
`.gap-2` … `.gap-6`). Those names are Tailwind utilities too: with
|
|
530
|
+
`components.css`, every `grid` gets auto-fit columns and every `gap-4` moves
|
|
531
|
+
to the `--s` scale. Tailwind keeps the layout; design brings the controls.
|
|
532
|
+
It is generated by `npm run controls` and checked, never edited by hand.
|
|
533
|
+
- The `@layer` line comes first so `brignano.components` sits under
|
|
534
|
+
`utilities`. Without it the layer is declared after Tailwind's and beats
|
|
535
|
+
every utility, so `mt-4` on a `.btn` would lose.
|
|
536
|
+
- `.prose` is a component here and a class of `@tailwindcss/typography`.
|
|
537
|
+
A site that keeps the plugin renames its class (`@plugin
|
|
538
|
+
"@tailwindcss/typography" { className: "tw-prose"; }`) or moves to `.prose`.
|
|
539
|
+
|
|
516
540
|
## 12. The one rule that keeps this true
|
|
517
541
|
|
|
518
542
|
**Never hardcode a hex outside `tokens.css`.**
|
|
@@ -816,6 +840,9 @@ and in what order: [`proposals/component-layer.md`](./proposals/component-layer.
|
|
|
816
840
|
@import '@brignano/design/components.css';
|
|
817
841
|
```
|
|
818
842
|
|
|
843
|
+
A Tailwind site imports `controls.css` instead: the same components without
|
|
844
|
+
the layout primitives whose names Tailwind already uses (§11).
|
|
845
|
+
|
|
819
846
|
- **One layer.** Everything is inside `@layer brignano.components`. A consumer's
|
|
820
847
|
unlayered CSS and Tailwind utilities beat it without `!important`, so a site
|
|
821
848
|
can adjust a component without fighting it.
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ The shared design system for every brignano surface — `brignano.io`, `life`,
|
|
|
10
10
|
| [`tokens.css`](./tokens.css) | Single source of truth for colour, type, space, shape, motion. |
|
|
11
11
|
| [`tokens.chart.css`](./tokens.chart.css) | Validated categorical palette for data viz. |
|
|
12
12
|
| [`components.css`](./components.css) | Shared controls and patterns as plain CSS in `@layer brignano.components`: one import, any framework. DESIGN.md §14; catalog in `proposals/component-layer.md`; preview in `previews/components.html`. |
|
|
13
|
+
| [`controls.css`](./controls.css) | `components.css` without the layout primitives (`.container`, `.stack`, `.cluster`, `.grid`, `.section`, `.divider`, `.gap-*`), for a Tailwind site where those names are already utilities. Generated by `npm run controls`; DESIGN.md §11. |
|
|
13
14
|
| [`product-page.css`](./product-page.css) | The structure of a product's marketing page, built from a five-line brief: thesis and proof on the first phone screen, one signature band, how it works, closing ask. The shared parts every page needs, and a starting point for the look each product writes over it: its mark fills the primary button, and five choices keep any two products from looking alike (ADR-0017). DESIGN.md §13; skeleton in `previews/product-page.html`, one worked example per product in `previews/product-page-example.html` (Driftwood), `product-page-guidebook.html` and `product-page-sites.html`, first-screen check in `scripts/fold.mjs`. |
|
|
14
15
|
| [`templates/`](./templates) | Page templates built on `components.css`: `article.css` (posts and docs), `changelog.css`, `legal.css`, `error.css` (404, 500, offline), `settings.css`, and a transactional email (`email.html` + `email.txt`, filled from the tokens by `scripts/email-tokens.mjs`). Import as `@brignano/design/templates/<name>.css`. |
|
|
15
16
|
| [`icons/`](./icons) | One curated outline icon set (Lucide, ISC; `icons/LICENSE`) on a 24px grid in `currentColor`. Size with `.icon-sm`, `.icon`, `.icon-lg` from `components.css`; browse and copy in `previews/icons.html`. Paste the markup inline (`@brignano/design/icons/<name>.svg`); through `<img>` an icon can't take the text colour. |
|