clampography 2.0.0-beta.25 → 2.0.0-beta.27

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/css/forms.css CHANGED
@@ -165,8 +165,80 @@
165
165
  font-weight: 600;
166
166
  }
167
167
 
168
- :root :where(meter, progress) {
169
- accent-color: var(--clampography-primary);
168
+ :root progress {
169
+ -webkit-appearance: none;
170
+ appearance: none;
170
171
  width: 100%;
172
+ height: 1em;
173
+ background: transparent;
174
+ }
175
+
176
+ :root progress::-webkit-progress-bar {
177
+ background: color-mix(in oklab, var(--clampography-text) 20%, transparent);
178
+ }
179
+
180
+ :root progress::-webkit-progress-value {
181
+ background: var(--clampography-success);
182
+ }
183
+
184
+ :root progress::-moz-progress-bar {
185
+ background: var(--clampography-success);
186
+ }
187
+
188
+ :root meter {
189
+ -webkit-appearance: none;
190
+ appearance: none;
191
+ width: 100%;
192
+ height: 1em;
193
+ background: transparent;
194
+ }
195
+
196
+ @supports (-moz-appearance: none) {
197
+
198
+ :root progress {
199
+ background: color-mix(in oklab, var(--clampography-text) 20%, transparent);
200
+ }
201
+
202
+ :root meter {
203
+ background: color-mix(in oklab, var(--clampography-text) 20%, transparent);
204
+ }
205
+ }
206
+
207
+ :root meter::-webkit-meter-inner-element {
208
+ display: flex;
209
+ align-items: stretch;
210
+ height: 1em;
211
+ }
212
+
213
+ :root meter::-webkit-meter-bar {
214
+ background: color-mix(in oklab, var(--clampography-text) 20%, transparent);
215
+ height: 100%;
216
+ }
217
+
218
+ :root meter::-webkit-meter-optimum-value {
219
+ background: var(--clampography-success);
220
+ height: 100%;
221
+ }
222
+
223
+ :root meter:-moz-meter-optimum::-moz-meter-bar {
224
+ background: var(--clampography-success);
225
+ }
226
+
227
+ :root meter::-webkit-meter-suboptimum-value {
228
+ background: var(--clampography-warning);
229
+ height: 100%;
230
+ }
231
+
232
+ :root meter:-moz-meter-sub-optimum::-moz-meter-bar {
233
+ background: var(--clampography-warning);
234
+ }
235
+
236
+ :root meter::-webkit-meter-even-less-good-value {
237
+ background: var(--clampography-error);
238
+ height: 100%;
239
+ }
240
+
241
+ :root meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
242
+ background: var(--clampography-error);
171
243
  }
172
244
  }
