@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.
Files changed (119) hide show
  1. package/NOTICE +18 -16
  2. package/README.es.md +61 -0
  3. package/README.md +27 -22
  4. package/README.pt-BR.md +61 -0
  5. package/dist/aesthetics/chunky-tile.css +1 -1
  6. package/dist/aesthetics/cyber.css +1 -1
  7. package/dist/aesthetics/glass.css +1 -1
  8. package/dist/aesthetics/index.css +2 -2
  9. package/dist/aesthetics/neobrutalism.css +1 -1
  10. package/dist/aesthetics/pixel.css +1 -1
  11. package/dist/aesthetics/sketch.css +1 -1
  12. package/dist/components.css +2 -2
  13. package/dist/index.css +2 -2
  14. package/dist/native.css +2 -2
  15. package/dist/palette.css +1 -1
  16. package/dist/theme.css +2 -2
  17. package/dist/tw/aesthetics/chunky-tile.css +120 -62
  18. package/dist/tw/aesthetics/cyber.css +102 -40
  19. package/dist/tw/aesthetics/glass.css +371 -19
  20. package/dist/tw/aesthetics/index.css +2 -1
  21. package/dist/tw/aesthetics/neobrutalism.css +121 -33
  22. package/dist/tw/aesthetics/pixel.css +111 -16
  23. package/dist/tw/aesthetics/sketch.css +100 -28
  24. package/dist/tw/box.css +69 -28
  25. package/dist/tw/components/button.css +35 -14
  26. package/dist/tw/components/feedback.css +61 -58
  27. package/dist/tw/components/form.css +255 -142
  28. package/dist/tw/components/index.css +4 -9
  29. package/dist/tw/components/surface.css +80 -68
  30. package/dist/tw/components/tooltip.css +75 -41
  31. package/dist/tw/elevation.css +14 -22
  32. package/dist/tw/index.css +15 -19
  33. package/dist/tw/intent.css +35 -27
  34. package/dist/tw/native.css +22 -12
  35. package/dist/tw/palette.css +14 -11
  36. package/dist/tw/presentation.css +16 -30
  37. package/dist/tw/reset.css +36 -43
  38. package/dist/tw/surface.css +11 -12
  39. package/dist/tw/theme.css +87 -103
  40. package/dist/tw/utilities/content.css +311 -200
  41. package/dist/tw/utilities/layout.css +41 -37
  42. package/docs/accessibility.md +104 -58
  43. package/docs/changelog/0.1.1.md +1 -0
  44. package/docs/changelog/0.2.0.md +1 -0
  45. package/docs/changelog/0.3.0.md +1 -0
  46. package/docs/changelog/0.4.0.md +1 -0
  47. package/docs/changelog/0.5.0.md +8 -3
  48. package/docs/changelog/0.6.0.md +53 -0
  49. package/docs/changelog/0.7.0.md +50 -0
  50. package/docs/changelog/index.md +2 -0
  51. package/docs/concepts.md +188 -46
  52. package/docs/es/accessibility.md +150 -0
  53. package/docs/es/concepts.md +212 -0
  54. package/docs/es/index.md +104 -0
  55. package/docs/es/integrating/astro.md +35 -0
  56. package/docs/es/integrating/index.md +47 -0
  57. package/docs/es/integrating/nextjs.md +67 -0
  58. package/docs/es/integrating/svelte.md +45 -0
  59. package/docs/es/integrating/tailwind.md +78 -0
  60. package/docs/es/integrating/vue.md +31 -0
  61. package/docs/es/integrating/without-a-bundler.md +115 -0
  62. package/docs/es/setup.md +180 -0
  63. package/docs/es/usage/aesthetics.md +276 -0
  64. package/docs/es/usage/buttons.md +131 -0
  65. package/docs/es/usage/composing.md +164 -0
  66. package/docs/es/usage/content-and-layout.md +215 -0
  67. package/docs/es/usage/customizing.md +298 -0
  68. package/docs/es/usage/feedback.md +153 -0
  69. package/docs/es/usage/forms.md +231 -0
  70. package/docs/es/usage/index.md +29 -0
  71. package/docs/es/usage/solo.md +84 -0
  72. package/docs/es/usage/theming.md +296 -0
  73. package/docs/es/usage/tooltips.md +127 -0
  74. package/docs/index.md +89 -21
  75. package/docs/integrating/astro.md +3 -4
  76. package/docs/integrating/index.md +18 -13
  77. package/docs/integrating/nextjs.md +4 -5
  78. package/docs/integrating/svelte.md +5 -4
  79. package/docs/integrating/tailwind.md +29 -8
  80. package/docs/integrating/vue.md +3 -4
  81. package/docs/integrating/without-a-bundler.md +114 -0
  82. package/docs/pt-BR/accessibility.md +150 -0
  83. package/docs/pt-BR/concepts.md +212 -0
  84. package/docs/pt-BR/index.md +104 -0
  85. package/docs/pt-BR/integrating/astro.md +35 -0
  86. package/docs/pt-BR/integrating/index.md +47 -0
  87. package/docs/pt-BR/integrating/nextjs.md +67 -0
  88. package/docs/pt-BR/integrating/svelte.md +45 -0
  89. package/docs/pt-BR/integrating/tailwind.md +78 -0
  90. package/docs/pt-BR/integrating/vue.md +31 -0
  91. package/docs/pt-BR/integrating/without-a-bundler.md +115 -0
  92. package/docs/pt-BR/setup.md +180 -0
  93. package/docs/pt-BR/usage/aesthetics.md +276 -0
  94. package/docs/pt-BR/usage/buttons.md +131 -0
  95. package/docs/pt-BR/usage/composing.md +164 -0
  96. package/docs/pt-BR/usage/content-and-layout.md +215 -0
  97. package/docs/pt-BR/usage/customizing.md +298 -0
  98. package/docs/pt-BR/usage/feedback.md +153 -0
  99. package/docs/pt-BR/usage/forms.md +231 -0
  100. package/docs/pt-BR/usage/index.md +29 -0
  101. package/docs/pt-BR/usage/solo.md +84 -0
  102. package/docs/pt-BR/usage/theming.md +296 -0
  103. package/docs/pt-BR/usage/tooltips.md +127 -0
  104. package/docs/setup.md +134 -91
  105. package/docs/usage/aesthetics.md +102 -65
  106. package/docs/usage/buttons.md +108 -40
  107. package/docs/usage/composing.md +105 -92
  108. package/docs/usage/content-and-layout.md +159 -127
  109. package/docs/usage/customizing.md +112 -43
  110. package/docs/usage/feedback.md +135 -70
  111. package/docs/usage/forms.md +184 -99
  112. package/docs/usage/index.md +18 -14
  113. package/docs/usage/solo.md +83 -0
  114. package/docs/usage/theming.md +260 -119
  115. package/docs/usage/tooltips.md +103 -42
  116. package/llms-full.txt +2465 -1272
  117. package/llms.txt +25 -17
  118. package/package.json +28 -35
  119. 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-(--layout-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
- --layout-gap: 0.5rem;
21
+ --_gap: 0.5rem;
14
22
  }
