@dustin-riley/design 0.1.0 → 0.1.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 +2 -1
- package/README.md +21 -2
- package/package.json +2 -1
- package/skill/dustinriley-design/SKILL.md +5 -0
- package/src/reset.css +79 -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
|
+
| Opt-in base element resets (link underline, boxed code, heading sizes, body) — import only if you have no base layer, and into a layer weaker than components | `@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
|
@@ -19,12 +19,31 @@ npm i @dustin-riley/design
|
|
|
19
19
|
|
|
20
20
|
/* Tailwind v4 + shadcn projects instead just 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"; }
|
|
22
27
|
```
|
|
23
28
|
|
|
24
29
|
## What's in / out
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
`tokens.css` — `--ds-*` custom properties + the focus ring. Pure tokens, no
|
|
32
|
+
element styling; safe to import anywhere/unlayered.
|
|
33
|
+
|
|
34
|
+
`core.css` — generic primitives (`.ds-btn*`, `.ds-container`, `.ds-panel`,
|
|
35
|
+
typographic helpers, `.kbd`, …). Imports `tokens.css`.
|
|
36
|
+
|
|
37
|
+
`reset.css` — **opt-in** opinionated base element resets (link underline, boxed
|
|
38
|
+
inline code, heading sizes, body defaults). These are *not* tokens — they are
|
|
39
|
+
project-level base opinions. Import only if you have no base layer of your own,
|
|
40
|
+
and import it **into a cascade layer weaker than your components**; importing it
|
|
41
|
+
unlayered makes it override your component rules. Projects that already style
|
|
42
|
+
their own raw `a`/`code`/headings (e.g. via a prose/typography plugin) must NOT
|
|
43
|
+
import it.
|
|
44
|
+
|
|
45
|
+
`tailwind.css` — optional Tailwind v4 `@theme` + shadcn HSL bridge (pulls in
|
|
46
|
+
core + tokens). Does **not** include `reset.css`.
|
|
28
47
|
|
|
29
48
|
Out by design: site furniture (nav, footer, hero, content grids). Build those
|
|
30
49
|
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.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",
|
|
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
|
+
- `tokens.css` is pure tokens — safe unlayered. Opinionated base element
|
|
22
|
+
resets are NOT in tokens.css; they live in opt-in `@dustin-riley/design/reset.css`.
|
|
23
|
+
Import `reset.css` only if the project has no base element styling of its
|
|
24
|
+
own, and inside a layer weaker than components: `@layer base { @import "@dustin-riley/design/reset.css"; }`.
|
|
25
|
+
Never import reset.css unlayered — it will override component rules.
|
|
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,79 @@
|
|
|
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); }
|
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. */
|