@nyxwire/css 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +133 -2
- package/dist/base.css +850 -0
- package/dist/components.css +10508 -0
- package/dist/docs/components/accordion.md +83 -0
- package/dist/docs/components/alert.md +52 -0
- package/dist/docs/components/avatar.md +55 -0
- package/dist/docs/components/badge.md +64 -0
- package/dist/docs/components/breadcrumbs.md +64 -0
- package/dist/docs/components/button.md +197 -0
- package/dist/docs/components/card.md +103 -0
- package/dist/docs/components/checkbox.md +45 -0
- package/dist/docs/components/chip.md +30 -0
- package/dist/docs/components/cluster.md +33 -0
- package/dist/docs/components/code.md +65 -0
- package/dist/docs/components/container.md +24 -0
- package/dist/docs/components/dialog.md +199 -0
- package/dist/docs/components/divider.md +31 -0
- package/dist/docs/components/dl.md +24 -0
- package/dist/docs/components/effect-utilities.md +82 -0
- package/dist/docs/components/empty.md +40 -0
- package/dist/docs/components/frame.md +27 -0
- package/dist/docs/components/grid.md +31 -0
- package/dist/docs/components/hud.md +75 -0
- package/dist/docs/components/input-group.md +28 -0
- package/dist/docs/components/input.md +52 -0
- package/dist/docs/components/kbd.md +42 -0
- package/dist/docs/components/label-and-field.md +31 -0
- package/dist/docs/components/link.md +41 -0
- package/dist/docs/components/list.md +67 -0
- package/dist/docs/components/menu.md +85 -0
- package/dist/docs/components/meter.md +77 -0
- package/dist/docs/components/navbar.md +66 -0
- package/dist/docs/components/pagination.md +64 -0
- package/dist/docs/components/popover.md +59 -0
- package/dist/docs/components/progress.md +32 -0
- package/dist/docs/components/prose.md +29 -0
- package/dist/docs/components/select.md +51 -0
- package/dist/docs/components/sidebar.md +35 -0
- package/dist/docs/components/sidenav.md +45 -0
- package/dist/docs/components/skeleton.md +36 -0
- package/dist/docs/components/slider.md +32 -0
- package/dist/docs/components/spinner.md +30 -0
- package/dist/docs/components/stack.md +26 -0
- package/dist/docs/components/steps.md +49 -0
- package/dist/docs/components/switch.md +19 -0
- package/dist/docs/components/table.md +83 -0
- package/dist/docs/components/tabs.md +207 -0
- package/dist/docs/components/textarea.md +13 -0
- package/dist/docs/components/toast.md +86 -0
- package/dist/docs/components/tooltip.md +39 -0
- package/dist/docs/components/typography-classes.md +38 -0
- package/dist/docs/families/data-display.md +15 -0
- package/dist/docs/families/feedback.md +13 -0
- package/dist/docs/families/forms.md +141 -0
- package/dist/docs/families/layout-typography.md +17 -0
- package/dist/docs/families/navigation.md +13 -0
- package/dist/docs/families/overlays.md +13 -0
- package/dist/docs/families/surfaces.md +11 -0
- package/dist/docs/foundations/accessibility.md +71 -0
- package/dist/docs/foundations/color-roles.md +114 -0
- package/dist/docs/foundations/effects-motion.md +150 -0
- package/dist/docs/foundations/flavors.md +156 -0
- package/dist/docs/foundations/icons.md +45 -0
- package/dist/docs/foundations/palette.md +180 -0
- package/dist/docs/foundations/spacing-elevation.md +168 -0
- package/dist/docs/foundations/typography.md +80 -0
- package/dist/docs/index.md +233 -0
- package/dist/docs/manifest.json +859 -0
- package/dist/fonts/inter-OFL.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-OFL.txt +93 -0
- package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-OFL.txt +93 -0
- package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +73 -0
- package/dist/nyxwire.css +12183 -0
- package/dist/tokens.css +579 -0
- package/dist/utilities.css +176 -0
- package/nyxwire.d.ts +2 -0
- package/package.json +66 -3
- package/skills/nyxwire/SKILL.md +63 -0
- package/src/base.css +158 -0
- package/src/components/accordion.css +280 -0
- package/src/components/alert.css +176 -0
- package/src/components/avatar.css +262 -0
- package/src/components/badge.css +193 -0
- package/src/components/breadcrumbs.css +209 -0
- package/src/components/btn.css +517 -0
- package/src/components/card.css +327 -0
- package/src/components/checkbox.css +202 -0
- package/src/components/chip.css +345 -0
- package/src/components/code.css +340 -0
- package/src/components/dialog.css +411 -0
- package/src/components/divider.css +201 -0
- package/src/components/empty.css +216 -0
- package/src/components/field.css +161 -0
- package/src/components/hud.css +212 -0
- package/src/components/index.css +50 -0
- package/src/components/input.css +383 -0
- package/src/components/kbd.css +197 -0
- package/src/components/layout.css +344 -0
- package/src/components/link.css +178 -0
- package/src/components/list.css +353 -0
- package/src/components/menu.css +347 -0
- package/src/components/meter.css +238 -0
- package/src/components/navbar.css +309 -0
- package/src/components/pagination.css +302 -0
- package/src/components/popover.css +352 -0
- package/src/components/progress.css +241 -0
- package/src/components/select.css +121 -0
- package/src/components/sidenav.css +326 -0
- package/src/components/skeleton.css +193 -0
- package/src/components/slider.css +201 -0
- package/src/components/spinner.css +200 -0
- package/src/components/stat.css +263 -0
- package/src/components/steps.css +311 -0
- package/src/components/switch.css +183 -0
- package/src/components/table.css +290 -0
- package/src/components/tabs.css +271 -0
- package/src/components/toast.css +413 -0
- package/src/components/tooltip.css +288 -0
- package/src/fonts.css +92 -0
- package/src/index.css +6 -0
- package/src/motion.css +177 -0
- package/src/semantic.css +85 -0
- package/src/tokens.css +276 -0
- package/src/typography.css +430 -0
- package/src/utilities.css +198 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/* Chip: a filter, a selected value or a removable token. Rest is quiet so a row of chips does not
|
|
2
|
+
read as a row of primary buttons; the selected state carries the intent.
|
|
3
|
+
Select with aria-pressed / aria-checked / aria-selected / data-state='on', or put a checkbox or
|
|
4
|
+
radio inside a label chip. The variant class chooses how the selected state is painted:
|
|
5
|
+
solid (default), soft or outline.
|
|
6
|
+
.nw-chip-check reserves its slot in both states, so toggling never changes the chip's width. */
|
|
7
|
+
@layer components {
|
|
8
|
+
.nw-chip {
|
|
9
|
+
--_intent: var(--nw-primary);
|
|
10
|
+
--_on: var(--nw-on-primary);
|
|
11
|
+
--_soft: var(--nw-primary-soft);
|
|
12
|
+
--_h: var(--nw-control-sm);
|
|
13
|
+
--_px: var(--nw-space-3);
|
|
14
|
+
--_gap: var(--nw-space-1-5);
|
|
15
|
+
--_fs: var(--nw-text-sm);
|
|
16
|
+
--_fill: var(--nw-panel);
|
|
17
|
+
--_line: var(--nw-line-strong);
|
|
18
|
+
--_ink: var(--nw-fg-muted);
|
|
19
|
+
--_fill-hover: var(--nw-panel-hover);
|
|
20
|
+
--_line-hover: var(--nw-line-bright);
|
|
21
|
+
--_ink-hover: var(--nw-fg);
|
|
22
|
+
--_fill-on: var(--_intent);
|
|
23
|
+
--_line-on: transparent;
|
|
24
|
+
--_ink-on: var(--_on);
|
|
25
|
+
--_glow: none;
|
|
26
|
+
|
|
27
|
+
position: relative;
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
gap: var(--_gap);
|
|
32
|
+
flex: none;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
max-inline-size: 100%;
|
|
35
|
+
min-inline-size: var(--_h);
|
|
36
|
+
block-size: var(--_h);
|
|
37
|
+
padding-inline: var(--_px);
|
|
38
|
+
border: 1px solid var(--_line);
|
|
39
|
+
border-radius: var(--nw-radius-full);
|
|
40
|
+
font-family: var(--nw-font-sans);
|
|
41
|
+
font-size: var(--_fs);
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
line-height: var(--nw-leading-none);
|
|
44
|
+
color: var(--_ink);
|
|
45
|
+
background-color: var(--_fill);
|
|
46
|
+
box-shadow: var(--_glow);
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
vertical-align: middle;
|
|
49
|
+
text-decoration-line: none;
|
|
50
|
+
transition:
|
|
51
|
+
background-color var(--nw-duration-fast) var(--nw-ease-standard),
|
|
52
|
+
border-color var(--nw-duration-fast) var(--nw-ease-standard),
|
|
53
|
+
color var(--nw-duration-fast) var(--nw-ease-standard),
|
|
54
|
+
box-shadow var(--nw-duration-fast) var(--nw-ease-standard);
|
|
55
|
+
}
|
|
56
|
+
.nw-chip > svg {
|
|
57
|
+
flex: none;
|
|
58
|
+
inline-size: 1.1em;
|
|
59
|
+
block-size: 1.1em;
|
|
60
|
+
}
|
|
61
|
+
.nw-chip:is(a, button, label, [role='button'], [tabindex]) {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
user-select: none;
|
|
64
|
+
-webkit-tap-highlight-color: transparent;
|
|
65
|
+
}
|
|
66
|
+
.nw-chip:is(a, button, label, [role='button'], [tabindex]):hover:not(
|
|
67
|
+
:disabled,
|
|
68
|
+
[aria-disabled='true'],
|
|
69
|
+
.nw-chip-disabled
|
|
70
|
+
) {
|
|
71
|
+
--_fill: var(--_fill-hover);
|
|
72
|
+
--_line: var(--_line-hover);
|
|
73
|
+
--_ink: var(--_ink-hover);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Selected --------------------------------------------------------------------------------- */
|
|
77
|
+
.nw-chip:is(
|
|
78
|
+
[aria-pressed='true'],
|
|
79
|
+
[aria-checked='true'],
|
|
80
|
+
[aria-selected='true'],
|
|
81
|
+
[data-state='on'],
|
|
82
|
+
:has(:checked)
|
|
83
|
+
) {
|
|
84
|
+
--_fill: var(--_fill-on);
|
|
85
|
+
--_line: var(--_line-on);
|
|
86
|
+
--_ink: var(--_ink-on);
|
|
87
|
+
--_fill-hover: var(--_fill-on);
|
|
88
|
+
--_line-hover: var(--_line-on);
|
|
89
|
+
--_ink-hover: var(--_ink-on);
|
|
90
|
+
--_glow: var(--nw-glow-sm);
|
|
91
|
+
}
|
|
92
|
+
.nw-chip:is(a, button, label, [role='button'], [tabindex]):active:not(
|
|
93
|
+
:disabled,
|
|
94
|
+
[aria-disabled='true'],
|
|
95
|
+
.nw-chip-disabled
|
|
96
|
+
) {
|
|
97
|
+
--_glow: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Intents -------------------------------------------------------------------------------- */
|
|
101
|
+
.nw-chip-primary {
|
|
102
|
+
--_intent: var(--nw-primary);
|
|
103
|
+
--_on: var(--nw-on-primary);
|
|
104
|
+
--_soft: var(--nw-primary-soft);
|
|
105
|
+
}
|
|
106
|
+
.nw-chip-secondary {
|
|
107
|
+
--_intent: var(--nw-secondary);
|
|
108
|
+
--_on: var(--nw-on-secondary);
|
|
109
|
+
--_soft: var(--nw-secondary-soft);
|
|
110
|
+
}
|
|
111
|
+
.nw-chip-tertiary {
|
|
112
|
+
--_intent: var(--nw-tertiary);
|
|
113
|
+
--_on: var(--nw-on-tertiary);
|
|
114
|
+
--_soft: var(--nw-tertiary-soft);
|
|
115
|
+
}
|
|
116
|
+
.nw-chip-neutral {
|
|
117
|
+
--_intent: var(--nw-fg-muted);
|
|
118
|
+
--_on: var(--nw-canvas);
|
|
119
|
+
--_soft: color-mix(in oklab, var(--nw-fg-muted) 16%, transparent);
|
|
120
|
+
}
|
|
121
|
+
.nw-chip-info {
|
|
122
|
+
--_intent: var(--nw-info);
|
|
123
|
+
--_on: var(--nw-on-info);
|
|
124
|
+
--_soft: var(--nw-info-soft);
|
|
125
|
+
}
|
|
126
|
+
.nw-chip-success {
|
|
127
|
+
--_intent: var(--nw-success);
|
|
128
|
+
--_on: var(--nw-on-success);
|
|
129
|
+
--_soft: var(--nw-success-soft);
|
|
130
|
+
}
|
|
131
|
+
.nw-chip-warning {
|
|
132
|
+
--_intent: var(--nw-warning);
|
|
133
|
+
--_on: var(--nw-on-warning);
|
|
134
|
+
--_soft: var(--nw-warning-soft);
|
|
135
|
+
}
|
|
136
|
+
.nw-chip-danger {
|
|
137
|
+
--_intent: var(--nw-danger);
|
|
138
|
+
--_on: var(--nw-on-danger);
|
|
139
|
+
--_soft: var(--nw-danger-soft);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Variants: the selected paint ------------------------------------------------------------- */
|
|
143
|
+
.nw-chip-solid {
|
|
144
|
+
--_fill-on: var(--_intent);
|
|
145
|
+
--_line-on: transparent;
|
|
146
|
+
--_ink-on: var(--_on);
|
|
147
|
+
}
|
|
148
|
+
.nw-chip-soft {
|
|
149
|
+
--_fill-on: var(--_soft);
|
|
150
|
+
--_line-on: var(--_intent);
|
|
151
|
+
--_ink-on: color-mix(in oklab, var(--_intent) var(--nw-soft-ink), var(--nw-fg));
|
|
152
|
+
}
|
|
153
|
+
.nw-chip-outline {
|
|
154
|
+
--_fill-on: transparent;
|
|
155
|
+
--_line-on: var(--_intent);
|
|
156
|
+
--_ink-on: var(--_intent);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Sizes ---------------------------------------------------------------------------------- */
|
|
160
|
+
.nw-chip-xs {
|
|
161
|
+
--_h: var(--nw-space-6);
|
|
162
|
+
--_px: var(--nw-space-2-5);
|
|
163
|
+
--_gap: var(--nw-space-1);
|
|
164
|
+
--_fs: var(--nw-text-xs);
|
|
165
|
+
}
|
|
166
|
+
.nw-chip-sm {
|
|
167
|
+
--_h: var(--nw-control-xs);
|
|
168
|
+
--_px: var(--nw-space-2-5);
|
|
169
|
+
--_gap: var(--nw-space-1-5);
|
|
170
|
+
--_fs: var(--nw-text-xs);
|
|
171
|
+
}
|
|
172
|
+
.nw-chip-md {
|
|
173
|
+
--_h: var(--nw-control-sm);
|
|
174
|
+
--_px: var(--nw-space-3);
|
|
175
|
+
--_gap: var(--nw-space-1-5);
|
|
176
|
+
--_fs: var(--nw-text-sm);
|
|
177
|
+
}
|
|
178
|
+
.nw-chip-lg {
|
|
179
|
+
--_h: var(--nw-control-md);
|
|
180
|
+
--_px: var(--nw-space-4);
|
|
181
|
+
--_gap: var(--nw-space-2);
|
|
182
|
+
--_fs: var(--nw-text-base);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Selection indicator: an empty ring at rest, a filled check when selected. The slot exists in
|
|
186
|
+
both states, so the chip keeps one box. */
|
|
187
|
+
.nw-chip-check {
|
|
188
|
+
display: inline-grid;
|
|
189
|
+
place-items: center;
|
|
190
|
+
flex: none;
|
|
191
|
+
inline-size: 1em;
|
|
192
|
+
block-size: 1em;
|
|
193
|
+
border: 1px solid var(--nw-line-bright);
|
|
194
|
+
border-radius: var(--nw-radius-full);
|
|
195
|
+
color: var(--_on);
|
|
196
|
+
}
|
|
197
|
+
.nw-chip-check::before {
|
|
198
|
+
content: '';
|
|
199
|
+
inline-size: 0.7em;
|
|
200
|
+
block-size: 0.7em;
|
|
201
|
+
background-color: currentColor;
|
|
202
|
+
clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 84% 7%, 38% 68%);
|
|
203
|
+
transform: scale(0);
|
|
204
|
+
transition: transform var(--nw-duration-fast) var(--nw-ease-back);
|
|
205
|
+
}
|
|
206
|
+
.nw-chip:is(
|
|
207
|
+
[aria-pressed='true'],
|
|
208
|
+
[aria-checked='true'],
|
|
209
|
+
[aria-selected='true'],
|
|
210
|
+
[data-state='on'],
|
|
211
|
+
:has(:checked)
|
|
212
|
+
)
|
|
213
|
+
> .nw-chip-check {
|
|
214
|
+
border-color: transparent;
|
|
215
|
+
}
|
|
216
|
+
.nw-chip:is(
|
|
217
|
+
[aria-pressed='true'],
|
|
218
|
+
[aria-checked='true'],
|
|
219
|
+
[aria-selected='true'],
|
|
220
|
+
[data-state='on'],
|
|
221
|
+
:has(:checked)
|
|
222
|
+
)
|
|
223
|
+
> .nw-chip-check::before {
|
|
224
|
+
transform: scale(1);
|
|
225
|
+
}
|
|
226
|
+
.nw-chip-soft > .nw-chip-check,
|
|
227
|
+
.nw-chip-outline > .nw-chip-check {
|
|
228
|
+
color: var(--_intent);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* Remove button ---------------------------------------------------------------------------- */
|
|
232
|
+
.nw-chip-remove {
|
|
233
|
+
position: relative;
|
|
234
|
+
display: inline-grid;
|
|
235
|
+
place-items: center;
|
|
236
|
+
flex: none;
|
|
237
|
+
inline-size: 1.15em;
|
|
238
|
+
block-size: 1.15em;
|
|
239
|
+
margin-inline-end: calc(-1 * var(--nw-space-1));
|
|
240
|
+
padding: 0;
|
|
241
|
+
border: 0;
|
|
242
|
+
border-radius: var(--nw-radius-full);
|
|
243
|
+
color: inherit;
|
|
244
|
+
background: none;
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
}
|
|
247
|
+
.nw-chip-remove::before {
|
|
248
|
+
content: '';
|
|
249
|
+
inline-size: 0.7em;
|
|
250
|
+
block-size: 0.7em;
|
|
251
|
+
background-color: currentColor;
|
|
252
|
+
clip-path: polygon(
|
|
253
|
+
12% 0,
|
|
254
|
+
50% 38%,
|
|
255
|
+
88% 0,
|
|
256
|
+
100% 12%,
|
|
257
|
+
62% 50%,
|
|
258
|
+
100% 88%,
|
|
259
|
+
88% 100%,
|
|
260
|
+
50% 62%,
|
|
261
|
+
12% 100%,
|
|
262
|
+
0 88%,
|
|
263
|
+
38% 50%,
|
|
264
|
+
0 12%
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
/* The visible mark is small; the hit area is not. */
|
|
268
|
+
.nw-chip-remove::after {
|
|
269
|
+
content: '';
|
|
270
|
+
position: absolute;
|
|
271
|
+
inset: calc(50% - var(--nw-space-3));
|
|
272
|
+
}
|
|
273
|
+
.nw-chip-remove:hover {
|
|
274
|
+
background-color: color-mix(in oklab, currentColor 18%, transparent);
|
|
275
|
+
}
|
|
276
|
+
.nw-chip-remove:focus-visible {
|
|
277
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
278
|
+
outline-offset: var(--nw-ring-offset);
|
|
279
|
+
}
|
|
280
|
+
.nw-chip-remove:disabled,
|
|
281
|
+
.nw-chip-remove[aria-disabled='true'] {
|
|
282
|
+
color: var(--nw-fg-disabled);
|
|
283
|
+
cursor: not-allowed;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* A label chip keeps its native input available to assistive technology. */
|
|
287
|
+
.nw-chip > input {
|
|
288
|
+
position: absolute;
|
|
289
|
+
inline-size: 1px;
|
|
290
|
+
block-size: 1px;
|
|
291
|
+
margin: -1px;
|
|
292
|
+
padding: 0;
|
|
293
|
+
border: 0;
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
clip-path: inset(50%);
|
|
296
|
+
white-space: nowrap;
|
|
297
|
+
}
|
|
298
|
+
.nw-chip:has(> input:focus-visible) {
|
|
299
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
300
|
+
outline-offset: var(--nw-ring-offset);
|
|
301
|
+
}
|
|
302
|
+
.nw-chip:is(a, button):focus-visible {
|
|
303
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
304
|
+
outline-offset: var(--nw-ring-offset);
|
|
305
|
+
}
|
|
306
|
+
.nw-chip:disabled,
|
|
307
|
+
.nw-chip[aria-disabled='true'],
|
|
308
|
+
.nw-chip-disabled,
|
|
309
|
+
.nw-chip:has(> input:disabled) {
|
|
310
|
+
--_fill: var(--nw-panel);
|
|
311
|
+
--_line: var(--nw-line);
|
|
312
|
+
--_ink: var(--nw-fg-disabled);
|
|
313
|
+
--_glow: none;
|
|
314
|
+
cursor: not-allowed;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@media (forced-colors: active) {
|
|
318
|
+
.nw-chip {
|
|
319
|
+
border-color: ButtonText;
|
|
320
|
+
color: ButtonText;
|
|
321
|
+
box-shadow: none;
|
|
322
|
+
}
|
|
323
|
+
.nw-chip:is(
|
|
324
|
+
[aria-pressed='true'],
|
|
325
|
+
[aria-checked='true'],
|
|
326
|
+
[aria-selected='true'],
|
|
327
|
+
[data-state='on'],
|
|
328
|
+
:has(:checked)
|
|
329
|
+
) {
|
|
330
|
+
background: Highlight;
|
|
331
|
+
color: HighlightText;
|
|
332
|
+
}
|
|
333
|
+
.nw-chip:disabled,
|
|
334
|
+
.nw-chip[aria-disabled='true'],
|
|
335
|
+
.nw-chip-disabled,
|
|
336
|
+
.nw-chip:has(> input:disabled) {
|
|
337
|
+
color: GrayText;
|
|
338
|
+
border-color: GrayText;
|
|
339
|
+
}
|
|
340
|
+
.nw-chip-check::before,
|
|
341
|
+
.nw-chip-remove::before {
|
|
342
|
+
background: currentColor;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/* Code: inline <code class="nw-code"> and the <pre class="nw-pre"> block with an optional header
|
|
2
|
+
(filename, language, actions), line numbers, highlighted, added and removed lines, a terminal
|
|
3
|
+
mode and the cut-corner console. */
|
|
4
|
+
@layer components {
|
|
5
|
+
.nw-code {
|
|
6
|
+
--_intent: var(--nw-fg);
|
|
7
|
+
--_soft: var(--nw-panel);
|
|
8
|
+
--_edge: var(--nw-line);
|
|
9
|
+
--_fs: 0.875em;
|
|
10
|
+
display: inline;
|
|
11
|
+
padding: var(--nw-space-0-5) var(--nw-space-1-5);
|
|
12
|
+
border: 1px solid var(--_edge);
|
|
13
|
+
border-radius: var(--nw-radius-sm);
|
|
14
|
+
font-family: var(--nw-font-mono);
|
|
15
|
+
font-size: var(--_fs);
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
line-height: inherit;
|
|
18
|
+
color: var(--_intent);
|
|
19
|
+
background-color: var(--_soft);
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
overflow-wrap: anywhere;
|
|
22
|
+
}
|
|
23
|
+
.nw-code-wrap {
|
|
24
|
+
white-space: normal;
|
|
25
|
+
}
|
|
26
|
+
.nw-code-plain {
|
|
27
|
+
padding: 0;
|
|
28
|
+
border: 0;
|
|
29
|
+
background: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Intents: ink on tint, like the keycap. */
|
|
33
|
+
.nw-code-primary {
|
|
34
|
+
--_intent: color-mix(in oklab, var(--nw-primary) var(--nw-soft-ink), var(--nw-fg));
|
|
35
|
+
--_soft: var(--nw-primary-soft);
|
|
36
|
+
--_edge: color-mix(in oklab, var(--nw-primary) 35%, transparent);
|
|
37
|
+
}
|
|
38
|
+
.nw-code-secondary {
|
|
39
|
+
--_intent: color-mix(in oklab, var(--nw-secondary) var(--nw-soft-ink), var(--nw-fg));
|
|
40
|
+
--_soft: var(--nw-secondary-soft);
|
|
41
|
+
--_edge: color-mix(in oklab, var(--nw-secondary) 35%, transparent);
|
|
42
|
+
}
|
|
43
|
+
.nw-code-tertiary {
|
|
44
|
+
--_intent: color-mix(in oklab, var(--nw-tertiary) var(--nw-soft-ink), var(--nw-fg));
|
|
45
|
+
--_soft: var(--nw-tertiary-soft);
|
|
46
|
+
--_edge: color-mix(in oklab, var(--nw-tertiary) 35%, transparent);
|
|
47
|
+
}
|
|
48
|
+
.nw-code-neutral {
|
|
49
|
+
--_intent: var(--nw-fg);
|
|
50
|
+
--_soft: var(--nw-panel);
|
|
51
|
+
--_edge: var(--nw-line);
|
|
52
|
+
}
|
|
53
|
+
.nw-code-info {
|
|
54
|
+
--_intent: color-mix(in oklab, var(--nw-info) var(--nw-soft-ink), var(--nw-fg));
|
|
55
|
+
--_soft: var(--nw-info-soft);
|
|
56
|
+
--_edge: color-mix(in oklab, var(--nw-info) 35%, transparent);
|
|
57
|
+
}
|
|
58
|
+
.nw-code-success {
|
|
59
|
+
--_intent: color-mix(in oklab, var(--nw-success) var(--nw-soft-ink), var(--nw-fg));
|
|
60
|
+
--_soft: var(--nw-success-soft);
|
|
61
|
+
--_edge: color-mix(in oklab, var(--nw-success) 35%, transparent);
|
|
62
|
+
}
|
|
63
|
+
.nw-code-warning {
|
|
64
|
+
--_intent: color-mix(in oklab, var(--nw-warning) var(--nw-soft-ink), var(--nw-fg));
|
|
65
|
+
--_soft: var(--nw-warning-soft);
|
|
66
|
+
--_edge: color-mix(in oklab, var(--nw-warning) 35%, transparent);
|
|
67
|
+
}
|
|
68
|
+
.nw-code-danger {
|
|
69
|
+
--_intent: color-mix(in oklab, var(--nw-danger) var(--nw-soft-ink), var(--nw-fg));
|
|
70
|
+
--_soft: var(--nw-danger-soft);
|
|
71
|
+
--_edge: color-mix(in oklab, var(--nw-danger) 35%, transparent);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Sizes: inline code follows its text by default; these pin it. */
|
|
75
|
+
.nw-code-xs {
|
|
76
|
+
--_fs: var(--nw-text-2xs);
|
|
77
|
+
}
|
|
78
|
+
.nw-code-sm {
|
|
79
|
+
--_fs: var(--nw-text-xs);
|
|
80
|
+
}
|
|
81
|
+
.nw-code-md {
|
|
82
|
+
--_fs: var(--nw-text-sm);
|
|
83
|
+
}
|
|
84
|
+
.nw-code-lg {
|
|
85
|
+
--_fs: var(--nw-text-base);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Block --------------------------------------------------------------------------------------- */
|
|
89
|
+
|
|
90
|
+
.nw-pre {
|
|
91
|
+
--_fs: var(--nw-text-sm);
|
|
92
|
+
--_px: var(--nw-space-5);
|
|
93
|
+
--_py: var(--nw-space-4);
|
|
94
|
+
position: relative;
|
|
95
|
+
display: grid;
|
|
96
|
+
margin: 0;
|
|
97
|
+
border: 1px solid var(--nw-line);
|
|
98
|
+
border-radius: var(--nw-radius-md);
|
|
99
|
+
font-family: var(--nw-font-mono);
|
|
100
|
+
font-size: var(--_fs);
|
|
101
|
+
line-height: var(--nw-leading-normal);
|
|
102
|
+
color: var(--nw-fg);
|
|
103
|
+
background-color: var(--nw-canvas-sunken);
|
|
104
|
+
tab-size: 2;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
/* The scrolling box is the <code> (or .nw-pre-body) so the header stays put. */
|
|
108
|
+
.nw-pre > :is(code, .nw-pre-body) {
|
|
109
|
+
display: block;
|
|
110
|
+
padding: var(--_py) var(--_px);
|
|
111
|
+
font: inherit;
|
|
112
|
+
overflow-x: auto;
|
|
113
|
+
scrollbar-width: thin;
|
|
114
|
+
scrollbar-color: var(--nw-line-strong) transparent;
|
|
115
|
+
}
|
|
116
|
+
.nw-pre:focus-visible,
|
|
117
|
+
.nw-pre > :is(code, .nw-pre-body):focus-visible {
|
|
118
|
+
outline: var(--nw-ring-width) solid var(--nw-ring);
|
|
119
|
+
outline-offset: calc(-1 * var(--nw-ring-width));
|
|
120
|
+
}
|
|
121
|
+
.nw-pre-wrap > :is(code, .nw-pre-body) {
|
|
122
|
+
white-space: pre-wrap;
|
|
123
|
+
overflow-wrap: anywhere;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.nw-pre-header {
|
|
127
|
+
display: flex;
|
|
128
|
+
gap: var(--nw-space-3);
|
|
129
|
+
align-items: center;
|
|
130
|
+
min-block-size: var(--nw-control-sm);
|
|
131
|
+
padding-inline: var(--_px) var(--nw-space-2);
|
|
132
|
+
border-block-end: 1px solid var(--nw-line);
|
|
133
|
+
font-size: var(--nw-text-2xs);
|
|
134
|
+
letter-spacing: var(--nw-tracking-wide);
|
|
135
|
+
color: var(--nw-fg-subtle);
|
|
136
|
+
background-color: var(--nw-canvas-subtle);
|
|
137
|
+
}
|
|
138
|
+
.nw-pre-filename {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
gap: var(--nw-space-1-5);
|
|
141
|
+
align-items: center;
|
|
142
|
+
min-inline-size: 0;
|
|
143
|
+
color: var(--nw-fg-muted);
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
text-overflow: ellipsis;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
}
|
|
148
|
+
.nw-pre-filename > svg {
|
|
149
|
+
flex: none;
|
|
150
|
+
inline-size: 1.2em;
|
|
151
|
+
block-size: 1.2em;
|
|
152
|
+
}
|
|
153
|
+
.nw-pre-lang {
|
|
154
|
+
padding: var(--nw-space-0-5) var(--nw-space-1-5);
|
|
155
|
+
border-radius: var(--nw-radius-xs);
|
|
156
|
+
text-transform: uppercase;
|
|
157
|
+
color: var(--nw-primary);
|
|
158
|
+
background-color: var(--nw-primary-soft);
|
|
159
|
+
}
|
|
160
|
+
.nw-pre-actions {
|
|
161
|
+
display: flex;
|
|
162
|
+
gap: var(--nw-space-1);
|
|
163
|
+
align-items: center;
|
|
164
|
+
margin-inline-start: auto;
|
|
165
|
+
font-family: var(--nw-font-sans);
|
|
166
|
+
letter-spacing: normal;
|
|
167
|
+
}
|
|
168
|
+
.nw-pre-caption {
|
|
169
|
+
padding: var(--nw-space-2) var(--_px);
|
|
170
|
+
border-block-start: 1px solid var(--nw-line);
|
|
171
|
+
font-family: var(--nw-font-sans);
|
|
172
|
+
font-size: var(--nw-text-xs);
|
|
173
|
+
color: var(--nw-fg-subtle);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Lines: one .nw-line per source line, spanning the block's full width so a wash reaches the
|
|
177
|
+
edges. Highlights are tonal washes; added and removed lines carry their sign in the gutter. */
|
|
178
|
+
.nw-line {
|
|
179
|
+
display: block;
|
|
180
|
+
margin-inline: calc(-1 * var(--_px));
|
|
181
|
+
padding-inline: var(--_px);
|
|
182
|
+
min-block-size: 1lh;
|
|
183
|
+
}
|
|
184
|
+
.nw-line-highlight {
|
|
185
|
+
background-color: var(--nw-primary-soft);
|
|
186
|
+
}
|
|
187
|
+
.nw-line-add {
|
|
188
|
+
background-color: var(--nw-success-soft);
|
|
189
|
+
}
|
|
190
|
+
.nw-line-del {
|
|
191
|
+
background-color: var(--nw-danger-soft);
|
|
192
|
+
}
|
|
193
|
+
.nw-pre:has(.nw-line-focus) .nw-line:not(.nw-line-focus) {
|
|
194
|
+
opacity: 0.45;
|
|
195
|
+
filter: blur(0.3px);
|
|
196
|
+
transition:
|
|
197
|
+
opacity var(--nw-duration-base) var(--nw-ease-standard),
|
|
198
|
+
filter var(--nw-duration-base) var(--nw-ease-standard);
|
|
199
|
+
}
|
|
200
|
+
.nw-pre:has(.nw-line-focus):hover .nw-line {
|
|
201
|
+
opacity: 1;
|
|
202
|
+
filter: none;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Line numbers, counted in CSS so the source stays clean. */
|
|
206
|
+
.nw-pre-lines > :is(code, .nw-pre-body) {
|
|
207
|
+
counter-reset: nw-line var(--nw-line-start, 0);
|
|
208
|
+
}
|
|
209
|
+
.nw-pre-lines .nw-line {
|
|
210
|
+
display: grid;
|
|
211
|
+
grid-template-columns: var(--nw-space-8) minmax(0, 1fr);
|
|
212
|
+
gap: var(--nw-space-4);
|
|
213
|
+
}
|
|
214
|
+
.nw-pre-lines .nw-line::before {
|
|
215
|
+
content: counter(nw-line);
|
|
216
|
+
counter-increment: nw-line;
|
|
217
|
+
text-align: end;
|
|
218
|
+
font-variant-numeric: tabular-nums;
|
|
219
|
+
color: var(--nw-fg-faint);
|
|
220
|
+
user-select: none;
|
|
221
|
+
}
|
|
222
|
+
.nw-pre-lines .nw-line-highlight::before {
|
|
223
|
+
color: var(--nw-primary);
|
|
224
|
+
}
|
|
225
|
+
.nw-pre-lines .nw-line-add::before {
|
|
226
|
+
content: '+';
|
|
227
|
+
color: var(--nw-success);
|
|
228
|
+
}
|
|
229
|
+
.nw-pre-lines .nw-line-del::before {
|
|
230
|
+
content: '-';
|
|
231
|
+
color: var(--nw-danger);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Terminal: a prompt glyph before each command line; output lines carry no prompt. */
|
|
235
|
+
.nw-pre-terminal .nw-prompt {
|
|
236
|
+
display: block;
|
|
237
|
+
color: var(--nw-fg);
|
|
238
|
+
}
|
|
239
|
+
.nw-pre-terminal .nw-prompt::before {
|
|
240
|
+
content: '>';
|
|
241
|
+
margin-inline-end: var(--nw-space-2);
|
|
242
|
+
color: var(--nw-primary);
|
|
243
|
+
user-select: none;
|
|
244
|
+
}
|
|
245
|
+
.nw-pre-terminal .nw-output {
|
|
246
|
+
display: block;
|
|
247
|
+
color: var(--nw-fg-muted);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Cut: the chamfered console, drawn with the shared cut recipe and the wire as its edge. */
|
|
251
|
+
.nw-pre-cut {
|
|
252
|
+
--nw-fill: var(--nw-canvas-sunken);
|
|
253
|
+
position: relative;
|
|
254
|
+
isolation: isolate;
|
|
255
|
+
border: 0;
|
|
256
|
+
border-radius: 0;
|
|
257
|
+
background: var(--nw-cut-surface);
|
|
258
|
+
overflow: visible;
|
|
259
|
+
}
|
|
260
|
+
.nw-pre-cut::before {
|
|
261
|
+
content: '';
|
|
262
|
+
position: absolute;
|
|
263
|
+
inset: 0;
|
|
264
|
+
z-index: 1;
|
|
265
|
+
pointer-events: none;
|
|
266
|
+
background: var(--nw-line-strong);
|
|
267
|
+
clip-path: var(--nw-cut-ring);
|
|
268
|
+
}
|
|
269
|
+
.nw-pre-cut.nw-pre-wire::before {
|
|
270
|
+
background: var(--nw-gradient-wire);
|
|
271
|
+
}
|
|
272
|
+
.nw-pre-cut.nw-pre-wire {
|
|
273
|
+
filter: var(--nw-glow-drop-wire);
|
|
274
|
+
}
|
|
275
|
+
.nw-pre-cut > .nw-pre-header {
|
|
276
|
+
background: none;
|
|
277
|
+
padding-inline-end: calc(var(--nw-cut) + var(--nw-space-2));
|
|
278
|
+
}
|
|
279
|
+
/* Wire without a cut: the gradient border around the block. */
|
|
280
|
+
.nw-pre-wire:not(.nw-pre-cut) {
|
|
281
|
+
border-color: transparent;
|
|
282
|
+
background:
|
|
283
|
+
linear-gradient(var(--nw-canvas-sunken), var(--nw-canvas-sunken)) padding-box,
|
|
284
|
+
var(--nw-gradient-wire) border-box;
|
|
285
|
+
box-shadow: var(--nw-glow-wire);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* Sizes */
|
|
289
|
+
.nw-pre-xs {
|
|
290
|
+
--_fs: var(--nw-text-2xs);
|
|
291
|
+
--_px: var(--nw-space-3);
|
|
292
|
+
--_py: var(--nw-space-2);
|
|
293
|
+
}
|
|
294
|
+
.nw-pre-sm {
|
|
295
|
+
--_fs: var(--nw-text-xs);
|
|
296
|
+
--_px: var(--nw-space-4);
|
|
297
|
+
--_py: var(--nw-space-3);
|
|
298
|
+
}
|
|
299
|
+
.nw-pre-md {
|
|
300
|
+
--_fs: var(--nw-text-sm);
|
|
301
|
+
--_px: var(--nw-space-5);
|
|
302
|
+
--_py: var(--nw-space-4);
|
|
303
|
+
}
|
|
304
|
+
.nw-pre-lg {
|
|
305
|
+
--_fs: var(--nw-text-base);
|
|
306
|
+
--_px: var(--nw-space-6);
|
|
307
|
+
--_py: var(--nw-space-5);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
@media (prefers-reduced-motion: reduce) {
|
|
311
|
+
.nw-pre:has(.nw-line-focus) .nw-line:not(.nw-line-focus) {
|
|
312
|
+
filter: none;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@media (forced-colors: active) {
|
|
317
|
+
.nw-code,
|
|
318
|
+
.nw-pre,
|
|
319
|
+
.nw-pre-header,
|
|
320
|
+
.nw-pre-caption {
|
|
321
|
+
border-color: CanvasText;
|
|
322
|
+
background: Canvas;
|
|
323
|
+
box-shadow: none;
|
|
324
|
+
}
|
|
325
|
+
.nw-pre-cut {
|
|
326
|
+
border: 1px solid CanvasText;
|
|
327
|
+
filter: none;
|
|
328
|
+
}
|
|
329
|
+
.nw-pre-cut::before {
|
|
330
|
+
display: none;
|
|
331
|
+
}
|
|
332
|
+
.nw-line-highlight,
|
|
333
|
+
.nw-line-add,
|
|
334
|
+
.nw-line-del {
|
|
335
|
+
forced-color-adjust: none;
|
|
336
|
+
color: HighlightText;
|
|
337
|
+
background-color: Highlight;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|