@dustin-riley/design 0.1.0 → 0.1.2
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 +2 -1
- package/README.md +24 -3
- package/package.json +2 -1
- package/skill/dustinriley-design/SKILL.md +5 -0
- package/src/reset.css +82 -0
- package/src/tokens.css +4 -63
package/DESIGN.md
CHANGED
|
@@ -24,8 +24,9 @@ This doc is the source of truth; the bundled `dustinriley-design` skill mirrors
|
|
|
24
24
|
|
|
25
25
|
| Concern | File |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Design tokens (color, type, spacing, radius, shadow, motion) | `@dustin-riley/design/tokens.css` |
|
|
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
|
+
| Base element resets (link underline, boxed code, heading sizes, body) — `:where()` zero-specificity, plain import in every app; any app rule wins automatically | `@dustin-riley/design/reset.css` |
|
|
29
30
|
| Tailwind v4 base + theme bridge + shadcn bridge | `@dustin-riley/design/tailwind.css` |
|
|
30
31
|
|
|
31
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,14 +17,35 @@ npm i @dustin-riley/design
|
|
|
17
17
|
@import "@dustin-riley/design/tokens.css";
|
|
18
18
|
@import "@dustin-riley/design/core.css";
|
|
19
19
|
|
|
20
|
-
/*
|
|
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
|
+
/* Tailwind v4 + shadcn projects also need: */
|
|
21
26
|
@import "@dustin-riley/design/tailwind.css"; /* pulls in core + tokens */
|
|
22
27
|
```
|
|
23
28
|
|
|
29
|
+
Every app imports the same set — no per-app reasoning.
|
|
30
|
+
|
|
24
31
|
## What's in / out
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
`tokens.css` — `--ds-*` custom properties + the focus ring. Pure tokens, no
|
|
34
|
+
element styling; safe to import anywhere/unlayered.
|
|
35
|
+
|
|
36
|
+
`core.css` — generic primitives (`.ds-btn*`, `.ds-container`, `.ds-panel`,
|
|
37
|
+
typographic helpers, `.kbd`, …). Imports `tokens.css`.
|
|
38
|
+
|
|
39
|
+
`reset.css` — base element styling (link underline, boxed inline code, heading
|
|
40
|
+
sizes, body defaults). These are *not* tokens. Every selector is wrapped in
|
|
41
|
+
`:where()`, giving it **zero specificity**, so *any* app rule — a bare `a {}`,
|
|
42
|
+
a component class, a prose/typography plugin — wins automatically. No `@layer`
|
|
43
|
+
(bundlers like Lightning CSS flatten a package-internal `@layer` pulled in via
|
|
44
|
+
`@import`); no consumer incantation. Plain `@import`, same in every app. It only
|
|
45
|
+
sets the baseline where nothing else applies. Requires tokens to be loaded.
|
|
46
|
+
|
|
47
|
+
`tailwind.css` — optional Tailwind v4 `@theme` + shadcn HSL bridge (pulls in
|
|
48
|
+
core + tokens). Does **not** include `reset.css`.
|
|
28
49
|
|
|
29
50
|
Out by design: site furniture (nav, footer, hero, content grids). Build those
|
|
30
51
|
per project from the tokens. See `DESIGN.md`.
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dustin-riley/design",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
10
11
|
"./core.css": "./src/core.css",
|
|
11
12
|
"./tailwind.css": "./src/tailwind.css",
|
|
12
13
|
"./DESIGN.md": "./DESIGN.md"
|
|
@@ -18,6 +18,11 @@ 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: `@import "@dustin-riley/design/reset.css";` — plain
|
|
22
|
+
import, same in every app. `tokens.css` is pure tokens (no element styling).
|
|
23
|
+
`reset.css` selectors are all `:where()` (zero specificity), so any app rule
|
|
24
|
+
(component class, bare element, prose plugin) wins automatically — no
|
|
25
|
+
`@layer`, no per-app judgment. Requires tokens to be loaded.
|
|
21
26
|
|
|
22
27
|
## Vocabulary (prefer extending these over inventing parallels)
|
|
23
28
|
Buttons `.ds-btn` + `.ds-btn-primary|secondary|ghost`; layout `.ds-container`,
|
package/src/reset.css
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
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); }
|
package/src/tokens.css
CHANGED
|
@@ -113,66 +113,7 @@
|
|
|
113
113
|
border-radius: var(--ds-radius-sm);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
/*
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
html { font-size: 16px; }
|
|
122
|
-
|
|
123
|
-
body {
|
|
124
|
-
background: var(--ds-bg);
|
|
125
|
-
color: var(--ds-text);
|
|
126
|
-
font-family: var(--ds-font-body);
|
|
127
|
-
font-size: var(--ds-fs-body);
|
|
128
|
-
line-height: var(--ds-lh-body);
|
|
129
|
-
-webkit-font-smoothing: antialiased;
|
|
130
|
-
text-rendering: optimizeLegibility;
|
|
131
|
-
overflow-x: clip;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
h1, h2, h3, h4, h5, h6 {
|
|
135
|
-
font-family: var(--ds-font-display);
|
|
136
|
-
color: var(--ds-text);
|
|
137
|
-
font-weight: 600;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
h1, .h1 {
|
|
141
|
-
font-size: var(--ds-fs-h1);
|
|
142
|
-
line-height: var(--ds-lh-h1);
|
|
143
|
-
letter-spacing: var(--ds-tracking-h1);
|
|
144
|
-
}
|
|
145
|
-
h2, .h2 {
|
|
146
|
-
font-size: var(--ds-fs-h2);
|
|
147
|
-
line-height: var(--ds-lh-h2);
|
|
148
|
-
letter-spacing: var(--ds-tracking-h2);
|
|
149
|
-
}
|
|
150
|
-
h3, .h3 {
|
|
151
|
-
font-size: var(--ds-fs-h3);
|
|
152
|
-
line-height: var(--ds-lh-h3);
|
|
153
|
-
letter-spacing: var(--ds-tracking-h3);
|
|
154
|
-
font-weight: 500;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
a {
|
|
158
|
-
color: var(--ds-link);
|
|
159
|
-
text-decoration: underline;
|
|
160
|
-
text-decoration-thickness: 1px;
|
|
161
|
-
text-underline-offset: 3px;
|
|
162
|
-
transition: color var(--ds-duration-fast) var(--ds-ease-standard);
|
|
163
|
-
}
|
|
164
|
-
a:hover { color: var(--ds-link-hover); }
|
|
165
|
-
|
|
166
|
-
code, pre, kbd, samp {
|
|
167
|
-
font-family: var(--ds-font-mono);
|
|
168
|
-
font-size: 0.9em;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
code {
|
|
172
|
-
background: var(--ds-surface-sunken);
|
|
173
|
-
padding: 2px 6px;
|
|
174
|
-
border-radius: var(--ds-radius-sm);
|
|
175
|
-
border: 1px solid var(--ds-border);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
::selection { background: rgba(184, 84, 28, 0.2); }
|
|
116
|
+
/* Opinionated base element resets (link underline, code boxing,
|
|
117
|
+
heading sizes, body defaults) are NOT tokens — they ship in the
|
|
118
|
+
opt-in @dustin-riley/design/reset.css, never here. Keeping them
|
|
119
|
+
out of this file keeps tokens.css cascade-safe for any consumer. */
|