package/css/forms.min.css CHANGED
@@ -1 +1 @@
1
- @layer base{:root :where(button, [type='button'], [type='reset'], [type='submit']){display:inline-flex;align-items:center;justify-content:center;gap:0.375em;padding:var(--spacing-xs) var(--spacing-sm);background-color:var(--clampography-surface);color:var(--clampography-text);border:1px solid var(--clampography-border);border-radius:0.375rem;font-weight:500;white-space:nowrap;transition-property:background-color, border-color, color, box-shadow;transition-duration:150ms}:root :where(button, [type='button'], [type='reset'], [type='submit']):hover{background-color:var(--clampography-background);border-color:var(--clampography-primary)}:root :where(button, [type='button'], [type='submit']).primary, :root [type='submit']{background-color:var(--clampography-primary);color:var(--clampography-background);border-color:var(--clampography-primary)}:root :where(button, [type='button'], [type='submit']).primary:hover, :root [type='submit']:hover{filter:brightness(1.1)}:root :where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color']), textarea, select){display:block;width:100%;padding:var(--spacing-xs) var(--spacing-sm);background-color:var(--clampography-background);color:var(--clampography-text);border:1px solid var(--clampography-border);border-radius:0.375rem;transition-property:border-color, box-shadow;transition-duration:150ms}:root :where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color']), textarea, select):focus{outline:none;border-color:var(--clampography-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--clampography-primary) 20%, transparent)}:root :where(input, textarea, select):disabled{opacity:0.5;cursor:not-allowed}:root :where(input, textarea, select)[readonly]{background-color:color-mix(in oklab, var(--clampography-surface) 50%, transparent);cursor:default}:root :where(input, textarea, select):user-invalid{border-color:var(--clampography-error)}:root :where(input, textarea, select):user-invalid:focus{box-shadow:0 0 0 3px color-mix(in oklab, var(--clampography-error) 20%, transparent)}:root [type='search']::-webkit-search-cancel-button, :root [type='search']::-webkit-search-decoration{-webkit-appearance:none;appearance:none}:root [type='number']::-webkit-inner-spin-button, :root [type='number']::-webkit-outer-spin-button{height:auto}:root :where(input, textarea, select)::placeholder{color:var(--clampography-muted)}:root select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");background-position:right 0.5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}:root [type='file']{padding:0;background-color:transparent;border:none;cursor:pointer}:root [type='file']::file-selector-button{display:inline-flex;align-items:center;padding:var(--spacing-xs) var(--spacing-sm);margin-right:var(--spacing-sm);background-color:var(--clampography-surface);color:var(--clampography-text);border:1px solid var(--clampography-border);border-radius:0.375rem;font-family:inherit;font-size:inherit;cursor:pointer;transition-property:background-color, border-color;transition-duration:150ms}:root [type='file']:hover::file-selector-button{background-color:var(--clampography-background);border-color:var(--clampography-primary)}:root [type='checkbox'], :root [type='radio']{width:1em;height:1em;accent-color:var(--clampography-primary);vertical-align:middle;cursor:pointer}:root [type='checkbox']:focus-visible, :root [type='radio']:focus-visible{outline:2px solid var(--clampography-primary);outline-offset:2px}:root [type='range']{accent-color:var(--clampography-primary);width:100%;cursor:pointer}:root [type='color']{padding:0.125rem;width:2.5rem;height:2.5rem;border:1px solid var(--clampography-border);border-radius:0.375rem;background-color:var(--clampography-background);cursor:pointer}:root fieldset{border:1px solid var(--clampography-border);border-radius:0.5rem;background-color:var(--clampography-surface)}:root legend{color:var(--clampography-heading)}:root label{color:var(--clampography-text)}:root output{color:var(--clampography-primary);font-weight:600}:root :where(meter, progress){accent-color:var(--clampography-primary);width:100%}}
1
+ @layer base{:root :where(button, [type='button'], [type='reset'], [type='submit']){display:inline-flex;align-items:center;justify-content:center;gap:0.375em;padding:var(--spacing-xs) var(--spacing-sm);background-color:var(--clampography-surface);color:var(--clampography-text);border:1px solid var(--clampography-border);border-radius:0.375rem;font-weight:500;white-space:nowrap;transition-property:background-color, border-color, color, box-shadow;transition-duration:150ms}:root :where(button, [type='button'], [type='reset'], [type='submit']):hover{background-color:var(--clampography-background);border-color:var(--clampography-primary)}:root :where(button, [type='button'], [type='submit']).primary, :root [type='submit']{background-color:var(--clampography-primary);color:var(--clampography-background);border-color:var(--clampography-primary)}:root :where(button, [type='button'], [type='submit']).primary:hover, :root [type='submit']:hover{filter:brightness(1.1)}:root :where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color']), textarea, select){display:block;width:100%;padding:var(--spacing-xs) var(--spacing-sm);background-color:var(--clampography-background);color:var(--clampography-text);border:1px solid var(--clampography-border);border-radius:0.375rem;transition-property:border-color, box-shadow;transition-duration:150ms}:root :where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color']), textarea, select):focus{outline:none;border-color:var(--clampography-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--clampography-primary) 20%, transparent)}:root :where(input, textarea, select):disabled{opacity:0.5;cursor:not-allowed}:root :where(input, textarea, select)[readonly]{background-color:color-mix(in oklab, var(--clampography-surface) 50%, transparent);cursor:default}:root :where(input, textarea, select):user-invalid{border-color:var(--clampography-error)}:root :where(input, textarea, select):user-invalid:focus{box-shadow:0 0 0 3px color-mix(in oklab, var(--clampography-error) 20%, transparent)}:root [type='search']::-webkit-search-cancel-button, :root [type='search']::-webkit-search-decoration{-webkit-appearance:none;appearance:none}:root [type='number']::-webkit-inner-spin-button, :root [type='number']::-webkit-outer-spin-button{height:auto}:root :where(input, textarea, select)::placeholder{color:var(--clampography-muted)}:root select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");background-position:right 0.5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}:root [type='file']{padding:0;background-color:transparent;border:none;cursor:pointer}:root [type='file']::file-selector-button{display:inline-flex;align-items:center;padding:var(--spacing-xs) var(--spacing-sm);margin-right:var(--spacing-sm);background-color:var(--clampography-surface);color:var(--clampography-text);border:1px solid var(--clampography-border);border-radius:0.375rem;font-family:inherit;font-size:inherit;cursor:pointer;transition-property:background-color, border-color;transition-duration:150ms}:root [type='file']:hover::file-selector-button{background-color:var(--clampography-background);border-color:var(--clampography-primary)}:root [type='checkbox'], :root [type='radio']{width:1em;height:1em;accent-color:var(--clampography-primary);vertical-align:middle;cursor:pointer}:root [type='checkbox']:focus-visible, :root [type='radio']:focus-visible{outline:2px solid var(--clampography-primary);outline-offset:2px}:root [type='range']{accent-color:var(--clampography-primary);width:100%;cursor:pointer}:root [type='color']{padding:0.125rem;width:2.5rem;height:2.5rem;border:1px solid var(--clampography-border);border-radius:0.375rem;background-color:var(--clampography-background);cursor:pointer}:root fieldset{border:1px solid var(--clampography-border);border-radius:0.5rem;background-color:var(--clampography-surface)}:root legend{color:var(--clampography-heading)}:root label{color:var(--clampography-text)}:root output{color:var(--clampography-primary);font-weight:600}:root progress{-webkit-appearance:none;appearance:none;width:100%;height:1em;background:transparent}:root progress::-webkit-progress-bar{background:color-mix(in oklab, var(--clampography-text) 20%, transparent)}:root progress::-webkit-progress-value{background:var(--clampography-success)}:root progress::-moz-progress-bar{background:var(--clampography-success)}:root meter{-webkit-appearance:none;appearance:none;width:100%;height:1em;background:transparent}@supports (-moz-appearance: none){:root progress{background:color-mix(in oklab, var(--clampography-text) 20%, transparent)}:root meter{background:color-mix(in oklab, var(--clampography-text) 20%, transparent)}}:root meter::-webkit-meter-inner-element{display:flex;align-items:stretch;height:1em}:root meter::-webkit-meter-bar{background:color-mix(in oklab, var(--clampography-text) 20%, transparent);height:100%}:root meter::-webkit-meter-optimum-value{background:var(--clampography-success);height:100%}:root meter:-moz-meter-optimum::-moz-meter-bar{background:var(--clampography-success)}:root meter::-webkit-meter-suboptimum-value{background:var(--clampography-warning);height:100%}:root meter:-moz-meter-sub-optimum::-moz-meter-bar{background:var(--clampography-warning)}:root meter::-webkit-meter-even-less-good-value{background:var(--clampography-error);height:100%}:root meter:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:var(--clampography-error)}}
package/css/kbd.css CHANGED
@@ -3,7 +3,7 @@
3
3
  :root kbd {
4
4
  display: inline-block;
5
5
  padding: 0.1em 0.45em;
6
- min-width: 1.6em;
6
+ min-width: 2em;
7
7
  text-align: center;
8
8
  font-size: 0.8em;
9
9
  font-weight: 700;
package/css/kbd.min.css CHANGED
@@ -1 +1 @@
1
- @layer base{:root kbd{display:inline-block;padding:0.1em 0.45em;min-width:1.6em;text-align:center;font-size:0.8em;font-weight:700;line-height:1.5;white-space:nowrap;vertical-align:0.1em;cursor:default;user-select:none;background-color:var(--clampography-surface, oklch(94% 0.004 264));color:var(--clampography-text, oklch(18% 0.015 264));border:1px solid var(--clampography-border, oklch(76% 0.008 264));border-radius:4px;box-shadow:0 2px 0 color-mix(in oklab, var(--clampography-border, oklch(60% 0.008 264)) 100%, black 18%), 0 3px 2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);transition-property:box-shadow, transform, border-bottom-width;transition-duration:80ms}:root kbd:active{transform:translateY(2px);box-shadow:0 0 0 color-mix(in oklab, var(--clampography-border, oklch(60% 0.008 264)) 100%, black 18%), 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3)}}
1
+ @layer base{:root kbd{display:inline-block;padding:0.1em 0.45em;min-width:2em;text-align:center;font-size:0.8em;font-weight:700;line-height:1.5;white-space:nowrap;vertical-align:0.1em;cursor:default;user-select:none;background-color:var(--clampography-surface, oklch(94% 0.004 264));color:var(--clampography-text, oklch(18% 0.015 264));border:1px solid var(--clampography-border, oklch(76% 0.008 264));border-radius:4px;box-shadow:0 2px 0 color-mix(in oklab, var(--clampography-border, oklch(60% 0.008 264)) 100%, black 18%), 0 3px 2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);transition-property:box-shadow, transform, border-bottom-width;transition-duration:80ms}:root kbd:active{transform:translateY(2px);box-shadow:0 0 0 color-mix(in oklab, var(--clampography-border, oklch(60% 0.008 264)) 100%, black 18%), 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3)}}
package/package.json CHANGED
@@ -24,9 +24,8 @@
24
24
  "src",
