@codenhub/styles 0.5.0 → 0.6.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/README.md +7 -7
- 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 +1 -1
- package/dist/aesthetics/neobrutalism.css +1 -1
- package/dist/aesthetics/pixel.css +1 -1
- package/dist/aesthetics/sketch.css +1 -1
- package/dist/components.css +1 -1
- package/dist/index.css +1 -1
- package/dist/native.css +1 -1
- package/dist/palette.css +1 -1
- package/dist/theme.css +1 -1
- package/dist/tw/aesthetics/chunky-tile.css +39 -39
- package/dist/tw/aesthetics/cyber.css +16 -11
- package/dist/tw/aesthetics/glass.css +235 -10
- package/dist/tw/aesthetics/index.css +2 -1
- package/dist/tw/aesthetics/neobrutalism.css +23 -11
- package/dist/tw/aesthetics/pixel.css +18 -8
- package/dist/tw/aesthetics/sketch.css +14 -7
- package/dist/tw/box.css +49 -27
- package/dist/tw/components/button.css +35 -14
- package/dist/tw/components/feedback.css +59 -56
- package/dist/tw/components/form.css +200 -126
- package/dist/tw/components/index.css +3 -7
- package/dist/tw/components/loader.css +4 -5
- package/dist/tw/components/surface.css +71 -68
- package/dist/tw/components/tooltip.css +75 -41
- package/dist/tw/elevation.css +14 -22
- package/dist/tw/index.css +15 -19
- package/dist/tw/intent.css +31 -24
- package/dist/tw/native.css +15 -5
- package/dist/tw/palette.css +8 -5
- package/dist/tw/presentation.css +16 -30
- package/dist/tw/reset.css +21 -28
- package/dist/tw/surface.css +11 -12
- package/dist/tw/theme.css +58 -86
- package/dist/tw/utilities/content.css +268 -199
- package/dist/tw/utilities/layout.css +15 -25
- package/docs/accessibility.md +50 -33
- package/docs/changelog/0.6.0.md +52 -0
- package/docs/changelog/index.md +1 -0
- package/docs/concepts.md +6 -6
- package/docs/index.md +9 -0
- package/docs/integrating/nextjs.md +1 -1
- package/docs/integrating/tailwind.md +14 -6
- package/docs/setup.md +6 -6
- package/docs/usage/aesthetics.md +35 -8
- package/docs/usage/buttons.md +1 -1
- package/docs/usage/composing.md +1 -1
- package/docs/usage/content-and-layout.md +12 -11
- package/docs/usage/customizing.md +8 -9
- package/docs/usage/feedback.md +5 -3
- package/docs/usage/forms.md +51 -35
- package/docs/usage/theming.md +39 -40
- package/docs/usage/tooltips.md +37 -17
- package/llms-full.txt +331 -183
- package/llms.txt +6 -0
- package/package.json +5 -5
|
@@ -17,6 +17,18 @@
|
|
|
17
17
|
@apply box box-hover box-active relative inline-flex w-fit cursor-pointer items-center justify-center gap-2 px-4 py-2 whitespace-nowrap no-underline select-none;
|
|
18
18
|
|
|
19
19
|
min-height: var(--control-height);
|
|
20
|
+
/* The vertical padding gives back the line `box` draws, so a default button
|
|
21
|
+
is exactly `--control-height` tall like `.ipt` beside it, under any
|
|
22
|
+
aesthetic's line width. At the default 16px/1.5 text the label and the
|
|
23
|
+
padding fill it; the size and padding modifiers set their own. */
|
|
24
|
+
padding-block: calc(0.5rem - var(--_width));
|
|
25
|
+
/* The surrounding font, not the user agent's smaller button one, on every
|
|
26
|
+
entry: `/components` carries no reset to say so, and a `.btn` link and a
|
|
27
|
+
`.btn` button have to print the same label. `.sm` and `.lg` set their own
|
|
28
|
+
size over this. */
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
font-size: inherit;
|
|
31
|
+
line-height: inherit;
|
|
20
32
|
/* The label is material, shared with `.badge`: weight, tracking, case, and a
|
|
21
33
|
text shadow, set by an aesthetic as tokens (`.chunky-tile`'s heavier,
|
|
22
34
|
tracked label), and a consumer's own `font-*`, `tracking-*`, `uppercase`, or
|
|
@@ -50,20 +62,29 @@
|
|
|
50
62
|
min-width: var(--control-height);
|
|
51
63
|
}
|
|
52
64
|
|
|
53
|
-
/*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
/* The size steps for an icon button, square at each: `.sm`'s 2rem, with the
|
|
66
|
+
padding giving back the line width the way the default button's does, and
|
|
67
|
+
`.lg`'s 3rem. Each names its width as well as its height, because WebKit
|
|
68
|
+
does not let `aspect-ratio` widen a box past its `min-width`. */
|
|
69
|
+
&.icon.sm {
|
|
70
|
+
min-width: 2rem;
|
|
71
|
+
padding: calc(0.375rem - var(--_width));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.icon.lg {
|
|
75
|
+
min-width: 3rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Bare `sm`/`lg` are the size modifier's class names, so `p-` prefixes here.
|
|
79
|
+
`.p-xs` is the tightest step, below `.p-sm`: a chip-sized button in a
|
|
80
|
+
toolbar or a table cell.
|
|
81
|
+
|
|
82
|
+
`.icon` drops both floors -- `min-width` from its own base rule above and
|
|
83
|
+
`min-height` from `--control-height` -- at every padding tier; labeled
|
|
84
|
+
buttons keep the height floor everywhere but `.p-xs`. `.icon` is already
|
|
85
|
+
square: `aspect-square` ties its width to whatever height it lands on, so a
|
|
86
|
+
surviving height floor would keep the button bigger than its own glyph
|
|
87
|
+
however tight the padding asked to be. */
|
|
67
88
|
&.p-xs {
|
|
68
89
|
@apply px-2 py-0.5;
|
|
69
90
|
|
|
@@ -38,50 +38,45 @@
|
|
|
38
38
|
--_d-elevation: 0;
|
|
39
39
|
|
|
40
40
|
/* Same carve-out as `.panel`'s, and for the same reason: a neutral alert
|
|
41
|
-
mixes 12% of near-black ink onto the page
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
alert has no hover state to reveal a tint into either, so this is
|
|
56
|
-
permanent rather than revealed. Unlike a neutral panel or badge, an
|
|
57
|
-
alert cannot lose its visual identity from this: `--_d-border: 100%`
|
|
58
|
-
above holds regardless of fill, so a neutral alert still reads as a
|
|
59
|
-
framed box, just a quiet one instead of a grey slab. */
|
|
41
|
+
mixes 12% of near-black ink onto the page (`217, 217, 217` against `250,
|
|
42
|
+
250, 250`), a slab rather than a status signal. Scoped to no named intent:
|
|
43
|
+
a named intent keeps its ordinary wash, because untinting
|
|
44
|
+
`.alert.soft.destructive` would silence the status it exists to carry
|
|
45
|
+
rather than quiet it. `:not(...)` names every intent class, plus
|
|
46
|
+
`.solid`/`.ghost` so an explicit presentation on the element is never
|
|
47
|
+
clamped to a cap it did not ask for.
|
|
48
|
+
|
|
49
|
+
Grounds on `--color-foreground` through `--_d-surface-ground`, exactly like
|
|
50
|
+
`.panel` and a resting `.card.soft`, so glass's ground and a consumer's
|
|
51
|
+
`--ui-surface-ground` still win over it. An alert has no hover state to
|
|
52
|
+
reveal a tint into either, so this is permanent. A neutral alert keeps its
|
|
53
|
+
identity: `--_d-border: 100%` above holds regardless of fill, so it still
|
|
54
|
+
reads as a framed box, just a quiet one instead of a grey slab. */
|
|
60
55
|
&:not(.primary, .secondary, .success, .warning, .destructive, .info, .solid, .ghost) {
|
|
61
56
|
--_fill-cap: 0%;
|
|
62
57
|
--_d-surface-ground: var(--color-foreground);
|
|
63
58
|
}
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
/* No icon is shipped
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
whether one is present. Any icon element works, the same contract
|
|
73
|
-
`.input-group` documents -- an inline `<svg>`, an `<img>`, or a class from an
|
|
74
|
-
icon set such as `@codenhub/icons`. */
|
|
61
|
+
/* No icon is shipped. `.alert` is already `flex`, so an icon dropped in as a
|
|
62
|
+
real child is spaced by `gap-3`: `.alert-icon` only fixes its size and
|
|
63
|
+
alignment, not whether one is present. Any icon element works, the same
|
|
64
|
+
contract `.input-group` documents -- an inline `<svg>`, an `<img>`, or a
|
|
65
|
+
class from an icon set such as `@codenhub/icons`. See
|
|
66
|
+
`docs/internal/model.md#input-group-owns-the-box-the-control-inside-gives-it-up`. */
|
|
75
67
|
@utility alert-icon {
|
|
76
68
|
@apply inline-flex flex-none items-center justify-center;
|
|
77
69
|
|
|
78
|
-
/*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
/* A `@codenhub/icons` glyph sizes itself in an unlayered rule, which no
|
|
71
|
+
layered rule outranks whatever its specificity, but it reads its size from
|
|
72
|
+
`--ic-size`, so the size goes there as well as on the box for any other
|
|
73
|
+
icon. No `!important`: that would shut out the consumer's own resize too.
|
|
74
|
+
An icon set with another prefix, or one that sizes unlayered with no knob,
|
|
75
|
+
keeps its own size. */
|
|
76
|
+
--ic-size: 1.25rem;
|
|
77
|
+
|
|
78
|
+
width: 1.25rem;
|
|
79
|
+
height: 1.25rem;
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
/* A soft, edgeless chip. Small enough that the structural silhouette would be
|
|
@@ -111,10 +106,7 @@
|
|
|
111
106
|
|
|
112
107
|
/* An indicator reads intent and no presentation token at all. It is a stand-in
|
|
113
108
|
for content rather than a box with a look of its own, so there is nothing for
|
|
114
|
-
a container's `.solid` or `.edgeless` to say about it
|
|
115
|
-
removes the visibility floor that used to fight `--ui-fill` for control of the
|
|
116
|
-
base tone, and the transparent border that only ever appeared if something up
|
|
117
|
-
the tree asked for an edge. */
|
|
109
|
+
a container's `.solid` or `.edgeless` to say about it. */
|
|
118
110
|
@utility skeleton {
|
|
119
111
|
--skeleton-base: color-mix(in oklab, var(--intent-color) 6%, var(--intent-subtle));
|
|
120
112
|
--skeleton-sheen: color-mix(in oklab, var(--intent-color) 10%, var(--color-foreground));
|
|
@@ -133,6 +125,12 @@
|
|
|
133
125
|
calc(var(--_corner) * var(--ui-corner-br, 1)) calc(var(--_corner) * var(--ui-corner-bl, 1))
|
|
134
126
|
);
|
|
135
127
|
corner-shape: var(--ui-corner-shape, round);
|
|
128
|
+
|
|
129
|
+
/* Reduced motion stops the shimmer here, for the entries without the reset;
|
|
130
|
+
see `box.css`. The gradient stays, so the placeholder still reads. */
|
|
131
|
+
@media (prefers-reduced-motion: reduce) {
|
|
132
|
+
animation: none;
|
|
133
|
+
}
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
/* The track is a box, the fill is not: `box.css`'s formula composes the frame,
|
|
@@ -161,17 +159,16 @@
|
|
|
161
159
|
not `.pre`/`.code`/`.kbd`'s opaque `--intent-subtle` ground. */
|
|
162
160
|
--_progress-surface: color-mix(in oklab, var(--intent-color) var(--_progress-fill), transparent);
|
|
163
161
|
/* One `color-mix()`, not `box`/`.quote`'s two chained through a `--_line`
|
|
164
|
-
step: a WebKit build
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
is indistinguishable from blending through the surface first. */
|
|
162
|
+
step: a WebKit build destabilizes when composing dozens of tracks each
|
|
163
|
+
carrying a three-level color-mix chain into one page (fine at ten, a
|
|
164
|
+
~30-minute CI hang at forty; only chain depth reproduces it).
|
|
165
|
+
`box`/`.quote`'s extra step blends the line toward the fill first so a
|
|
166
|
+
heavily filled box does not draw a ring of a different colour around its
|
|
167
|
+
own plate -- a real risk up to `.solid`'s 100% fill. `.progress` never
|
|
168
|
+
reaches that: `.solid` is unsupported here (`registry.json`), so the fill
|
|
169
|
+
this reads never exceeds `.soft`'s 12%, and mixing straight from
|
|
170
|
+
`--intent-border` at that fill is indistinguishable from blending through
|
|
171
|
+
the surface first. */
|
|
175
172
|
--_progress-edge: color-mix(in oklab, var(--intent-border) var(--ui-border, var(--_d-border)), transparent);
|
|
176
173
|
|
|
177
174
|
@apply relative h-2.5 w-full overflow-hidden;
|
|
@@ -213,13 +210,19 @@
|
|
|
213
210
|
&.indeterminate::after {
|
|
214
211
|
width: 33%;
|
|
215
212
|
animation: anim-progress-indeterminate 1.5s infinite ease-in-out;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Reduced motion, for the entries without the reset; see `box.css`. The
|
|
216
|
+
value moves without sliding, and the shimmer and the indeterminate sweep
|
|
217
|
+
stop where the reset would stop them: the fill rests at the start. */
|
|
218
|
+
@media (prefers-reduced-motion: reduce) {
|
|
219
|
+
&::after {
|
|
220
|
+
transition-duration: 0.01ms;
|
|
221
|
+
}
|
|
220
222
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
&.active::before,
|
|
224
|
+
&.indeterminate::after {
|
|
225
|
+
animation: none;
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
228
|
}
|