@dustin-riley/design 0.1.2 → 0.2.1
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 +1 -1
- package/README.md +10 -16
- package/package.json +1 -2
- package/skill/dustinriley-design/SKILL.md +6 -5
- package/src/core.css +71 -0
- package/src/reset.css +0 -82
package/DESIGN.md
CHANGED
|
@@ -26,7 +26,7 @@ This doc is the source of truth; the bundled `dustinriley-design` skill mirrors
|
|
|
26
26
|
|---|---|
|
|
27
27
|
| Design tokens (color, type, spacing, radius, shadow, motion) + focus ring — pure tokens, no element styling | `@dustin-riley/design/tokens.css` |
|
|
28
28
|
| Component / primitive styles (buttons, container, panel, typographic helpers, etc.) | `@dustin-riley/design/core.css` |
|
|
29
|
-
|
|
|
29
|
+
| Minimal base element styling (body/headings/mono code/`::selection`, `:where()` zero-specificity) — ships inside `core.css`, no separate import. No global link `text-decoration` (links are color-only; underline is a component decision) | `@dustin-riley/design/core.css` |
|
|
30
30
|
| Tailwind v4 base + theme bridge + shadcn bridge | `@dustin-riley/design/tailwind.css` |
|
|
31
31
|
|
|
32
32
|
**All design tokens are CSS custom properties prefixed `--ds-*`.** Always reference the token, never hard-code a hex / px value. If you need something the token set doesn't cover, that's a signal to push back on the design, not invent a one-off value.
|
package/README.md
CHANGED
|
@@ -17,32 +17,26 @@ npm i @dustin-riley/design
|
|
|
17
17
|
@import "@dustin-riley/design/tokens.css";
|
|
18
18
|
@import "@dustin-riley/design/core.css";
|
|
19
19
|
|
|
20
|
-
/* base element styling (links, code, headings, body) — plain import,
|
|
21
|
-
zero specificity (:where), so any app rule always wins. No @layer,
|
|
22
|
-
nothing to remember: */
|
|
23
|
-
@import "@dustin-riley/design/reset.css";
|
|
24
|
-
|
|
25
20
|
/* Tailwind v4 + shadcn projects also need: */
|
|
26
21
|
@import "@dustin-riley/design/tailwind.css"; /* pulls in core + tokens */
|
|
27
22
|
```
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
That's the whole contract. No separate reset, no `@layer`, nothing per-app.
|
|
30
25
|
|
|
31
26
|
## What's in / out
|
|
32
27
|
|
|
33
28
|
`tokens.css` — `--ds-*` custom properties + the focus ring. Pure tokens, no
|
|
34
|
-
element styling
|
|
29
|
+
element styling.
|
|
35
30
|
|
|
36
31
|
`core.css` — generic primitives (`.ds-btn*`, `.ds-container`, `.ds-panel`,
|
|
37
|
-
typographic helpers, `.kbd`, …)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
sets the baseline where nothing else applies. Requires tokens to be loaded.
|
|
32
|
+
typographic helpers, `.kbd`, …) **plus minimal base element styling** (body
|
|
33
|
+
defaults, heading font/size, mono code, `::selection`). Imports `tokens.css`.
|
|
34
|
+
Base rules are wrapped in `:where()` (zero specificity) so any app/component/
|
|
35
|
+
Preflight rule wins.
|
|
36
|
+
|
|
37
|
+
**Links are not underlined by default.** Per `DESIGN.md`, links are color-only;
|
|
38
|
+
the system never sets a global link `text-decoration`. Underline is an
|
|
39
|
+
intentional, component-scoped decision (e.g. article body) made by the app.
|
|
46
40
|
|
|
47
41
|
`tailwind.css` — optional Tailwind v4 `@theme` + shadcn HSL bridge (pulls in
|
|
48
42
|
core + tokens). Does **not** include `reset.css`.
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dustin-riley/design",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Dustin Riley design system — warm mid-century modern tokens and primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": ["src", "DESIGN.md", "skill", "README.md"],
|
|
8
8
|
"exports": {
|
|
9
9
|
"./tokens.css": "./src/tokens.css",
|
|
10
|
-
"./reset.css": "./src/reset.css",
|
|
11
10
|
"./core.css": "./src/core.css",
|
|
12
11
|
"./tailwind.css": "./src/tailwind.css",
|
|
13
12
|
"./DESIGN.md": "./DESIGN.md"
|
|
@@ -18,11 +18,12 @@ Apply this whenever you add or change UI in a project importing `@dustin-riley/d
|
|
|
18
18
|
## How to consume
|
|
19
19
|
- Always: `@import "@dustin-riley/design/tokens.css"; @import "@dustin-riley/design/core.css";`
|
|
20
20
|
- Tailwind v4 + shadcn projects additionally: `@import "@dustin-riley/design/tailwind.css";`
|
|
21
|
-
- Base element styling
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
- Base element styling ships inside `core.css` (no separate import, no
|
|
22
|
+
`@layer`): minimal body/heading/code/`::selection` defaults wrapped in
|
|
23
|
+
`:where()` (zero specificity), so any app/component/Preflight rule wins.
|
|
24
|
+
- **Never set a global link `text-decoration`.** Links are color-only by
|
|
25
|
+
design (DESIGN.md); underline is a component-scoped app decision (e.g.
|
|
26
|
+
article body), never a system-wide default.
|
|
26
27
|
|
|
27
28
|
## Vocabulary (prefer extending these over inventing parallels)
|
|
28
29
|
Buttons `.ds-btn` + `.ds-btn-primary|secondary|ghost`; layout `.ds-container`,
|
package/src/core.css
CHANGED
|
@@ -229,3 +229,74 @@ h6,
|
|
|
229
229
|
border-radius: var(--ds-radius-sm);
|
|
230
230
|
color: var(--ds-text);
|
|
231
231
|
}
|
|
232
|
+
|
|
233
|
+
/* ============================================================
|
|
234
|
+
Base element styling
|
|
235
|
+
|
|
236
|
+
Minimal, opinionated defaults for raw elements. Wrapped in
|
|
237
|
+
:where() (zero specificity) so any app/component/Preflight
|
|
238
|
+
rule wins. Ships in core.css (no separate import, no @layer):
|
|
239
|
+
apps consume core.css already.
|
|
240
|
+
|
|
241
|
+
NOTE: no global link `text-decoration`. Per DESIGN.md links
|
|
242
|
+
are color-only; underline is an intentional, component-scoped
|
|
243
|
+
decision (e.g. article body), never a system-wide default.
|
|
244
|
+
Letting Tailwind Preflight's `a{text-decoration:inherit}`
|
|
245
|
+
stand keeps links un-underlined unless a component opts in.
|
|
246
|
+
============================================================ */
|
|
247
|
+
|
|
248
|
+
:where(html) { font-size: 16px; }
|
|
249
|
+
|
|
250
|
+
:where(body) {
|
|
251
|
+
background: var(--ds-bg);
|
|
252
|
+
color: var(--ds-text);
|
|
253
|
+
font-family: var(--ds-font-body);
|
|
254
|
+
font-size: var(--ds-fs-body);
|
|
255
|
+
line-height: var(--ds-lh-body);
|
|
256
|
+
-webkit-font-smoothing: antialiased;
|
|
257
|
+
text-rendering: optimizeLegibility;
|
|
258
|
+
overflow-x: clip;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:where(h1, h2, h3, h4, h5, h6) {
|
|
262
|
+
font-family: var(--ds-font-display);
|
|
263
|
+
color: var(--ds-text);
|
|
264
|
+
font-weight: 600;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
:where(h1, .h1) {
|
|
268
|
+
font-size: var(--ds-fs-h1);
|
|
269
|
+
line-height: var(--ds-lh-h1);
|
|
270
|
+
letter-spacing: var(--ds-tracking-h1);
|
|
271
|
+
}
|
|
272
|
+
:where(h2, .h2) {
|
|
273
|
+
font-size: var(--ds-fs-h2);
|
|
274
|
+
line-height: var(--ds-lh-h2);
|
|
275
|
+
letter-spacing: var(--ds-tracking-h2);
|
|
276
|
+
}
|
|
277
|
+
:where(h3, .h3) {
|
|
278
|
+
font-size: var(--ds-fs-h3);
|
|
279
|
+
line-height: var(--ds-lh-h3);
|
|
280
|
+
letter-spacing: var(--ds-tracking-h3);
|
|
281
|
+
font-weight: 500;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* No global `a` rule. <a> is both chrome (nav/brand/footer) and content,
|
|
285
|
+
so any system-wide color/decoration is wrong somewhere. Links inherit
|
|
286
|
+
text color via Tailwind Preflight; link color/underline is an
|
|
287
|
+
intentional component or prose decision (article-body links, prose
|
|
288
|
+
links, active nav, etc. opt into var(--ds-link)). */
|
|
289
|
+
|
|
290
|
+
:where(code, pre, kbd, samp) {
|
|
291
|
+
font-family: var(--ds-font-mono);
|
|
292
|
+
font-size: 0.9em;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
:where(code) {
|
|
296
|
+
background: var(--ds-surface-sunken);
|
|
297
|
+
padding: 2px 6px;
|
|
298
|
+
border-radius: var(--ds-radius-sm);
|
|
299
|
+
border: 1px solid var(--ds-border);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
::selection { background: rgba(184, 84, 28, 0.2); }
|
package/src/reset.css
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/* ============================================================
|
|
2
|
-
@dustin-riley/design — base element resets
|
|
3
|
-
|
|
4
|
-
Opinionated base styling for raw elements (link underline,
|
|
5
|
-
boxed inline code, heading sizes, body defaults).
|
|
6
|
-
|
|
7
|
-
Every selector is wrapped in :where(), giving it ZERO
|
|
8
|
-
specificity. So ANY app rule — a bare `a {}`, a component
|
|
9
|
-
class, a prose/typography plugin — automatically wins, with
|
|
10
|
-
no cascade-layer plumbing required. (We do NOT use @layer:
|
|
11
|
-
bundlers like Lightning CSS flatten a package-internal
|
|
12
|
-
@layer pulled in via @import, which would make these rules
|
|
13
|
-
unexpectedly override your components.)
|
|
14
|
-
|
|
15
|
-
Uniform contract — every app, plain import, nothing to remember:
|
|
16
|
-
|
|
17
|
-
@import "@dustin-riley/design/reset.css";
|
|
18
|
-
|
|
19
|
-
Requires the design tokens to be loaded (tokens.css / core.css /
|
|
20
|
-
tailwind.css) for the `var(--ds-*)` references to resolve.
|
|
21
|
-
============================================================ */
|
|
22
|
-
|
|
23
|
-
:where(html) { font-size: 16px; }
|
|
24
|
-
|
|
25
|
-
:where(body) {
|
|
26
|
-
background: var(--ds-bg);
|
|
27
|
-
color: var(--ds-text);
|
|
28
|
-
font-family: var(--ds-font-body);
|
|
29
|
-
font-size: var(--ds-fs-body);
|
|
30
|
-
line-height: var(--ds-lh-body);
|
|
31
|
-
-webkit-font-smoothing: antialiased;
|
|
32
|
-
text-rendering: optimizeLegibility;
|
|
33
|
-
overflow-x: clip;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:where(h1, h2, h3, h4, h5, h6) {
|
|
37
|
-
font-family: var(--ds-font-display);
|
|
38
|
-
color: var(--ds-text);
|
|
39
|
-
font-weight: 600;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:where(h1, .h1) {
|
|
43
|
-
font-size: var(--ds-fs-h1);
|
|
44
|
-
line-height: var(--ds-lh-h1);
|
|
45
|
-
letter-spacing: var(--ds-tracking-h1);
|
|
46
|
-
}
|
|
47
|
-
:where(h2, .h2) {
|
|
48
|
-
font-size: var(--ds-fs-h2);
|
|
49
|
-
line-height: var(--ds-lh-h2);
|
|
50
|
-
letter-spacing: var(--ds-tracking-h2);
|
|
51
|
-
}
|
|
52
|
-
:where(h3, .h3) {
|
|
53
|
-
font-size: var(--ds-fs-h3);
|
|
54
|
-
line-height: var(--ds-lh-h3);
|
|
55
|
-
letter-spacing: var(--ds-tracking-h3);
|
|
56
|
-
font-weight: 500;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:where(a) {
|
|
60
|
-
color: var(--ds-link);
|
|
61
|
-
text-decoration: underline;
|
|
62
|
-
text-decoration-thickness: 1px;
|
|
63
|
-
text-underline-offset: 3px;
|
|
64
|
-
transition: color var(--ds-duration-fast) var(--ds-ease-standard);
|
|
65
|
-
}
|
|
66
|
-
:where(a:hover) { color: var(--ds-link-hover); }
|
|
67
|
-
|
|
68
|
-
:where(code, pre, kbd, samp) {
|
|
69
|
-
font-family: var(--ds-font-mono);
|
|
70
|
-
font-size: 0.9em;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:where(code) {
|
|
74
|
-
background: var(--ds-surface-sunken);
|
|
75
|
-
padding: 2px 6px;
|
|
76
|
-
border-radius: var(--ds-radius-sm);
|
|
77
|
-
border: 1px solid var(--ds-border);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/* ::selection is a pseudo-element and cannot be wrapped in :where();
|
|
81
|
-
it has specificity (0,0,1) — an app ::selection rule still wins. */
|
|
82
|
-
::selection { background: rgba(184, 84, 28, 0.2); }
|