25
25
  "css"
26
26
  ],
27
- "unpkg": "css/clampography.min.css",
28
- "jsdelivr": "css/clampography.min.css",
29
27
  "homepage": "https://next.dav.one/clampography/",
28
+ "jsdelivr": "css/clampography.min.css",
30
29
  "keywords": [
31
30
  "alternative",
32
31
  "blog",
@@ -62,8 +61,12 @@
62
61
  },
63
62
  "scripts": {
64
63
  "build": "bun src/convert.js",
64
+ "dev": "bun run dev/server.js",
65
+ "dev:server": "bun run dev/server.js",
65
66
  "test": "bun test"
66
67
  },
68
+ "sideEffects": false,
67
69
  "type": "module",
68
- "version": "2.0.0-beta.25"
70
+ "unpkg": "css/clampography.min.css",
71
+ "version": "2.0.0-beta.27"
69
72
  }
package/src/base.js CHANGED
@@ -32,22 +32,48 @@ export default (options = {}) => {
32
32
  };
33
33
 
34
34
  return {
35
- // ROOT CONFIGURATION
36
- [root]: {
37
- "--spacing-xs": "clamp(0.5rem, 0.375rem + 0.625vw, 0.75rem)",
38
- "--spacing-sm": "clamp(0.75rem, 0.5625rem + 0.9375vw, 1.25rem)",
39
- "--spacing-md": "clamp(1rem, 0.75rem + 1.25vw, 1.5rem)",
40
- "--spacing-lg": "clamp(1.5rem, 1.125rem + 1.875vw, 2.5rem)",
41
- "--spacing-xl": "clamp(2rem, 1.5rem + 2.5vw, 3rem)",
35
+ // ROOT CONFIGURATION (CSS variables)
36
+ // Uses :where() for zero specificity so user overrides always win regardless of layer/source order
37
+ [`:where(${root})`]: {
38
+ "--spacing-xs": "clamp(0.25rem, 1.25vw, 0.75rem)",
39
+ "--spacing-sm": "clamp(0.375rem, -0.0625rem + 2.1875vw, 1.25rem)",
40
+ "--spacing-md": "clamp(0.5rem, 2.5vw, 1.5rem)",
41
+ "--spacing-lg": "clamp(0.75rem, -0.125rem + 4.375vw, 2.5rem)",
42
+ "--spacing-xl": "clamp(1rem, 5vw, 3rem)",
42
43
  "--list-indent": "clamp(1.5rem, 1.25rem + 1.25vw, 2rem)",
43
44
  "--scroll-offset": "5rem",
44
45
  "--font-family-base":
45
- "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif",
46
+ "Inter, system-ui, -apple-system, 'Segoe UI Variable Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif",
46
47
  "--font-family-mono":
47
- "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
48
-
49
- // Body styles applied to the root container
50
- "font-family": "var(--font-family-base)",
48
+ "ui-monospace, 'Cascadia Code', 'Cascadia Mono', 'Segoe UI Mono', 'Ubuntu Mono', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
49
+
50
+ // Heading size tokens (30→54px, 22→30px, 18→24px, 16→20px, static)
51
+ // Override any of these in :root to customize individual headings.
52
+ "--clampography-h1-size": "clamp(1.875rem, 1.375rem + 2.5vw, 3.375rem)",
53
+ "--clampography-h2-size": "clamp(1.375rem, 1.2rem + 0.85vw, 1.875rem)",
54
+ "--clampography-h3-size": "clamp(1.125rem, 1rem + 0.625vw, 1.5rem)",
55
+ "--clampography-h4-size": "clamp(1rem, 0.917rem + 0.42vw, 1.25rem)",
56
+ "--clampography-h5-size": "1rem",
57
+ "--clampography-h6-size": "0.875rem",
58
+
59
+ // Global heading scale multiplier (default: 1 = no scaling).
60
+ // Override in :root to proportionally scale all headings at once.
61
+ // Example: :root { --clampography-heading-scale: 0.85; }
62
+ "--clampography-heading-scale": "1",
63
+
64
+ // Individual heading scales (default to global scale)
65
+ "--clampography-h1-scale": "var(--clampography-heading-scale)",
66
+ "--clampography-h2-scale": "var(--clampography-heading-scale)",
67
+ "--clampography-h3-scale": "var(--clampography-heading-scale)",
68
+ "--clampography-h4-scale": "var(--clampography-heading-scale)",
69
+ "--clampography-h5-scale": "var(--clampography-heading-scale)",
70
+ "--clampography-h6-scale": "var(--clampography-heading-scale)",
71
+ },
72
+
73
+ // BODY STYLES (Typography baseline)
74
+ // Note: font-family is intentionally NOT set here.
75
+ // It is applied in extra.js with user-font priority via --font-sans.
76
+ [root === ":root" ? "body" : root]: {
51
77
  "font-size": "clamp(1rem, 0.95rem + 0.25vw, 1.125rem)",
52
78
  "line-height": "1.75",
53
79
  "text-rendering": "optimizeLegibility",
@@ -63,7 +89,7 @@ export default (options = {}) => {
63
89
  },
64
90
 
65
91
  [scope("h1")]: {
66
- "font-size": "clamp(2.25rem, 1.95rem + 1.5vw, 3rem)",
92
+ "font-size": "calc(var(--clampography-h1-size) * var(--clampography-h1-scale))",
67
93
  "line-height": "1.1111",
68
94
  "font-weight": "800",
69
95
  "margin-top": "0",
@@ -71,7 +97,7 @@ export default (options = {}) => {
71
97
  },
72
98
 
73
99
  [scope("h2")]: {
74
- "font-size": "clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem)",
100
+ "font-size": "calc(var(--clampography-h2-size) * var(--clampography-h2-scale))",
75
101
  "line-height": "1.3333",
76
102
  "font-weight": "700",
77
103
  "margin-top": "var(--spacing-xl)",
@@ -79,28 +105,28 @@ export default (options = {}) => {
79
105
  },
80
106
 
81
107
  [scope("h3")]: {
82
- "font-size": "clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem)",
108
+ "font-size": "calc(var(--clampography-h3-size) * var(--clampography-h3-scale))",
83
109
  "line-height": "1.5",
84
110
  "margin-top": "var(--spacing-lg)",
85
111
  "margin-bottom": "var(--spacing-sm)",
86
112
  },
87
113
 
88
114
  [scope("h4")]: {
89
- "font-size": "clamp(1rem, 0.975rem + 0.125vw, 1.125rem)",
115
+ "font-size": "calc(var(--clampography-h4-size) * var(--clampography-h4-scale))",
90
116
  "line-height": "1.5",
91
117
  "margin-top": "var(--spacing-lg)",
92
118
  "margin-bottom": "var(--spacing-sm)",
93
119
  },
94
120
 
95
121
  [scope("h5")]: {
96
- "font-size": "1rem",
122
+ "font-size": "calc(var(--clampography-h5-size) * var(--clampography-h5-scale))",
97
123
  "line-height": "1.5",
98
124
  "margin-top": "var(--spacing-md)",
99
125
  "margin-bottom": "var(--spacing-xs)",
100
126
  },
101
127
 
102
128
  [scope("h6")]: {
103
- "font-size": "0.875rem",
129
+ "font-size": "calc(var(--clampography-h6-size) * var(--clampography-h6-scale))",
104
130
  "line-height": "1.5",
105
131
  "margin-top": "var(--spacing-md)",
106
132
  "margin-bottom": "var(--spacing-xs)",
@@ -175,6 +201,8 @@ export default (options = {}) => {
175
201
  [scope(":where(code, kbd, samp)")]: {
176
202
  "font-family": "var(--font-family-mono)",
177
203
  "font-size": "0.875em",
204
+ "-webkit-font-smoothing": "auto",
205
+ "-moz-osx-font-smoothing": "auto",
178
206
  },
179
207
 
180
208
  [scope("kbd")]: {
@@ -202,6 +230,7 @@ export default (options = {}) => {
202
230
 
203
231
  [scope("abbr[title]")]: {
204
232
  "text-decoration": "underline dotted",
233
+ "text-underline-offset": "4px",
205
234
  cursor: "help",
206
235
  },
207
236
 
@@ -357,6 +386,8 @@ export default (options = {}) => {
357
386
  "font-family": "var(--font-family-mono)",
358
387
  "line-height": "1.6",
359
388
  "overflow-x": "auto",
389
+ "-webkit-font-smoothing": "auto",
390
+ "-moz-osx-font-smoothing": "auto",
360
391
  },
361
392
 
362
393
  [scope("pre code")]: {
@@ -386,7 +417,7 @@ export default (options = {}) => {
386
417
  [scope("fieldset")]: {
387
418
  "margin-top": "var(--spacing-md)",
388
419
  "margin-bottom": "var(--spacing-md)",
389
- padding: "var(--spacing-md)",
420
+ padding: "var(--spacing-sm)",
390
421
  },
391
422
 
392
423
  [scope("legend")]: {
package/src/extra.js CHANGED
@@ -31,10 +31,13 @@ export default (options = {}) => {
31
31
  };
32
32
 
33
33
  return {
34
- // --- Basic Coloring ---
35
- [root]: {
34
+ // --- Basic Coloring & Font (with user-font priority) ---
35
+ [root === ":root" ? "body" : root]: {
36
36
  "background-color": "var(--clampography-background)",
37
37
  "color": "var(--clampography-text)",
38
+ // --font-sans is Tailwind v4's way to expose the user's font choice.
39
+ // If the user sets a font in their project, it wins. If not, fallback to clampography's system stack.
40
+ "font-family": "var(--font-sans, var(--font-family-base))",
38
41
  },
39
42
 
40
43
  [scope(":where(h1, h2, h3, h4, h5, h6)")]: {
@@ -87,7 +90,7 @@ export default (options = {}) => {
87
90
  "background-color": "var(--clampography-surface)",
88
91
  "border": "1px solid var(--clampography-border)",
89
92
  "border-radius": "0.375rem",
90
- "padding": "1rem",
93
+ "padding": "var(--spacing-md)",
91
94
  },
92
95
 
93
96
  // Tables
@@ -121,8 +124,8 @@ export default (options = {}) => {
121
124
  [scope("hr")]: {
122
125
  "height": "1px",
123
126
  "border-width": "0",
124
- "margin-top": "3rem",
125
- "margin-bottom": "3rem",
127
+ "margin-top": "var(--spacing-xl)",
128
+ "margin-bottom": "var(--spacing-xl)",
126
129
  "background-color": "var(--clampography-border)",
127
130
  },
128
131
 
@@ -131,7 +134,7 @@ export default (options = {}) => {
131
134
  "border-left-width": "4px",
132
135
  "border-left-color": "var(--clampography-primary)",
133
136
  "background-color": "var(--clampography-surface)",
134
- "padding": "1rem",
137
+ "padding": "var(--spacing-md)",
135
138
  "border-radius": "0.25rem",
136
139
  "font-style": "italic",
137
140
  "color": "var(--clampography-heading)",
@@ -155,16 +158,17 @@ export default (options = {}) => {
155
158
  [scope("details")]: {
156
159
  "border": "1px solid var(--clampography-border)",
157
160
  "border-radius": "0.375rem",
158
- "padding": "0.5rem",
161
+ "padding": "var(--spacing-sm)",
159
162
  },
160
163
 
161
164
  [scope("summary")]: {
162
165
  "color": "var(--clampography-heading)",
166
+ "border-bottom": "0px solid var(--clampography-border)",
163
167
  },
164
168
 
165
169
  [scope("details[open] > summary")]: {
166
- "border-bottom": "1px solid var(--clampography-border)",
167
- "padding-bottom": "0.5rem",
170
+ "border-bottom-width": "1px",
171
+ "padding-bottom": "var(--spacing-sm)",
168
172
  },
169
173
  };
170
174
  };
package/src/forms.js CHANGED
@@ -205,10 +205,94 @@ export default (options = {}) => {
205
205
  "font-weight": "600",
206
206
  },
207
207
 
208
- // ── Meter & Progress ──────────────────────────────────────────────────────
209
- [scope(":where(meter, progress)")]: {
210
- "accent-color": "var(--clampography-primary)",
208
+ // ── Progress ──────────────────────────────────────────────────────────────
209
+ [scope("progress")]: {
210
+ "-webkit-appearance": "none",
211
+ "appearance": "none",
211
212
  "width": "100%",
213
+ "height": "1em",
214
+ "background": "transparent",
212
215
  },
216
+
217
+ // WebKit progress track
218
+ [scope("progress::-webkit-progress-bar")]: {
219
+ "background": "color-mix(in oklab, var(--clampography-text) 20%, transparent)",
220
+ },
221
+
222
+ // WebKit progress value
223
+ [scope("progress::-webkit-progress-value")]: {
224
+ "background": "var(--clampography-success)",
225
+ },
226
+
227
+ // Firefox progress value
228
+ [scope("progress::-moz-progress-bar")]: {
229
+ "background": "var(--clampography-success)",
230
+ },
231
+
232
+ // ── Meter ─────────────────────────────────────────────────────────────────
233
+ // Custom styling for <meter> (accent-color does not work on meter)
234
+ [scope("meter")]: {
235
+ "-webkit-appearance": "none",
236
+ "appearance": "none",
237
+ "width": "100%",
238
+ "height": "1em",
239
+ "background": "transparent",
240
+ },
241
+
242
+ // Firefox track (restored via Firefox-only feature query)
243
+ // @supports (-moz-appearance: none) is ignored by all WebKit/Blink browsers
244
+ "@supports (-moz-appearance: none)": {
245
+ [scope("progress")]: {
246
+ "background": "color-mix(in oklab, var(--clampography-text) 20%, transparent)",
247
+ },
248
+ [scope("meter")]: {
249
+ "background": "color-mix(in oklab, var(--clampography-text) 20%, transparent)",
250
+ },
251
+ },
252
+
253
+ // Re-establish height context for WebKit shadow DOM
254
+ // appearance:none breaks Chrome's flex layout; inner elements can't resolve height:100%
255
+ // without a concrete parent height set here.
256
+ // display:flex + align-items:stretch forces the child bar to fill the full height
257
+ // without top-anchoring it the way display:block would.
258
+ [scope("meter::-webkit-meter-inner-element")]: {
259
+ "display": "flex",
260
+ "align-items": "stretch",
261
+ "height": "1em",
262
+ },
263
+
264
+ // WebKit inner track
265
+ [scope("meter::-webkit-meter-bar")]: {
266
+ "background": "color-mix(in oklab, var(--clampography-text) 20%, transparent)",
267
+ "height": "100%",
268
+ },
269
+
270
+ // 1. Optimum (Success)
271
+ [scope("meter::-webkit-meter-optimum-value")]: {
272
+ "background": "var(--clampography-success)",
273
+ "height": "100%",
274
+ },
275
+ [scope("meter:-moz-meter-optimum::-moz-meter-bar")]: {
276
+ "background": "var(--clampography-success)",
277
+ },
278
+
279
+ // 2. Sub-optimum (Warning)
280
+ [scope("meter::-webkit-meter-suboptimum-value")]: {
281
+ "background": "var(--clampography-warning)",
282
+ "height": "100%",
283
+ },
284
+ [scope("meter:-moz-meter-sub-optimum::-moz-meter-bar")]: {
285
+ "background": "var(--clampography-warning)",
286
+ },
287
+
288
+ // 3. Even less good (Error)
289
+ [scope("meter::-webkit-meter-even-less-good-value")]: {
290
+ "background": "var(--clampography-error)",
291
+ "height": "100%",
292
+ },
293
+ [scope("meter:-moz-meter-sub-sub-optimum::-moz-meter-bar")]: {
294
+ "background": "var(--clampography-error)",
295
+ },
296
+
213
297
  };
214
298
  };
package/src/kbd.js CHANGED
@@ -44,7 +44,7 @@ export default (options = {}) => {
44
44
  [scope("kbd")]: {
45
45
  "display": "inline-block",
46
46
  "padding": "0.1em 0.45em",
47
- "min-width": "1.6em",
47
+ "min-width": "2em",
48
48
  "text-align": "center",
49
49
  "font-size": "0.8em",
50
50
  "font-weight": "700",