@codenhub/styles 0.6.0 → 0.8.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/NOTICE +18 -16
- package/README.es.md +62 -0
- package/README.md +28 -22
- package/README.pt-BR.md +62 -0
- package/dist/aesthetics/chunky-tile.css +1 -1
- package/dist/aesthetics/cyber.css +1 -1
- package/dist/aesthetics/glass.css +1 -1
- package/dist/aesthetics/index.css +2 -2
- package/dist/aesthetics/neobrutalism.css +1 -1
- package/dist/aesthetics/pixel.css +1 -1
- package/dist/aesthetics/sketch.css +1 -1
- package/dist/cli.js +189 -0
- package/dist/components.css +2 -2
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/native.css +2 -2
- package/dist/palette.css +1 -1
- package/dist/theme.css +2 -2
- package/docs/accessibility.md +108 -60
- package/docs/changelog/0.1.1.md +1 -0
- package/docs/changelog/0.2.0.md +1 -0
- package/docs/changelog/0.3.0.md +1 -0
- package/docs/changelog/0.4.0.md +1 -0
- package/docs/changelog/0.5.0.md +8 -3
- package/docs/changelog/0.6.0.md +2 -1
- package/docs/changelog/0.7.0.md +50 -0
- package/docs/changelog/0.8.0.md +70 -0
- package/docs/changelog/index.md +2 -0
- package/docs/concepts.md +188 -46
- package/docs/es/accessibility.md +169 -0
- package/docs/es/concepts.md +212 -0
- package/docs/es/index.md +105 -0
- package/docs/es/integrating/astro.md +35 -0
- package/docs/es/integrating/index.md +75 -0
- package/docs/es/integrating/nextjs.md +67 -0
- package/docs/es/integrating/svelte.md +45 -0
- package/docs/es/integrating/tailwind.md +148 -0
- package/docs/es/integrating/vue.md +31 -0
- package/docs/es/integrating/without-a-bundler.md +238 -0
- package/docs/es/setup.md +188 -0
- package/docs/es/usage/aesthetics.md +282 -0
- package/docs/es/usage/buttons.md +135 -0
- package/docs/es/usage/composing.md +168 -0
- package/docs/es/usage/content-and-layout.md +219 -0
- package/docs/es/usage/customizing.md +304 -0
- package/docs/es/usage/feedback.md +157 -0
- package/docs/es/usage/forms.md +256 -0
- package/docs/es/usage/index.md +33 -0
- package/docs/es/usage/presets.md +92 -0
- package/docs/es/usage/solo.md +86 -0
- package/docs/es/usage/theming.md +309 -0
- package/docs/es/usage/tooltips.md +127 -0
- package/docs/index.md +86 -26
- package/docs/integrating/astro.md +3 -4
- package/docs/integrating/index.md +46 -13
- package/docs/integrating/nextjs.md +3 -4
- package/docs/integrating/svelte.md +5 -4
- package/docs/integrating/tailwind.md +89 -6
- package/docs/integrating/vue.md +3 -4
- package/docs/integrating/without-a-bundler.md +237 -0
- package/docs/pt-BR/accessibility.md +169 -0
- package/docs/pt-BR/concepts.md +212 -0
- package/docs/pt-BR/index.md +105 -0
- package/docs/pt-BR/integrating/astro.md +35 -0
- package/docs/pt-BR/integrating/index.md +75 -0
- package/docs/pt-BR/integrating/nextjs.md +67 -0
- package/docs/pt-BR/integrating/svelte.md +45 -0
- package/docs/pt-BR/integrating/tailwind.md +148 -0
- package/docs/pt-BR/integrating/vue.md +31 -0
- package/docs/pt-BR/integrating/without-a-bundler.md +238 -0
- package/docs/pt-BR/setup.md +188 -0
- package/docs/pt-BR/usage/aesthetics.md +282 -0
- package/docs/pt-BR/usage/buttons.md +135 -0
- package/docs/pt-BR/usage/composing.md +168 -0
- package/docs/pt-BR/usage/content-and-layout.md +219 -0
- package/docs/pt-BR/usage/customizing.md +304 -0
- package/docs/pt-BR/usage/feedback.md +157 -0
- package/docs/pt-BR/usage/forms.md +256 -0
- package/docs/pt-BR/usage/index.md +33 -0
- package/docs/pt-BR/usage/presets.md +92 -0
- package/docs/pt-BR/usage/solo.md +86 -0
- package/docs/pt-BR/usage/theming.md +309 -0
- package/docs/pt-BR/usage/tooltips.md +127 -0
- package/docs/setup.md +142 -91
- package/docs/usage/aesthetics.md +89 -73
- package/docs/usage/buttons.md +112 -40
- package/docs/usage/composing.md +109 -92
- package/docs/usage/content-and-layout.md +160 -125
- package/docs/usage/customizing.md +117 -41
- package/docs/usage/feedback.md +138 -71
- package/docs/usage/forms.md +201 -107
- package/docs/usage/index.md +22 -14
- package/docs/usage/presets.md +91 -0
- package/docs/usage/solo.md +85 -0
- package/docs/usage/theming.md +273 -118
- package/docs/usage/tooltips.md +90 -49
- package/llms-full.txt +2820 -1298
- package/llms.txt +24 -22
- package/package.json +134 -91
- package/{dist/tw → tw}/aesthetics/chunky-tile.css +107 -29
- package/{dist/tw → tw}/aesthetics/cyber.css +88 -40
- package/{dist/tw → tw}/aesthetics/glass.css +257 -61
- package/{dist/tw → tw}/aesthetics/neobrutalism.css +113 -20
- package/{dist/tw → tw}/aesthetics/pixel.css +93 -8
- package/tw/aesthetics/sketch.css +417 -0
- package/{dist/tw → tw}/box.css +105 -9
- package/tw/components/button.css +11 -0
- package/tw/components/button.rules.css +187 -0
- package/tw/components/feedback.css +11 -0
- package/{dist/tw/components/feedback.css → tw/components/feedback.rules.css} +136 -32
- package/tw/components/form.css +11 -0
- package/{dist/tw/components/form.css → tw/components/form.rules.css} +577 -125
- package/tw/components/index.css +16 -0
- package/tw/components/rules.css +41 -0
- package/tw/components/surface.css +11 -0
- package/tw/components/surface.rules.css +222 -0
- package/tw/components/tooltip.css +11 -0
- package/{dist/tw/components/tooltip.css → tw/components/tooltip.rules.css} +43 -27
- package/{dist/tw → tw}/corner.css +18 -12
- package/{dist/tw → tw}/elevation.css +23 -17
- package/{dist/tw → tw}/index.css +12 -10
- package/tw/index.d.ts +1 -0
- package/tw/intent.css +312 -0
- package/tw/modifiers.css +127 -0
- package/tw/native.css +320 -0
- package/tw/presentation.css +139 -0
- package/tw/reset.css +10 -0
- package/{dist/tw/reset.css → tw/reset.rules.css} +21 -22
- package/tw/size.css +34 -0
- package/tw/surface.css +9 -0
- package/tw/surface.rules.css +212 -0
- package/{dist/tw → tw}/theme.css +121 -45
- package/tw/typography.css +8 -0
- package/{dist/tw/typography.css → tw/typography.rules.css} +0 -3
- package/{dist/tw → tw}/utilities/content.css +212 -50
- package/tw/utilities/index.css +11 -0
- package/tw/utilities/layout.css +208 -0
- package/tw/utilities/rules.css +8 -0
- package/dist/tw/aesthetics/sketch.css +0 -333
- package/dist/tw/components/button.css +0 -139
- package/dist/tw/components/index.css +0 -36
- package/dist/tw/components/loader.css +0 -116
- package/dist/tw/components/surface.css +0 -175
- package/dist/tw/intent.css +0 -228
- package/dist/tw/native.css +0 -203
- package/dist/tw/palette.css +0 -460
- package/dist/tw/presentation.css +0 -68
- package/dist/tw/surface.css +0 -61
- package/dist/tw/utilities/index.css +0 -6
- package/dist/tw/utilities/layout.css +0 -130
- /package/{dist/tw → tw}/aesthetics/index.css +0 -0
|
@@ -108,6 +108,12 @@
|
|
|
108
108
|
--ui-label-tracking: initial;
|
|
109
109
|
--ui-label-case: initial;
|
|
110
110
|
--ui-label-shadow: initial;
|
|
111
|
+
|
|
112
|
+
/* No face of its own, so the theme's, named rather than inherited: a
|
|
113
|
+
neobrutalist region nested inside pixel, cyber, sketch, or chunky tile
|
|
114
|
+
otherwise took their face. `--font-default` is the token the reset
|
|
115
|
+
applies to the page, as chunky tile reads it. */
|
|
116
|
+
font-family: var(--font-default, ui-sans-serif, system-ui, sans-serif);
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
|
|
@@ -120,33 +126,111 @@
|
|
|
120
126
|
|
|
121
127
|
In `utilities`, not with the token class: it has to beat `@utility alert`'s
|
|
122
128
|
own `--_d-elevation: 0`, which it does there at 0-2-0, and it writes only a
|
|
123
|
-
private nothing a consumer sets.
|
|
129
|
+
private nothing a consumer sets.
|
|
130
|
+
|
|
131
|
+
Bounded by the nearest aesthetic region: an alert inside another aesthetic
|
|
132
|
+
nested in a neobrutalist region rests as that aesthetic rests it, and one in
|
|
133
|
+
a neobrutalist region nested again inside that takes the slab back. A
|
|
134
|
+
`:not(.neobrutalism :is(...) *)` exclusion cannot tell those two apart, since
|
|
135
|
+
the re-entered alert also sits below the other aesthetic, so each region
|
|
136
|
+
writes a private flag instead and inheritance hands the alert the nearest
|
|
137
|
+
one's. The slab is the alert's own resting default when the flag is unset. */
|
|
124
138
|
@layer utilities {
|
|
125
|
-
.neobrutalism
|
|
126
|
-
--
|
|
139
|
+
.neobrutalism {
|
|
140
|
+
--_neo-alert-elevation: 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:is(.glass, .pixel, .chunky-tile, .cyber, .sketch) {
|
|
144
|
+
--_neo-alert-elevation: initial;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* The class on the alert itself counts as its region, as it does for every
|
|
148
|
+
token: `.card.neobrutalism` takes its slab, and the alert rested flat. */
|
|
149
|
+
:is(.neobrutalism .alert, .alert.neobrutalism) {
|
|
150
|
+
--_d-elevation: var(--_neo-alert-elevation, 0);
|
|
127
151
|
}
|
|
128
152
|
}
|
|
129
153
|
|
|
130
154
|
/* Solo: the same look painted onto the one element carrying the class, for an
|
|
131
155
|
element the package does not style. See docs/internal/model.md#solo-classes and
|
|
132
|
-
the note on `.glass-solo`:
|
|
133
|
-
|
|
134
|
-
|
|
156
|
+
the note on `.glass-solo`: it composes with the element's presentation,
|
|
157
|
+
intent, and elevation, and reads its material from its own knobs and
|
|
158
|
+
foundation tokens with literal fallbacks, never a shared material `--ui-*`
|
|
159
|
+
or `--elevation-color` token. Unlayered, and not for this package's own
|
|
160
|
+
components. */
|
|
135
161
|
.neobrutalism-solo {
|
|
136
162
|
--_neo-offset: var(--neo-offset, 4px);
|
|
137
|
-
|
|
163
|
+
/* The composition, the same in every solo class; `registry.test.ts` holds
|
|
164
|
+
the copies together. See the note on `.glass-solo`. */
|
|
165
|
+
--_solo-intent-color: initial;
|
|
166
|
+
--_solo-intent-contrast: initial;
|
|
167
|
+
--_solo-intent-strong: initial;
|
|
168
|
+
--_solo-intent-border: initial;
|
|
169
|
+
--_solo-intent-fill-max: initial;
|
|
170
|
+
--_solo-color: var(--_solo-intent-color, var(--color-text, light-dark(oklch(14.5% 0 0), oklch(98.5% 0 0))));
|
|
171
|
+
--_solo-contrast: var(
|
|
172
|
+
--_solo-intent-contrast,
|
|
173
|
+
var(--color-text-contrast, light-dark(oklch(98.5% 0 0), oklch(14.5% 0 0)))
|
|
174
|
+
);
|
|
175
|
+
--_solo-strong: var(--_solo-intent-strong, var(--color-text-strong, light-dark(oklch(20.5% 0 0), oklch(97% 0 0))));
|
|
176
|
+
--_solo-capped: min(var(--ui-fill, 0%), var(--_solo-intent-fill-max, 20%));
|
|
177
|
+
--_solo-fill: color-mix(in oklab, var(--_solo-color) var(--_solo-capped), transparent);
|
|
178
|
+
--_solo-on-fill: min(var(--ui-fg-on-fill, 0%), max(0%, calc(var(--_solo-capped) * 2 - 100%)));
|
|
179
|
+
--_solo-fg: color-mix(in oklab, var(--_solo-contrast) var(--_solo-on-fill), var(--_solo-strong));
|
|
180
|
+
/* The line with no intent on the element: this aesthetic's own ink. */
|
|
181
|
+
--_solo-ink: var(
|
|
182
|
+
--_solo-intent-border,
|
|
183
|
+
light-dark(var(--color-neutral-950, oklch(14.5% 0 0)), var(--color-neutral-50, oklch(98.5% 0 0)))
|
|
184
|
+
);
|
|
185
|
+
--_solo-edge: color-mix(in oklab, var(--_solo-ink) var(--ui-border, 100%), var(--_solo-fill));
|
|
186
|
+
/* The slab, scaled by the element's own elevation class: `.flat` takes it off
|
|
187
|
+
and `.floating` doubles it, and the press travels the same distance. */
|
|
188
|
+
--_solo-depth: calc(var(--_neo-offset) * var(--ui-elevation, 1));
|
|
138
189
|
|
|
139
|
-
border: 2px solid var(--
|
|
190
|
+
border: 2px solid var(--_solo-edge);
|
|
140
191
|
border-radius: 0;
|
|
141
|
-
box-shadow:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
192
|
+
box-shadow:
|
|
193
|
+
var(--_solo-depth) var(--_solo-depth) 0 0 var(--_solo-ink),
|
|
194
|
+
inset 0 0 0 100vmax var(--_solo-fill);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* An intent class on the element colours it, as on a component. Named rather
|
|
198
|
+
than read from `--intent-*` alone: those slots inherit, so a `.success`
|
|
199
|
+
container would colour a solo element where it leaves a component neutral. */
|
|
200
|
+
.neobrutalism-solo:is(.primary, .secondary, .success, .warning, .destructive, .info) {
|
|
201
|
+
--_solo-intent-color: var(--intent-color);
|
|
202
|
+
--_solo-intent-contrast: var(--intent-contrast);
|
|
203
|
+
--_solo-intent-strong: var(--intent-strong);
|
|
204
|
+
--_solo-intent-border: var(--intent-border);
|
|
205
|
+
--_solo-intent-fill-max: var(--intent-fill-max);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* The text colour is written only where a fill or an intent is asked for, on
|
|
209
|
+
the element or by a container's fill class. Anywhere else the element keeps
|
|
210
|
+
its own: a dark toast keeps its light text. */
|
|
211
|
+
.neobrutalism-solo:is(
|
|
212
|
+
.solid,
|
|
213
|
+
.soft,
|
|
214
|
+
.ghost,
|
|
215
|
+
.primary,
|
|
216
|
+
.secondary,
|
|
217
|
+
.success,
|
|
218
|
+
.warning,
|
|
219
|
+
.destructive,
|
|
220
|
+
.info,
|
|
221
|
+
:is(.solid, .soft, .ghost) *
|
|
222
|
+
) {
|
|
223
|
+
color: var(--_solo-fg);
|
|
145
224
|
}
|
|
146
225
|
|
|
147
226
|
/* The press, only on something pressed: an action, not disabled. A solo
|
|
148
227
|
container -- a toast clicked to dismiss -- stays put, the way only `.btn` and
|
|
149
|
-
an opted-in card press under the aesthetic class.
|
|
228
|
+
an opted-in card press under the aesthetic class.
|
|
229
|
+
|
|
230
|
+
Only an action takes the press's transition. `transition` is one list, so
|
|
231
|
+
writing it on every solo element replaced a container's own -- a toast's
|
|
232
|
+
fade and height stopped animating. The travel is the independent
|
|
233
|
+
`translate`, so the element's own `transform` stays its own. */
|
|
150
234
|
.neobrutalism-solo:is(
|
|
151
235
|
button,
|
|
152
236
|
a[href],
|
|
@@ -155,13 +239,20 @@
|
|
|
155
239
|
input[type="button"],
|
|
156
240
|
input[type="submit"],
|
|
157
241
|
input[type="reset"]
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
|
|
242
|
+
) {
|
|
243
|
+
transition:
|
|
244
|
+
box-shadow var(--motion-duration-normal, 200ms) var(--motion-ease, cubic-bezier(0.2, 0, 0, 1)),
|
|
245
|
+
translate var(--motion-duration-normal, 200ms) var(--motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
246
|
+
|
|
247
|
+
/* Reduced motion keeps the press and drops its motion: the element lands in
|
|
248
|
+
its slab at once. The near-zero duration `box` uses, so a `transitionend`
|
|
249
|
+
still fires. */
|
|
250
|
+
@media (prefers-reduced-motion: reduce) {
|
|
251
|
+
transition-duration: 0.01ms;
|
|
252
|
+
}
|
|
161
253
|
}
|
|
162
254
|
|
|
163
|
-
|
|
164
|
-
.neobrutalism-solo:is(
|
|
255
|
+
.neobrutalism-solo:is(
|
|
165
256
|
button,
|
|
166
257
|
a[href],
|
|
167
258
|
[role="button"],
|
|
@@ -170,6 +261,8 @@
|
|
|
170
261
|
input[type="submit"],
|
|
171
262
|
input[type="reset"]
|
|
172
263
|
):active:not(:disabled, [aria-disabled="true"]) {
|
|
173
|
-
|
|
174
|
-
|
|
264
|
+
box-shadow:
|
|
265
|
+
0 0 0 0 var(--_solo-ink),
|
|
266
|
+
inset 0 0 0 100vmax var(--_solo-fill);
|
|
267
|
+
translate: var(--_solo-depth) var(--_solo-depth);
|
|
175
268
|
}
|
|
@@ -147,18 +147,46 @@
|
|
|
147
147
|
|
|
148
148
|
/* Solo: the same look painted onto the one element carrying the class, for an
|
|
149
149
|
element the package does not style. See docs/internal/model.md#solo-classes and
|
|
150
|
-
the note on `.glass-solo`:
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
the note on `.glass-solo`: it composes with the element's presentation,
|
|
151
|
+
intent, and elevation, and reads its material from its own knobs and
|
|
152
|
+
foundation tokens with literal fallbacks, never a shared material `--ui-*`
|
|
153
|
+
or `--elevation-color` token. Unlayered, and not for this package's own
|
|
154
|
+
components. */
|
|
153
155
|
.pixel-solo {
|
|
154
156
|
--_pixel-unit: var(--pixel-unit, 4px);
|
|
155
|
-
|
|
157
|
+
/* The composition, the same in every solo class; `registry.test.ts` holds
|
|
158
|
+
the copies together. See the note on `.glass-solo`. */
|
|
159
|
+
--_solo-intent-color: initial;
|
|
160
|
+
--_solo-intent-contrast: initial;
|
|
161
|
+
--_solo-intent-strong: initial;
|
|
162
|
+
--_solo-intent-border: initial;
|
|
163
|
+
--_solo-intent-fill-max: initial;
|
|
164
|
+
--_solo-color: var(--_solo-intent-color, var(--color-text, light-dark(oklch(14.5% 0 0), oklch(98.5% 0 0))));
|
|
165
|
+
--_solo-contrast: var(
|
|
166
|
+
--_solo-intent-contrast,
|
|
167
|
+
var(--color-text-contrast, light-dark(oklch(98.5% 0 0), oklch(14.5% 0 0)))
|
|
168
|
+
);
|
|
169
|
+
--_solo-strong: var(--_solo-intent-strong, var(--color-text-strong, light-dark(oklch(20.5% 0 0), oklch(97% 0 0))));
|
|
170
|
+
--_solo-capped: min(var(--ui-fill, 0%), var(--_solo-intent-fill-max, 20%));
|
|
171
|
+
--_solo-fill: color-mix(in oklab, var(--_solo-color) var(--_solo-capped), transparent);
|
|
172
|
+
--_solo-on-fill: min(var(--ui-fg-on-fill, 0%), max(0%, calc(var(--_solo-capped) * 2 - 100%)));
|
|
173
|
+
--_solo-fg: color-mix(in oklab, var(--_solo-contrast) var(--_solo-on-fill), var(--_solo-strong));
|
|
174
|
+
/* The line with no intent on the element: this aesthetic's own ink. */
|
|
175
|
+
--_solo-ink: var(
|
|
176
|
+
--_solo-intent-border,
|
|
177
|
+
light-dark(var(--color-neutral-950, oklch(14.5% 0 0)), var(--color-neutral-50, oklch(98.5% 0 0)))
|
|
178
|
+
);
|
|
179
|
+
/* The ring is the edge, and the fill is a layer under it rather than a plate
|
|
180
|
+
beneath a border, so the line fades to nothing instead of to the fill. */
|
|
181
|
+
--_solo-edge: color-mix(in oklab, var(--_solo-ink) var(--ui-border, 100%), transparent);
|
|
156
182
|
|
|
157
183
|
/* The clip removes a border at the straight sides, so the ring draws the
|
|
158
184
|
edge and the element's own border goes. */
|
|
159
185
|
border: 0;
|
|
160
186
|
border-radius: 0;
|
|
161
|
-
box-shadow:
|
|
187
|
+
box-shadow:
|
|
188
|
+
inset 0 0 0 var(--_pixel-unit) var(--_solo-edge),
|
|
189
|
+
inset 0 0 0 100vmax var(--_solo-fill);
|
|
162
190
|
clip-path: polygon(
|
|
163
191
|
0 var(--_pixel-unit),
|
|
164
192
|
var(--_pixel-unit) var(--_pixel-unit),
|
|
@@ -176,11 +204,68 @@
|
|
|
176
204
|
font-family: var(--font-pixel, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
177
205
|
}
|
|
178
206
|
|
|
207
|
+
/* An intent class on the element colours it, as on a component. Named rather
|
|
208
|
+
than read from `--intent-*` alone: those slots inherit, so a `.success`
|
|
209
|
+
container would colour a solo element where it leaves a component neutral. */
|
|
210
|
+
.pixel-solo:is(.primary, .secondary, .success, .warning, .destructive, .info) {
|
|
211
|
+
--_solo-intent-color: var(--intent-color);
|
|
212
|
+
--_solo-intent-contrast: var(--intent-contrast);
|
|
213
|
+
--_solo-intent-strong: var(--intent-strong);
|
|
214
|
+
--_solo-intent-border: var(--intent-border);
|
|
215
|
+
--_solo-intent-fill-max: var(--intent-fill-max);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* The text colour is written only where a fill or an intent is asked for, on
|
|
219
|
+
the element or by a container's fill class. Anywhere else the element keeps
|
|
220
|
+
its own: a dark toast keeps its light text. */
|
|
221
|
+
.pixel-solo:is(
|
|
222
|
+
.solid,
|
|
223
|
+
.soft,
|
|
224
|
+
.ghost,
|
|
225
|
+
.primary,
|
|
226
|
+
.secondary,
|
|
227
|
+
.success,
|
|
228
|
+
.warning,
|
|
229
|
+
.destructive,
|
|
230
|
+
.info,
|
|
231
|
+
:is(.solid, .soft, .ghost) *
|
|
232
|
+
) {
|
|
233
|
+
color: var(--_solo-fg);
|
|
234
|
+
}
|
|
235
|
+
|
|
179
236
|
/* The clip takes the focus outline too, so focus is a second inset layer under
|
|
180
|
-
the ring, wider than it so it shows -- shadows paint first-on-top.
|
|
237
|
+
the ring, wider than it so it shows -- shadows paint first-on-top. A line of
|
|
238
|
+
the page colour sits inside that one, as in `box`: the ring is the ink, and
|
|
239
|
+
on an element filled with the ink it would not show. */
|
|
181
240
|
.pixel-solo:focus-visible {
|
|
182
241
|
box-shadow:
|
|
183
|
-
inset 0 0 0 var(--_pixel-unit) var(--
|
|
242
|
+
inset 0 0 0 var(--_pixel-unit) var(--_solo-edge),
|
|
184
243
|
inset 0 0 0 calc(var(--_pixel-unit) + var(--focus-ring-width, 3px))
|
|
185
|
-
var(
|
|
244
|
+
var(
|
|
245
|
+
--focus-ring,
|
|
246
|
+
color-mix(
|
|
247
|
+
in srgb,
|
|
248
|
+
light-dark(var(--color-neutral-950, oklch(14.5% 0 0)), var(--color-neutral-50, oklch(98.5% 0 0))) 64%,
|
|
249
|
+
transparent
|
|
250
|
+
)
|
|
251
|
+
),
|
|
252
|
+
inset 0 0 0 calc(var(--_pixel-unit) + var(--focus-ring-width, 3px) + 2px)
|
|
253
|
+
var(--color-background, light-dark(oklch(98.5% 0 0), oklch(14.5% 0 0))),
|
|
254
|
+
inset 0 0 0 100vmax var(--_solo-fill);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* Forced colours remove every box shadow, and the ring is one: the element
|
|
258
|
+
would have no edge at all. An outline stands in for it, drawn inward so
|
|
259
|
+
nothing moves, and the clip goes so the focus outline can show. This
|
|
260
|
+
entrypoint may be the only package stylesheet loaded, so it says so itself. */
|
|
261
|
+
@media (forced-colors: active) {
|
|
262
|
+
.pixel-solo {
|
|
263
|
+
outline: var(--_pixel-unit) solid CanvasText;
|
|
264
|
+
outline-offset: calc(-1 * var(--_pixel-unit));
|
|
265
|
+
clip-path: none;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.pixel-solo:focus-visible {
|
|
269
|
+
outline-color: Highlight;
|
|
270
|
+
}
|
|
186
271
|
}
|