@dustin-riley/design 0.1.1 → 0.2.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 +1 -1
- package/README.md +12 -16
- package/package.json +1 -2
- package/skill/dustinriley-design/SKILL.md +6 -5
- package/src/core.css +70 -0
- package/src/reset.css +0 -79
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,30 +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
|
-
/* Tailwind v4 + shadcn projects
|
|
20
|
+
/* Tailwind v4 + shadcn projects also need: */
|
|
21
21
|
@import "@dustin-riley/design/tailwind.css"; /* pulls in core + tokens */
|
|
22
|
-
|
|
23
|
-
/* ONLY if your project has no base element styling of its own —
|
|
24
|
-
import it into a layer weaker than your components so specific
|
|
25
|
-
rules still win: */
|
|
26
|
-
@layer base { @import "@dustin-riley/design/reset.css"; }
|
|
27
22
|
```
|
|
28
23
|
|
|
24
|
+
That's the whole contract. No separate reset, no `@layer`, nothing per-app.
|
|
25
|
+
|
|
29
26
|
## What's in / out
|
|
30
27
|
|
|
31
28
|
`tokens.css` — `--ds-*` custom properties + the focus ring. Pure tokens, no
|
|
32
|
-
element styling
|
|
29
|
+
element styling.
|
|
33
30
|
|
|
34
31
|
`core.css` — generic primitives (`.ds-btn*`, `.ds-container`, `.ds-panel`,
|
|
35
|
-
typographic helpers, `.kbd`, …)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
import it.
|
|
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.
|
|
44
40
|
|
|
45
41
|
`tailwind.css` — optional Tailwind v4 `@theme` + shadcn HSL bridge (pulls in
|
|
46
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.
|
|
3
|
+
"version": "0.2.0",
|
|
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
|
-
-
|
|
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,73 @@ 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
|
+
:where(a) {
|
|
285
|
+
color: var(--ds-link);
|
|
286
|
+
transition: color var(--ds-duration-fast) var(--ds-ease-standard);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
:where(code, pre, kbd, samp) {
|
|
290
|
+
font-family: var(--ds-font-mono);
|
|
291
|
+
font-size: 0.9em;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
:where(code) {
|
|
295
|
+
background: var(--ds-surface-sunken);
|
|
296
|
+
padding: 2px 6px;
|
|
297
|
+
border-radius: var(--ds-radius-sm);
|
|
298
|
+
border: 1px solid var(--ds-border);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
::selection { background: rgba(184, 84, 28, 0.2); }
|
package/src/reset.css
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
@import "./tokens.css";
|
|
2
|
-
|
|
3
|
-
/* ============================================================
|
|
4
|
-
@dustin-riley/design — base element resets (OPT-IN)
|
|
5
|
-
|
|
6
|
-
Opinionated base styling for raw elements (link underline,
|
|
7
|
-
boxed inline code, heading sizes, body defaults). These are
|
|
8
|
-
NOT tokens — they are project-level base opinions, so they
|
|
9
|
-
ship separately and are opt-in.
|
|
10
|
-
|
|
11
|
-
- Import this ONLY if your project has no base element layer
|
|
12
|
-
of its own.
|
|
13
|
-
- Import it into a cascade layer WEAKER than your component
|
|
14
|
-
styles so specific rules (e.g. `.site-nav a {…}`) win, e.g.:
|
|
15
|
-
@layer base { @import "@dustin-riley/design/reset.css"; }
|
|
16
|
-
Importing it unlayered makes it beat every layered rule and
|
|
17
|
-
will override your component overrides — don't.
|
|
18
|
-
- Projects that already style their own base elements (raw
|
|
19
|
-
`a` / `code` / headings) must NOT import this.
|
|
20
|
-
============================================================ */
|
|
21
|
-
|
|
22
|
-
html { font-size: 16px; }
|
|
23
|
-
|
|
24
|
-
body {
|
|
25
|
-
background: var(--ds-bg);
|
|
26
|
-
color: var(--ds-text);
|
|
27
|
-
font-family: var(--ds-font-body);
|
|
28
|
-
font-size: var(--ds-fs-body);
|
|
29
|
-
line-height: var(--ds-lh-body);
|
|
30
|
-
-webkit-font-smoothing: antialiased;
|
|
31
|
-
text-rendering: optimizeLegibility;
|
|
32
|
-
overflow-x: clip;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
h1, h2, h3, h4, h5, h6 {
|
|
36
|
-
font-family: var(--ds-font-display);
|
|
37
|
-
color: var(--ds-text);
|
|
38
|
-
font-weight: 600;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
h1, .h1 {
|
|
42
|
-
font-size: var(--ds-fs-h1);
|
|
43
|
-
line-height: var(--ds-lh-h1);
|
|
44
|
-
letter-spacing: var(--ds-tracking-h1);
|
|
45
|
-
}
|
|
46
|
-
h2, .h2 {
|
|
47
|
-
font-size: var(--ds-fs-h2);
|
|
48
|
-
line-height: var(--ds-lh-h2);
|
|
49
|
-
letter-spacing: var(--ds-tracking-h2);
|
|
50
|
-
}
|
|
51
|
-
h3, .h3 {
|
|
52
|
-
font-size: var(--ds-fs-h3);
|
|
53
|
-
line-height: var(--ds-lh-h3);
|
|
54
|
-
letter-spacing: var(--ds-tracking-h3);
|
|
55
|
-
font-weight: 500;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
a {
|
|
59
|
-
color: var(--ds-link);
|
|
60
|
-
text-decoration: underline;
|
|
61
|
-
text-decoration-thickness: 1px;
|
|
62
|
-
text-underline-offset: 3px;
|
|
63
|
-
transition: color var(--ds-duration-fast) var(--ds-ease-standard);
|
|
64
|
-
}
|
|
65
|
-
a:hover { color: var(--ds-link-hover); }
|
|
66
|
-
|
|
67
|
-
code, pre, kbd, samp {
|
|
68
|
-
font-family: var(--ds-font-mono);
|
|
69
|
-
font-size: 0.9em;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
code {
|
|
73
|
-
background: var(--ds-surface-sunken);
|
|
74
|
-
padding: 2px 6px;
|
|
75
|
-
border-radius: var(--ds-radius-sm);
|
|
76
|
-
border: 1px solid var(--ds-border);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
::selection { background: rgba(184, 84, 28, 0.2); }
|