@codenhub/styles 0.5.0 → 0.7.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 +61 -0
- package/README.md +27 -22
- package/README.pt-BR.md +61 -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/components.css +2 -2
- package/dist/index.css +2 -2
- package/dist/native.css +2 -2
- package/dist/palette.css +1 -1
- package/dist/theme.css +2 -2
- package/dist/tw/aesthetics/chunky-tile.css +120 -62
- package/dist/tw/aesthetics/cyber.css +102 -40
- package/dist/tw/aesthetics/glass.css +371 -19
- package/dist/tw/aesthetics/index.css +2 -1
- package/dist/tw/aesthetics/neobrutalism.css +121 -33
- package/dist/tw/aesthetics/pixel.css +111 -16
- package/dist/tw/aesthetics/sketch.css +100 -28
- package/dist/tw/box.css +69 -28
- package/dist/tw/components/button.css +35 -14
- package/dist/tw/components/feedback.css +61 -58
- package/dist/tw/components/form.css +255 -142
- package/dist/tw/components/index.css +4 -9
- package/dist/tw/components/surface.css +80 -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 +35 -27
- package/dist/tw/native.css +22 -12
- package/dist/tw/palette.css +14 -11
- package/dist/tw/presentation.css +16 -30
- package/dist/tw/reset.css +36 -43
- package/dist/tw/surface.css +11 -12
- package/dist/tw/theme.css +87 -103
- package/dist/tw/utilities/content.css +311 -200
- package/dist/tw/utilities/layout.css +41 -37
- package/docs/accessibility.md +104 -58
- 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 +53 -0
- package/docs/changelog/0.7.0.md +50 -0
- package/docs/changelog/index.md +2 -0
- package/docs/concepts.md +188 -46
- package/docs/es/accessibility.md +150 -0
- package/docs/es/concepts.md +212 -0
- package/docs/es/index.md +104 -0
- package/docs/es/integrating/astro.md +35 -0
- package/docs/es/integrating/index.md +47 -0
- package/docs/es/integrating/nextjs.md +67 -0
- package/docs/es/integrating/svelte.md +45 -0
- package/docs/es/integrating/tailwind.md +78 -0
- package/docs/es/integrating/vue.md +31 -0
- package/docs/es/integrating/without-a-bundler.md +115 -0
- package/docs/es/setup.md +180 -0
- package/docs/es/usage/aesthetics.md +276 -0
- package/docs/es/usage/buttons.md +131 -0
- package/docs/es/usage/composing.md +164 -0
- package/docs/es/usage/content-and-layout.md +215 -0
- package/docs/es/usage/customizing.md +298 -0
- package/docs/es/usage/feedback.md +153 -0
- package/docs/es/usage/forms.md +231 -0
- package/docs/es/usage/index.md +29 -0
- package/docs/es/usage/solo.md +84 -0
- package/docs/es/usage/theming.md +296 -0
- package/docs/es/usage/tooltips.md +127 -0
- package/docs/index.md +89 -21
- package/docs/integrating/astro.md +3 -4
- package/docs/integrating/index.md +18 -13
- package/docs/integrating/nextjs.md +4 -5
- package/docs/integrating/svelte.md +5 -4
- package/docs/integrating/tailwind.md +29 -8
- package/docs/integrating/vue.md +3 -4
- package/docs/integrating/without-a-bundler.md +114 -0
- package/docs/pt-BR/accessibility.md +150 -0
- package/docs/pt-BR/concepts.md +212 -0
- package/docs/pt-BR/index.md +104 -0
- package/docs/pt-BR/integrating/astro.md +35 -0
- package/docs/pt-BR/integrating/index.md +47 -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 +78 -0
- package/docs/pt-BR/integrating/vue.md +31 -0
- package/docs/pt-BR/integrating/without-a-bundler.md +115 -0
- package/docs/pt-BR/setup.md +180 -0
- package/docs/pt-BR/usage/aesthetics.md +276 -0
- package/docs/pt-BR/usage/buttons.md +131 -0
- package/docs/pt-BR/usage/composing.md +164 -0
- package/docs/pt-BR/usage/content-and-layout.md +215 -0
- package/docs/pt-BR/usage/customizing.md +298 -0
- package/docs/pt-BR/usage/feedback.md +153 -0
- package/docs/pt-BR/usage/forms.md +231 -0
- package/docs/pt-BR/usage/index.md +29 -0
- package/docs/pt-BR/usage/solo.md +84 -0
- package/docs/pt-BR/usage/theming.md +296 -0
- package/docs/pt-BR/usage/tooltips.md +127 -0
- package/docs/setup.md +134 -91
- package/docs/usage/aesthetics.md +102 -65
- package/docs/usage/buttons.md +108 -40
- package/docs/usage/composing.md +105 -92
- package/docs/usage/content-and-layout.md +159 -127
- package/docs/usage/customizing.md +112 -43
- package/docs/usage/feedback.md +135 -70
- package/docs/usage/forms.md +184 -99
- package/docs/usage/index.md +18 -14
- package/docs/usage/solo.md +83 -0
- package/docs/usage/theming.md +260 -119
- package/docs/usage/tooltips.md +103 -42
- package/llms-full.txt +2465 -1272
- package/llms.txt +25 -17
- package/package.json +28 -35
- package/dist/tw/components/loader.css +0 -117
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
/* The gap is a private each layout declares from `--layout-gap`, and the
|
|
2
|
+
density modifiers write the private. A container's `--layout-gap` still
|
|
3
|
+
reaches every layout inside it, because each one reads the token afresh; a
|
|
4
|
+
`.tight` or `.loose` stays on its own element, the way `.p-xs` stays on a
|
|
5
|
+
card, because the layout inside declares its own private over the one it
|
|
6
|
+
would inherit. */
|
|
1
7
|
@utility view {
|
|
2
|
-
@apply flex gap-(--
|
|
8
|
+
@apply flex gap-(--_gap);
|
|
9
|
+
|
|
10
|
+
--_gap: var(--layout-gap);
|
|
3
11
|
|
|
4
12
|
&.vertical {
|
|
5
13
|
@apply flex-col;
|
|
@@ -10,53 +18,59 @@
|
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
&.tight {
|
|
13
|
-
--
|
|
21
|
+
--_gap: 0.5rem;
|
|
14
22
|
}
|
|
15
23
|
|
|
16
24
|
&.loose {
|
|
17
|
-
--
|
|
25
|
+
--_gap: 1.5rem;
|
|
18
26
|
}
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
@utility stack {
|
|
22
|
-
@apply flex flex-col gap-(--
|
|
30
|
+
@apply flex flex-col gap-(--_gap);
|
|
31
|
+
|
|
32
|
+
--_gap: var(--layout-gap);
|
|
23
33
|
|
|
24
34
|
&.tight {
|
|
25
|
-
--
|
|
35
|
+
--_gap: 0.5rem;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
&.loose {
|
|
29
|
-
--
|
|
39
|
+
--_gap: 1.5rem;
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
@utility cluster {
|
|
34
|
-
@apply flex flex-wrap items-center gap-(--
|
|
44
|
+
@apply flex flex-wrap items-center gap-(--_gap);
|
|
45
|
+
|
|
46
|
+
--_gap: var(--layout-gap);
|
|
35
47
|
|
|
36
48
|
&.between {
|
|
37
49
|
@apply justify-between;
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
&.tight {
|
|
41
|
-
--
|
|
53
|
+
--_gap: 0.5rem;
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
&.loose {
|
|
45
|
-
--
|
|
57
|
+
--_gap: 1.5rem;
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
|
|
49
61
|
@utility auto-grid {
|
|
50
|
-
@apply grid gap-(--
|
|
62
|
+
@apply grid gap-(--_gap);
|
|
63
|
+
|
|
64
|
+
--_gap: var(--layout-gap);
|
|
51
65
|
|
|
52
66
|
grid-template-columns: repeat(auto-fit, minmax(min(var(--layout-grid-min), 100%), 1fr));
|
|
53
67
|
|
|
54
68
|
&.tight {
|
|
55
|
-
--
|
|
69
|
+
--_gap: 0.5rem;
|
|
56
70
|
}
|
|
57
71
|
|
|
58
72
|
&.loose {
|
|
59
|
-
--
|
|
73
|
+
--_gap: 1.5rem;
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
76
|
|
|
@@ -76,10 +90,10 @@
|
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
|
|
79
|
-
/* An indicator: intent only, and no presentation token at all. A rule is a
|
|
80
|
-
and neither a fill class nor an edge class has anything to say about
|
|
81
|
-
|
|
82
|
-
|
|
93
|
+
/* An indicator: intent only, and no presentation token at all. A rule is a
|
|
94
|
+
line, and neither a fill class nor an edge class has anything to say about
|
|
95
|
+
one -- a container's `.ghost.edgeless` must not make every `<hr>` inside it
|
|
96
|
+
invisible. The width is the aesthetic's line width, unscaled. */
|
|
83
97
|
@utility divider {
|
|
84
98
|
--divider-color: var(--intent-color);
|
|
85
99
|
--divider-width: var(--ui-border-width, var(--border-width));
|
|
@@ -106,27 +120,17 @@
|
|
|
106
120
|
}
|
|
107
121
|
}
|
|
108
122
|
|
|
109
|
-
/*
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
the one this package ate -- and `registry.test.ts`'s collision check exists
|
|
121
|
-
because of it (see `data-table`'s `renamedFrom` in `registry.json`). Naming
|
|
122
|
-
this `sr-only` would trip the same trap from the other direction: on a `/tw`
|
|
123
|
-
entry a real Tailwind build runs too, and two same-named utilities in the
|
|
124
|
-
same cascade is exactly the silent collision that test polices.
|
|
125
|
-
`.visually-hidden` says the same thing under a name nothing else claims,
|
|
126
|
-
using the standard clip-based recipe. `@source inline("visually-hidden")` in
|
|
127
|
-
`utilities/index.css` force-emits it on the entries with no scannable markup
|
|
128
|
-
of their own, the same mechanism that file's inline list already uses for
|
|
129
|
-
every layout and content utility name in it. */
|
|
123
|
+
/* `.visually-hidden`, the standard clip-based recipe. Tailwind's `sr-only` does
|
|
124
|
+
nothing on the vanilla entries (`.`, `/native`), which compile real CSS from
|
|
125
|
+
a scan of `src/` alone with no Tailwind utility layer to reach, so the
|
|
126
|
+
package publishes its own.
|
|
127
|
+
|
|
128
|
+
It is not named `.sr-only`: on a `/tw` entry the consumer's own Tailwind
|
|
129
|
+
build supplies that utility, and two same-named utilities in one cascade
|
|
130
|
+
collide silently -- the collision `registry.test.ts` polices (see
|
|
131
|
+
`data-table`'s `renamedFrom` in `registry.json`). `@source
|
|
132
|
+
inline("visually-hidden")` in `utilities/index.css` force-emits it on the
|
|
133
|
+
entries with no scannable markup of their own. */
|
|
130
134
|
@utility visually-hidden {
|
|
131
135
|
position: absolute;
|
|
132
136
|
width: 1px;
|
package/docs/accessibility.md
CHANGED
|
@@ -1,103 +1,149 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Accessibility
|
|
3
|
+
description: What the CSS does for focus, states, motion, contrast, forced colors, and right-to-left text, and what your application still owes its users.
|
|
3
4
|
order: 5
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# Accessibility
|
|
7
|
+
# Accessibility
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
The settings screen is built, and the CSS has done its part along the way: every field shows where focus is, an invalid email turns red, and the spinner stops for users who ask for less motion. The rest is up to your HTML and JavaScript. This package styles states; it does not provide semantic elements, ARIA attributes, keyboard behavior, focus management, validation, or the timing of announcements.
|
|
10
|
+
|
|
11
|
+
This page lists both halves: what the CSS provides, and what your application has to add.
|
|
9
12
|
|
|
10
13
|
## Provided by CSS
|
|
11
14
|
|
|
12
15
|
### Focus and state
|
|
13
16
|
|
|
14
|
-
| Feature | Behavior
|
|
15
|
-
| ------------------ |
|
|
16
|
-
| `:focus-visible` |
|
|
17
|
-
| Form control focus | `.ipt`, `.textarea`, and `.select` draw the
|
|
18
|
-
| Invalid controls | `
|
|
19
|
-
| Disabled controls | `
|
|
20
|
-
| Open state | `
|
|
21
|
-
| Native `<dialog>` |
|
|
17
|
+
| Feature | Behavior |
|
|
18
|
+
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `:focus-visible` | A focus outline on every element, drawn with `--focus-ring`, `--focus-ring-width`, and `--focus-ring-offset`. |
|
|
20
|
+
| Form control focus | `.ipt`, `.textarea`, and `.select` draw the focus outline and change their border to the intent color. Typed text in a field with an intent class is in the intent's readable tone, `--intent-strong`. |
|
|
21
|
+
| Invalid controls | `aria-invalid="true"` on a form control turns its border, focus color, and typed text destructive, the text in the destructive readable tone. |
|
|
22
|
+
| Disabled controls | `disabled`, `aria-disabled="true"`, `data-disabled`, and `.disabled` show the disabled cursor and opacity, and a disabled control does not react to hover, including inside an `.input-group`. |
|
|
23
|
+
| Open state | `data-state="open"` on a `.tooltip` shows its bubble without hover or focus, and `data-state="closed"` hides it while hovered or focused. No other component reads either. |
|
|
24
|
+
| Native `<dialog>` | A `<dialog>` with `.card`, `.panel`, or `.surface` stays hidden until it is opened, and opens centered. A margin you set on the dialog, as a utility or in your own CSS, still overrides the centering. Other dialogs are left alone. Trapping focus, closing on Escape, and making the page behind it inert are up to your application. |
|
|
22
25
|
|
|
23
26
|
### Visually hidden content
|
|
24
27
|
|
|
25
|
-
`.visually-hidden` hides content
|
|
28
|
+
`.visually-hidden` hides content on screen and keeps it for screen readers, as the API keys table's `<caption>` does in [Content and layout → Tables](./usage/content-and-layout.md#tables). It ships with the layout utilities: in `.`, `./native`, `./tw`, `./tw/native`, and `./tw/utilities`. It is not in `./components` or the `./tw/components` and `./tw/*` component entrypoints.
|
|
26
29
|
|
|
27
30
|
### Control boundaries
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
| `.
|
|
36
|
-
|
|
|
32
|
+
WCAG 1.4.11 asks that the boundary of a control you need to see to use it measures at least 3:1 against what is next to it.
|
|
33
|
+
|
|
34
|
+
| Feature | Behavior |
|
|
35
|
+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
36
|
+
| Text controls at rest | A text control's border rests lighter than its intent's full border, below 3:1 by choice, so hover and focus have a stronger tone to change to. |
|
|
37
|
+
| Toggles | `.checkbox`, `.radio`, and `.switch` draw their full border, because the border is the only thing that shows an unchecked box. A `.switch` with its own `.edgeless` is the exception, below. |
|
|
38
|
+
| `.edgeless` from a container | Ignored by every text control and toggle: a container cannot remove the border of a field or toggle inside it. |
|
|
39
|
+
| `.edgeless` on the control | `.ipt`, `.textarea`, `.select`, and `.switch` drop their border and no longer meet 1.4.11 at rest. `.switch.ghost` keeps its border even then, because with no fill and no border nothing would show the track. |
|
|
40
|
+
| `.checkbox`, `.radio` | Always draw their border, from a container or with their own `.edgeless`. `.edgeless` on them is not supported. |
|
|
41
|
+
| Progress track | By choice, the filled part carries the value and the track is a quiet background. The default track, `.soft.edgeless`, measures about 1.1:1 to 1.3:1 against the page. The filled part measures at least 3:1 against that track for every intent except warning in light (about 2.7:1) and info in dark (about 2.9:1). Where the track itself must meet 1.4.11, use `.ghost.edged` with an intent class; see [Progress outlines](#progress-outlines) below. |
|
|
42
|
+
|
|
43
|
+
### Progress outlines
|
|
44
|
+
|
|
45
|
+
On a `.progress.ghost.edged`, the track is the page, and its outline and the filled part are both drawn in the intent's color. Measured against the page, with no aesthetic:
|
|
46
|
+
|
|
47
|
+
| Intent | Light page | Dark page | Meets 3:1 |
|
|
48
|
+
| -------------- | ---------- | --------- | ------------------------------------------------------------------------ |
|
|
49
|
+
| `.primary` | 18.96:1 | 18.96:1 | Yes |
|
|
50
|
+
| `.secondary` | 7.47:1 | 7.63:1 | Yes |
|
|
51
|
+
| `.success` | 5.14:1 | 3.69:1 | Yes |
|
|
52
|
+
| `.warning` | 3.06:1 | 6.20:1 | Yes |
|
|
53
|
+
| `.destructive` | 5.80:1 | 3.27:1 | Yes |
|
|
54
|
+
| `.info` | 6.17:1 | 3.07:1 | Yes |
|
|
55
|
+
| No intent | 2.48:1 | 1.91:1 | No: the outline fails, though the filled part, in the text color, passes |
|
|
56
|
+
|
|
57
|
+
With no intent class, the outline is the quiet border gray, `--color-border`. To make a neutral track meet 1.4.11, give the bar an intent class, or set `--progress-edge` to a stronger color, such as `var(--color-accent)`, which measures 7.47:1 on a light page and 7.63:1 on a dark one. Warning on a light page and info on a dark one clear 3:1 by a small margin, so measure again if you change those colors.
|
|
37
58
|
|
|
38
59
|
### Motion and transparency
|
|
39
60
|
|
|
40
|
-
| Feature
|
|
41
|
-
|
|
|
42
|
-
| Reduced
|
|
43
|
-
| Reduced
|
|
44
|
-
| Reduced transparency
|
|
61
|
+
| Feature | Behavior |
|
|
62
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| Reduced motion, components | With `prefers-reduced-motion: reduce`, every component stops its own transitions and animations: the skeleton and progress shimmer, the indeterminate bar, the tooltip, the toggle marks, and the press. |
|
|
64
|
+
| Reduced motion, whole page | The reset also shortens every other animation and transition on the page. |
|
|
65
|
+
| Reduced transparency | With `prefers-reduced-transparency: reduce`, `.glass` and `.glass-liquid` drop their blur and lens and become opaque. |
|
|
66
|
+
|
|
67
|
+
Each component's reduced-motion rule ships with the component, so every entrypoint that includes it respects reduced motion without the reset, including `@codenhub/styles/components`, `@codenhub/styles/tw/components`, and each `/tw/*` component entrypoint. The complete and native entrypoints add the reset's page-wide rule.
|
|
45
68
|
|
|
46
|
-
The
|
|
69
|
+
The reset's rule is `!important` inside the `base` layer, and a layered `!important` beats an unlayered one, so your own `!important` cannot turn an animation back on. To keep one running for users who ask for reduced motion, such as an upload spinner you consider essential, declare it `!important` in a layer ordered before `base`. The first `@layer` statement the browser reads sets the order, so yours goes before the package:
|
|
70
|
+
|
|
71
|
+
```css
|
|
72
|
+
@layer essential-motion, theme, base, components, utilities;
|
|
73
|
+
@import "@codenhub/styles";
|
|
74
|
+
|
|
75
|
+
@layer essential-motion {
|
|
76
|
+
@media (prefers-reduced-motion: reduce) {
|
|
77
|
+
.upload-spinner {
|
|
78
|
+
animation-duration: 1s !important;
|
|
79
|
+
animation-iteration-count: infinite !important;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Respecting reduced motion is not the whole requirement. Motion that keeps going next to content, such as a shimmer left on a card after it has loaded, needs a way to stop it for every user; see [Feedback → Animation that keeps running](./usage/feedback.md#animation-that-keeps-running).
|
|
47
86
|
|
|
48
87
|
### Color and contrast
|
|
49
88
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
89
|
+
The measurements below are for the shipped colors. Once you change a color token, measure your own pairs again; [Theming → Change the brand color](./usage/theming.md#change-the-brand-color) shows which pairs to check.
|
|
90
|
+
|
|
91
|
+
| Feature | Behavior |
|
|
92
|
+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
93
|
+
| Filled labels | Every intent's `.solid` label meets 4.5:1 (WCAG 1.4.3) as normal text, in both themes. The lowest is success, at 5.14:1. |
|
|
94
|
+
| Warning text | `--color-warning-contrast` is near-black, not the page color, because an amber dark enough to carry white text no longer looks amber. |
|
|
95
|
+
| Partial fills | The contrast text color appears only on fills above half strength, so a text control's capped fill keeps the intent's own text color. |
|
|
96
|
+
| Intent color in dark | In dark mode a `.soft` or `.ghost` label uses the `-300` shade of its intent, so it keeps its hue instead of turning white. |
|
|
97
|
+
| Toggle marks | A checked mark measures at least 3:1 against every fill its presentation can give it, in both themes. |
|
|
98
|
+
| Soft fills with borders | `.edged` on a `.soft` `.alert`, `.panel`, `.badge`, `.kbd`, `.code`, or `.pre` draws a border that measures below 3:1 against the 12% fill for some intents, which ones depending on the theme. Measure the pair before relying on that border as a control's boundary. |
|
|
58
99
|
|
|
59
100
|
### Forced colors and direction
|
|
60
101
|
|
|
61
|
-
| Feature | Behavior
|
|
62
|
-
| -------------- |
|
|
63
|
-
| Forced colors | `forced-colors: active
|
|
64
|
-
| Text direction |
|
|
102
|
+
| Feature | Behavior |
|
|
103
|
+
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
104
|
+
| Forced colors | With `forced-colors: active`, borders, checked states, and a `.select`'s chevron stay visible, drawn in system colors, under every aesthetic. An aesthetic that draws its border as an inner shadow, such as `.pixel`, draws a real border instead. |
|
|
105
|
+
| Text direction | Under `dir="rtl"`, the quote bar, the alert icon, the progress fill, the vertical divider, the switch knob, table alignment, and a select's chevron all switch sides. No class is needed. |
|
|
65
106
|
|
|
66
|
-
In forced colors,
|
|
107
|
+
In forced colors, `.text-control`, `.ipt`, `.textarea`, `.select`, and the toggles show a 2px `Highlight` focus outline. The native entrypoint gives unclassed text inputs, selects, textareas, checkboxes, and radios the same outline.
|
|
67
108
|
|
|
68
|
-
|
|
109
|
+
Checkboxes, radios, and switches use the system colors `Canvas`, `CanvasText`, `Highlight`, and `HighlightText`, so checked and unchecked stay distinct: a checked toggle is filled with `Highlight` and its mark is `HighlightText`, on the classes and in the native entrypoint alike. Shape, size, and spacing do not change.
|
|
69
110
|
|
|
70
111
|
## Required outside CSS
|
|
71
112
|
|
|
72
|
-
Use
|
|
113
|
+
Use the HTML element that matches what the component does, and add the behavior the CSS cannot.
|
|
73
114
|
|
|
74
|
-
| UI
|
|
75
|
-
|
|
|
76
|
-
| Buttons
|
|
77
|
-
| Forms
|
|
78
|
-
| Alerts
|
|
79
|
-
| Toasts
|
|
80
|
-
| Tooltips
|
|
81
|
-
| Progress
|
|
82
|
-
| Skeletons
|
|
83
|
-
|
|
|
115
|
+
| UI | What your application adds |
|
|
116
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
117
|
+
| Buttons | `<button>` for actions and `<a href>` for navigation. An accessible name, such as `aria-label`, on every `.btn.icon`. |
|
|
118
|
+
| Forms | A `<label>` for each control, the right `type`, validation, and `aria-describedby` linking hints and errors. Keep hints and errors outside the `<label>`, and give a `.switch` `role="switch"`. |
|
|
119
|
+
| Alerts | `role="status"` for a confirmation such as "Profile saved", or `role="alert"` for an error that needs attention now. |
|
|
120
|
+
| Toasts | A live region, a way to dismiss it, focus rules, and a pause on any timeout. |
|
|
121
|
+
| Tooltips | A real `id` and `role="tooltip"` on the bubble, referenced from the trigger's `aria-describedby`. Dismissal on Escape by writing `data-state="closed"`; see [Tooltips](./usage/tooltips.md#hover-linger-and-escape). The bubble can already be hovered. |
|
|
122
|
+
| Progress | A `<progress>` element, or `role="progressbar"` or `role="meter"` with ARIA values, when the value must be announced. |
|
|
123
|
+
| Skeletons | `aria-hidden="true"` on loading visuals, including a spinner you bring, and the loading state announced some other way when needed. |
|
|
124
|
+
| Ongoing motion | A way to pause, stop, or hide motion that is not essential; see [Feedback → Animation that keeps running](./usage/feedback.md#animation-that-keeps-running). |
|
|
125
|
+
| Popovers, modals | Focus trapping, closing on Escape, an inert background, labels, and roles. |
|
|
84
126
|
|
|
85
|
-
## State
|
|
127
|
+
## State attributes
|
|
86
128
|
|
|
87
|
-
Prefer native attributes
|
|
129
|
+
Prefer native attributes:
|
|
88
130
|
|
|
89
131
|
```html
|
|
90
|
-
<button class="btn primary" disabled>Saving
|
|
132
|
+
<button class="btn primary" disabled>Saving…</button> <input class="ipt" type="email" aria-invalid="true" aria-describedby="email-error" />
|
|
91
133
|
```
|
|
92
134
|
|
|
93
|
-
Use ARIA or data attributes
|
|
135
|
+
Use ARIA or data attributes where the element or your component library has no native one:
|
|
94
136
|
|
|
95
137
|
```html
|
|
96
|
-
<a class="btn secondary" aria-disabled="true">
|
|
138
|
+
<a class="btn secondary" aria-disabled="true">Export data</a>
|
|
97
139
|
<span class="tooltip" data-state="open">
|
|
98
|
-
<
|
|
99
|
-
<span class="tooltip-bubble" role="tooltip" id="
|
|
140
|
+
<button type="button" class="tooltip-icon" aria-label="About public profiles" aria-describedby="public-profile-help">?</button>
|
|
141
|
+
<span class="tooltip-bubble" role="tooltip" id="public-profile-help">Anyone with the link can see your name and photo.</span>
|
|
100
142
|
</span>
|
|
101
143
|
```
|
|
102
144
|
|
|
103
|
-
`aria-disabled="true"`
|
|
145
|
+
`aria-disabled="true"` tells assistive technology the control is disabled, but it does not stop a click or a key press. Use the `disabled` attribute, or stop the action in JavaScript.
|
|
146
|
+
|
|
147
|
+
## Next
|
|
148
|
+
|
|
149
|
+
That completes the reading path. The [Introduction](./index.md) links every page, and [Composing](./usage/composing.md), [Customizing](./usage/customizing.md), and [Content and layout](./usage/content-and-layout.md) are the lookup pages for later.
|
package/docs/changelog/0.1.1.md
CHANGED
package/docs/changelog/0.2.0.md
CHANGED
package/docs/changelog/0.3.0.md
CHANGED
package/docs/changelog/0.4.0.md
CHANGED
package/docs/changelog/0.5.0.md
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 0.5.0
|
|
3
|
+
date: 2026-09-27
|
|
4
|
+
description: Named cascade layers, corners that scale with size, the sketch aesthetic, and new material tokens. Breaks several 0.4.0 names and defaults, each listed under Changed and Removed.
|
|
3
5
|
---
|
|
4
6
|
|
|
5
7
|
# 0.5.0
|
|
6
8
|
|
|
7
|
-
A foundation update with an opt-in sketch aesthetic and rounded sketch variant.
|
|
9
|
+
A foundation update with an opt-in sketch aesthetic and rounded sketch variant. Everything under [Changed](#changed) and [Removed](#removed) breaks against `0.4.0`.
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Changed
|
|
10
12
|
|
|
11
13
|
- **The package sits in named cascade layers.** Every entrypoint declares Tailwind's layer order first and places everything in it: foundation tokens and the palette in `theme`, resets in `base`, the intent, presentation, elevation, and aesthetic classes in `components`, and every component in `utilities` -- including on `/components` and `/native`, which emitted them unlayered. Your own utility or unlayered CSS now beats all four class families on the same element, and an aesthetic on `<html>` keeps its tokens over the theme's in any load order. CSS that relied on a package class beating it now loses to it, and a rule of yours in `@layer components` contests the class families by specificity instead of losing outright. See [Setup](../setup.md).
|
|
12
14
|
- **Aesthetics set `--ui-corner`, not `--ui-radius`.** The corner is now a length at the default size that scales with the element (below); `--ui-radius` and `--ui-radius-surface` take a complete radius used as written, and every shipped aesthetic sets `--ui-corner` and `--ui-corner-surface` instead. If you set `--ui-radius` yourself, nothing changes for you. An aesthetic of your own moves to `--ui-corner` to get the scale and the corner pattern. `--ui-radius-pill` and `--ui-radius-tight` fall back through `--ui-radius`, then `--ui-corner`.
|
|
13
15
|
- **`--ui-button-weight` and `--ui-button-tracking` are `--ui-label-weight` and `--ui-label-tracking`**, read by `.badge` as well as `.btn`. The old names are removed without an alias. Under `.chunky-tile`, badges now take the heavier label too.
|
|
14
16
|
- **Explicit chip radii are no longer capped.** Checkbox, `.kbd`, and `.code` keep a small default radius when `--ui-radius-tight` is unset, but a supplied value now applies as a complete `border-radius`, including elliptical shapes. A consumer setting a large value now gets the large corner it asked for instead of the previous `--radius-small` ceiling.
|
|
15
|
-
- **Alias classes removed**, each a second name for a class that already had one: `.dense`, `.compact`, and `.spacious` (use `.p-xs`, `.p-sm`, and `.p-lg`); `.danger` and `.error` (use `.destructive`, and `.hint.destructive` for `.hint.error`); and `.elevation-none`, `.elevation-sm`, and `.elevation-md` (use `.flat`, `.raised`, and `.floating`). `.theme-light` and `.theme-dark` stay.
|
|
16
17
|
- **`.cyber` glows everything, flat or not.** Its glow moved from depth onto the new halo, so fields, chips, badges, and alerts glow too, `.flat` no longer puts the glow out, and `.raised` and `.floating` add no shadow under it.
|
|
17
18
|
|
|
19
|
+
## Removed
|
|
20
|
+
|
|
21
|
+
- **Alias classes removed**, each a second name for a class that already had one: `.dense`, `.compact`, and `.spacious` (use `.p-xs`, `.p-sm`, and `.p-lg`); `.danger` and `.error` (use `.destructive`, and `.hint.destructive` for `.hint.error`); and `.elevation-none`, `.elevation-sm`, and `.elevation-md` (use `.flat`, `.raised`, and `.floating`). `.theme-light` and `.theme-dark` stay.
|
|
22
|
+
|
|
18
23
|
## Added
|
|
19
24
|
|
|
20
25
|
- **`.sketch`, `.sketch-rounded`, and `.sketch-solo`**: a hand-drawn treatment with uneven elliptical corners, a solid ink line (dashed checkboxes and rules under `.sketch`), a small offset shadow, and an optional consumer-supplied handwriting font. Sibling components rotate between four stable outlines; pill buttons take organic hand-drawn rounded pill contours without oval distortion; switch tracks, knobs, and chips take compact irregular box outlines, and radios stay subtly circular. The opt-in `.sketch-rounded` modifier class provides subtle, organic hand-drawn rounded contours across controls, surfaces, chips, and solo elements with 4-step sibling rotation and no egg-shaped distortion on wide elements. The solo class paints an unstyled element directly; the cascading class restyles package components. Both ship in the aesthetic aggregate and dedicated compiled and Tailwind CSS entrypoints. See [Aesthetics](../usage/aesthetics.md#sketch).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 0.6.0
|
|
3
|
+
date: 2026-09-29
|
|
4
|
+
description: Liquid glass, hoverable tooltips, native field decorations, indeterminate checkboxes and list-box selects, and a round of fixes on every entrypoint.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.6.0
|
|
8
|
+
|
|
9
|
+
A liquid-glass modifier, glass that keeps every presentation's fill whole, hoverable tooltips, native field decorations with an `.unadorned` opt-out, indeterminate checkboxes and list-box selects, and a round of fixes to tables, controls, the focus ring, right-to-left layout, and reduced motion on every entrypoint.
|
|
10
|
+
|
|
11
|
+
## Added
|
|
12
|
+
|
|
13
|
+
- **`.glass-liquid`**, a modifier of `.glass`: continuous corners, a bright rim, a lighter blur, a clearer ground, and a lens that bends what is behind a surface at its edges (Chromium today; Firefox and Safari keep the rim, blur, and ground). Put it beside `.glass` on the region, or on one surface inside a glass region; `.glass-solo.glass-liquid` paints the same pane on an element the package does not style. Without `.glass` in scope it changes the corners and nothing else. See [Aesthetics → Liquid glass](../usage/aesthetics.md#liquid-glass).
|
|
14
|
+
- **`.unadorned`** removes the browser's own field decorations -- the date picker button, number spin buttons, and search clear button and magnifier -- on a control or on its `.input-group`, for a field whose adornments you draw yourself. See [Forms → Browser decorations](../usage/forms.md#browser-decorations).
|
|
15
|
+
- **`[data-state="closed"]` on `.tooltip`** hides the bubble while it is hovered or focused, for an Escape handler, and **`--tooltip-linger`** (300ms) sets how long a bubble stays after the pointer leaves its trigger. See [Tooltips](../usage/tooltips.md).
|
|
16
|
+
- **An indeterminate `.checkbox`** (and a native one under `/native`) draws the checked plate with a dash for its mark, and a Highlight plate in forced colors. See [Forms → Toggles](../usage/forms.md#toggles).
|
|
17
|
+
- **A multi-row `.select`** -- `multiple`, or a `size` above 1 -- draws as a list box: no chevron, as tall as its rows, with the chevron's room given back. It used to keep the chevron and a one-row height.
|
|
18
|
+
- **`--ui-rule-ink`**, the neutral line color of a table's frame and rules, read ahead of `--ui-ink`. Glass sets it so a table's lines read on its plate; every other aesthetic clears it.
|
|
19
|
+
|
|
20
|
+
## Changed
|
|
21
|
+
|
|
22
|
+
- **Glass no longer thins fills.** It stopped setting `--ui-bg-alpha: 0.8`, so a `.solid` button, a checked toggle, and a `.solid` card are opaque under glass like everywhere else. Translucency comes from the surface ground alone. Glass buttons also take the base `scale(0.97)` press (it was `none`).
|
|
23
|
+
- **A neutral `.solid` rests on the page background.** Its capped 20% fill was painted over nothing and showed whatever was behind it; it is now an opaque grey. The generated `--palette-neutral-solid-bg` and `-bg-hover` values changed to match, in both themes.
|
|
24
|
+
- **Tables frost under glass and keep their lines.** A default or `.soft` `.data-table` blurs like a surface, its frame and rules read `--ui-rule-ink`, and a bare `<table>` under `/native` reads it too.
|
|
25
|
+
- **A table takes the surface corner and is never clipped.** The four corner cells round instead of an `overflow` clip, so a `<caption>` is untouched in every engine; a cell spanning rows into a bottom corner leaves that corner square. `.table-wrap` makes room for an aesthetic's halo (cyber's glow) inside its scroll box, so put the aesthetic class on the wrapper or an ancestor.
|
|
26
|
+
- **Table rules draw at the aesthetic's line width**, uncapped, so `.chunky-tile`'s 2px frame no longer sits over a 1px row rule and `.pixel` draws them at all.
|
|
27
|
+
- **The focus ring is pulled in by the focused element's line width.** `--focus-ring-offset` is no longer declared at `:root`; its default is computed on the element, so it lands on the edge under every aesthetic. Setting `--focus-ring-offset` yourself still wins, but reading `var(--focus-ring-offset)` in your own CSS now needs a fallback.
|
|
28
|
+
- **Ink aesthetics draw controls in the control border.** Under `.neobrutalism`, `.pixel`, `.cyber`, and `.sketch`, a resting neutral field or toggle uses `--color-control-border` instead of the near-primary ink. A bare native checkbox or radio under `/native` takes the control ink too, and a `.neutral` field under glass takes it like an unclassed one.
|
|
29
|
+
- **Text controls keep the browser's own decorations.** The date picker button, number spin buttons, and search clear button were hidden on every text control, which also removed what they do. They are back by default; add `.unadorned` to remove them.
|
|
30
|
+
- **Buttons and fields take the surrounding font on every entrypoint.** `<button>` under `/native`, and every `.btn` and text control under `/components`, used the user agent's smaller control font (13.33px), so the same label printed at three sizes across elements and entrypoints. They inherit the page's font now, as they already did on `.`.
|
|
31
|
+
- **A default `.btn` is `--control-height` tall**, 40px, the same as `.ipt` beside it; it was 42px, and 44px under a 2px aesthetic line. Its vertical padding gives back the line width.
|
|
32
|
+
- **`/tw` keeps Tailwind's `2xl` breakpoint.** It redefined `--breakpoint-2xl` as 90rem, which moved every `2xl:` utility in a consumer's own Tailwind build from 96rem. `--breakpoint-xs` (30rem) is still added. Nothing in the package used the override, so the compiled entrypoints are unchanged.
|
|
33
|
+
- **Components honour reduced motion and fix `<dialog>` on every entrypoint.** `/components` and the focused `/tw/*` entries carry no reset, so the skeleton and progress shimmer, the indeterminate sweep, and the tooltip, toggle, and press transitions kept moving under `prefers-reduced-motion: reduce`, and a `<dialog class="card">` rendered open on load. Each component now stops its own motion, and the `<dialog>` fix ships beside `.card`. The fix now reaches only a dialog carrying `.card`, `.panel`, or `.surface`, so a dialog the package does not style keeps its own margin.
|
|
34
|
+
- **A tooltip bubble is hoverable.** It lingers for `--tooltip-linger` after the pointer leaves the trigger and stays open while the pointer is over it, as WCAG 1.4.13 asks; it used to vanish on the way. A closed bubble is `visibility: hidden` rather than only transparent, so a bubble no `aria-describedby` points at is no longer read in place while closed.
|
|
35
|
+
- **`.alert-icon` sizes without `!important`.** It set its 1.25rem size `!important`, which no consumer rule could override. It sets `--ic-size` for `@codenhub/icons` glyphs and a plain size for any other icon now, so your own rule resizes it. An icon set that sizes itself in an unlayered rule under another knob keeps its own size.
|
|
36
|
+
- **The Tailwind CSS peer range is `>=4.3.2 <5`.** It claimed `>=4.0.0`, but the `/tw` source needs `@source not` and `@source inline()` (Tailwind 4.1) and is tested against 4.3.2. The peer is still optional, and only `/tw` needs it.
|
|
37
|
+
- **Browser floor is Firefox 128.** Non-inheriting elevation relies on `@property`; the documented floor was Firefox 121.
|
|
38
|
+
|
|
39
|
+
## Fixed
|
|
40
|
+
|
|
41
|
+
- **A switch's knob sits inside `.pixel`'s inset ring** instead of covering it, so an unchecked and a checked switch no longer read as two halves.
|
|
42
|
+
- **The sketch solo shadow is cast in the depth colour** rather than full ink.
|
|
43
|
+
- **No stray `.contents` rule.** The compiled `.`, `/native`, and `/components` stylesheets shipped Tailwind's `.contents{display:contents}`, picked up from the license text; the build no longer scans the package's root files.
|
|
44
|
+
- **Links under `/native` keep the size of their text.** `a` was mapped to body copy, so a link inside a heading printed at 14px and regular weight.
|
|
45
|
+
- **The Tailwind guide no longer imports Tailwind twice.** `/tw` imports Tailwind itself, so it replaces your own `@import "tailwindcss"`; with both, an unminified build carried two copies of Preflight. The focused `/tw/*` entrypoints and `/tw/native` still expect your import first.
|
|
46
|
+
- **`.tooltip-icon` keeps its size on a `<button>`.** The docs now use a real `<button type="button">` as the trigger, since `aria-label` on a role-less `<span>` is not reliably announced; the chip resets the padding and minimum size a button brings under `/native` and `/components`. The docs also no longer call it circular under every aesthetic: it is square under `.neobrutalism` and `.pixel`.
|
|
47
|
+
- **A wrapped `.hint` has room between its lines.** Its line height equalled its 14px size, so wrapped lines touched; it takes `text-sm`'s 20px leading now.
|
|
48
|
+
- **`/palette` follows a light subtree nested in a dark one.** Its light values sat on `:root` alone, so a `.light` region inside `.dark` kept the dark values. They answer the explicit light selectors too now.
|
|
49
|
+
- **An unchecked switch's knob is `CanvasText` in forced colors.** The switch opts out of forced colors to keep its states apart, and its unchecked knob kept the package grey on the system `Canvas`.
|
|
50
|
+
- **A select's chevron mirrors under `dir="rtl"`.** It and the padding kept for it stayed on the right, so a right-to-left value started beside the chevron.
|
|
51
|
+
- **`.btn.icon` follows the size step.** `.sm` left an icon button at the default 40px, and under WebKit a `.lg` one was 40px wide and 48px tall. They are square at 32px and 48px now.
|
|
52
|
+
- **Tables align to the inline start.** `.data-table` cells and its caption used `text-left`, so a right-to-left table stayed left-aligned.
|
|
53
|
+
- **A region of one aesthetic nested inside another keeps its own material.** Every aesthetic now restates the depth colour and clears the focus inset, hover transform, and shadow tokens it does not use, so glass inside `.chunky-tile` no longer casts a black slab under every card, glass inside `.cyber` casts its shadow again, and a region inside `.pixel` no longer inherits pixel's inset focus layer.
|