15
23
 
16
24
  &.loose {
17
- --layout-gap: 1.5rem;
25
+ --_gap: 1.5rem;
18
26
  }
19
27
  }
20
28
 
21
29
  @utility stack {
22
- @apply flex flex-col gap-(--layout-gap);
30
+ @apply flex flex-col gap-(--_gap);
31
+
32
+ --_gap: var(--layout-gap);
23
33
 
24
34
  &.tight {
25
- --layout-gap: 0.5rem;
35
+ --_gap: 0.5rem;
26
36
  }
27
37
 
28
38
  &.loose {
29
- --layout-gap: 1.5rem;
39
+ --_gap: 1.5rem;
30
40
  }
31
41
  }
32
42
 
33
43
  @utility cluster {
34
- @apply flex flex-wrap items-center gap-(--layout-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
- --layout-gap: 0.5rem;
53
+ --_gap: 0.5rem;
42
54
  }
43
55
 
44
56
  &.loose {
45
- --layout-gap: 1.5rem;
57
+ --_gap: 1.5rem;
46
58
  }
47
59
  }
48
60
 
49
61
  @utility auto-grid {
50
- @apply grid gap-(--layout-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
- --layout-gap: 0.5rem;
69
+ --_gap: 0.5rem;
56
70
  }
57
71
 
58
72
  &.loose {
59
- --layout-gap: 1.5rem;
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 line,
80
- and neither a fill class nor an edge class has anything to say about one -- while
81
- reading both used to mean a container's `.ghost.edgeless` made every `<hr>`
82
- inside it invisible. The width is the aesthetic's line width, unscaled. */
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
- /* The gap this closes: `sr-only` is Tailwind's own name and the one a consumer
110
- reaches for out of habit, but on the vanilla, ready-to-import entries (`.`,
111
- `/native`) there is no Tailwind utility layer to reach -- those compile real
112
- CSS from a scan of `src/` alone, which used the class nowhere, so `sr-only`
113
- silently did nothing there. It worked fine on a `/tw` entry, where the
114
- consumer's own Tailwind build supplies it, and that split made the gap easy
115
- to miss: it read as a package decision rather than a hole in one build and
116
- not the other.
117
-
118
- Not published as `.sr-only` itself. `.table` already did that once --
119
- shadowing Tailwind's own `display: table` utility until a consumer needed
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;
@@ -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 responsibilities
7
+ # Accessibility
7
8
 
8
- This package provides CSS hooks for accessible states. It does not provide semantic HTML, ARIA attributes, keyboard behavior, focus management, validation, announcement timing, or JavaScript behavior.
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` | Global focus-visible outline using `--focus-ring`, `--focus-ring-width`, and `--focus-ring-offset`. |
17
- | Form control focus | `.ipt`, `.textarea`, and `.select` draw the global focus ring and move their line to the intent color. |
18
- | Invalid controls | `[aria-invalid="true"]` applies destructive border/focus color on form controls. |
19
- | Disabled controls | `[disabled]`, `[aria-disabled="true"]`, `[data-disabled]`, and `.disabled` apply disabled cursor/opacity where supported. |
20
- | Open state | `[data-state="open"]` styles supported surfaces and tooltips. |
21
- | Native `<dialog>` | `dialog:not([open])` and a centered `dialog[open]` are restored in author origin, so `.card` composed onto a `<dialog>` (the closest primitive the package ships) does not render open on load or lose its centering to another rule. Focus trapping, escape handling, and inert-background behavior stay outside this package. |
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 from sighted users while keeping it in the accessibility tree, using the standard clip-based recipe. It ships wherever the layout utilities do -- `.`, `./native`, `./tw`, `./tw/native`, and `./tw/utilities` -- including the vanilla entries with no Tailwind utility layer of their own; it is not part of `./components` or the narrower `./tw/components`/`./tw/*` component slices. See [Content and layout](./usage/content-and-layout.md).
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
- | Feature | Behavior |
30
- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
31
- | Control boundaries | Text controls rest at `--_line-rest` of their intent, under 3:1 by choice, so hover and focus have a whole tone to move the line to. |
32
- | Toggle boundaries | `.checkbox`, `.radio`, and `.switch` draw their line whole, because it is the only thing marking an unchecked box. |
33
- | Cascaded `.edgeless` | Floored on every text control: a container cannot erase the line of a field or toggle nobody classed. |
34
- | Own `.edgeless` | On the element, `.ipt`, `.textarea`, `.select`, and `.switch` do drop their line and do not meet 1.4.11 at rest, except `.switch.ghost`: `.ghost` already asks for zero fill, so dropping the line too would leave no boundary at all, and `.switch.ghost.edgeless` keeps it up instead. |
35
- | `.checkbox`/`.radio` | Never drop their line, on the element or from a container. `.edgeless` on them is unsupported, not merely discouraged. |
36
- | Progress track | By choice, the value carries the reading and the track is a quiet secondary cue. `.progress`'s registered default, `.soft.edgeless`, rests its track at ~1.1-1.3:1 against the page; the value clears 3:1 against that track for every intent but warning in light (~2.7:1) and info in dark (~2.9:1). `.ghost.edged` clears 3:1 for both the track's outline and the value, for every intent, in both themes -- choose it where the track itself must meet 1.4.11. |
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 | Behavior |
41
- | ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
42
- | Reduced-motion loaders | Loader variants use animated embedded SVGs normally and static masks when `prefers-reduced-motion: reduce` matches. |
43
- | Reduced-motion document | The reset additionally shortens document animations and transitions when `prefers-reduced-motion: reduce` matches. |
44
- | Reduced transparency | `.glass` drops its blur and becomes an opaque surface when `prefers-reduced-transparency: reduce` matches. |
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 loader fallback is embedded in loader CSS, so focused imports that include loaders honor reduced motion without the reset. This includes `@codenhub/styles/components`, `@codenhub/styles/tw/components`, and `@codenhub/styles/tw/loader`. The complete and native entrypoints include both that fallback and the reset's broader animation and transition shortening.
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
- | Feature | Behavior |
51
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
- | Filled labels | Every intent's `.solid` label meets 1.4.3 (4.5:1) as normal text, in both themes. Lowest is success at 5.14:1. |
53
- | Warning ink | `--color-warning-contrast` is the near-black tone, not the page tone. Amber dark enough to carry white is not amber. |
54
- | Partial fills | Contrast ink appears only past a half fill, so a capped plate keeps `--intent-strong` rather than walking toward the page. |
55
- | Intent hue in dark | `--intent-strong` is the `-300` shade in dark, so a soft or ghost label keeps its own hue instead of reading white. |
56
- | Toggle marks | A checked mark meets 3:1 as a state indicator on every plate its fill class can paint, in both themes. |
57
- | Soft-edged border | `.alert`, `.panel`, `.badge`, `.kbd`, and `.code`/`.pre`'s `.edged` border fades out by the component's fill amount; at `.soft`'s 12% fill this misses 3:1 against the fill for some intents, and which ones misses depends on the theme. Known, not fixed -- `--color-border`/`--intent-border` is a shared blend seam every one of them reads, so a targeted fix would need to touch it for one component without moving it for the rest. |
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` preserves visible borders and checked states using system colors. |
64
- | Text direction | Quote bar, alert icon, progress fill, vertical divider, and switch knob mirror under `dir="rtl"`. No class needed. |
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, class-based form controls including `.text-control` receive a 2px `Highlight` system-color focus outline. The native entrypoint provides the same visible system outline for unclassed text inputs, selects, textareas, checkboxes, and radios.
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
- Custom checkboxes and radios use the system `Canvas`, `CanvasText`, `Highlight`, and `HighlightText` colors in forced-colors mode so checked and unchecked states remain distinct. Shape, size, and spacing remain unchanged.
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 semantic HTML and behavior appropriate for the component.
113
+ Use the HTML element that matches what the component does, and add the behavior the CSS cannot.
73
114
 
74
- | UI | Required outside CSS |
75
- | ----------------- | --------------------------------------------------------------------------------------------------------------- |
76
- | Buttons | Use `<button>` for actions or accessible links for navigation. Add accessible names for `.btn.icon`. |
77
- | Forms | Use labels, `type`, validation logic, `aria-describedby`, and error message relationships. |
78
- | Alerts | Add `role="status"` or `role="alert"` based on announcement urgency. |
79
- | Toasts | Add live-region behavior, dismissal behavior, focus rules, and pause/timeout logic when needed. |
80
- | Tooltips | Give the bubble a real `id` and `role="tooltip"`, and reference it from the trigger's `aria-describedby`. |
81
- | Progress | Use semantic progress elements or ARIA values when numeric progress must be announced. |
82
- | Skeletons/loaders | Mark decorative loading visuals with `aria-hidden="true"` and expose loading state elsewhere when needed. |
83
- | Popovers/modals | Provide focus trapping, escape handling, inert background behavior, labels, and roles outside this CSS package. |
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 attribute guidance
127
+ ## State attributes
86
128
 
87
- Prefer native attributes first:
129
+ Prefer native attributes:
88
130
 
89
131
  ```html
90
- <button class="btn primary" disabled>Saving</button> <input class="ipt" aria-invalid="true" aria-describedby="email-error" />
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 when native attributes are not available for the element or library:
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">Unavailable</a>
138
+ <a class="btn secondary" aria-disabled="true">Export data</a>
97
139
  <span class="tooltip" data-state="open">
98
- <span class="tooltip-icon" tabindex="0" aria-label="More details" aria-describedby="more-details-bubble">?</span>
99
- <span class="tooltip-bubble" role="tooltip" id="more-details-bubble">More details</span>
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"` communicates disabled state but does not prevent activation. JavaScript or element choice must prevent activation when required.
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.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: 0.1.1
3
3
  date: 2026-09-10
4
+ description: Chip-sized buttons, with .p-xs and .dense clearing the control-height minimum.
4
5
  ---
5
6
 
6
7
  # 0.1.1
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: 0.2.0
3
3
  date: 2026-09-14
4
+ description: Fixes from composing real screens, with composed tooltips, soft toggles by default, untinted neutral surfaces, and elevation that no longer cascades.
4
5
  ---
5
6
 
6
7
  # 0.2.0
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: 0.3.0
3
3
  date: 2026-09-17
4
+ description: A generated palette stylesheet for consumers that cannot build against the package, and a progress track that reads presentation.
4
5
  ---
5
6
 
6
7
  # 0.3.0
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: 0.4.0
3
3
  date: 2026-09-23
4
+ description: The cyber aesthetic, a solo class for every aesthetic, and three material tokens for corner shape and radius.
4
5
  ---
5
6
 
6
7
  # 0.4.0
@@ -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
- ## Breaking
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.