@zazz-ui/core 0.4.0 → 0.5.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 (331) hide show
  1. package/AUTHORING.md +158 -0
  2. package/CHANGELOG.md +341 -0
  3. package/README.md +55 -23
  4. package/dist/scroll-state-C8mA5gq6.js +1 -0
  5. package/dist/sri.json +124 -72
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +116794 -0
  9. package/editor/zazz.html-data.json +1683 -0
  10. package/editor/zazz.language-data.json +5001 -0
  11. package/editor/zazz.lint-data.json +152 -0
  12. package/package.json +12 -5
  13. package/src/base/_breakpoints.css +12 -0
  14. package/src/base/_layers.css +8 -9
  15. package/src/base/_properties-2xl.css +171 -0
  16. package/src/base/_properties-active.css +107 -0
  17. package/src/base/_properties-checked.css +107 -0
  18. package/src/base/_properties-current.css +107 -0
  19. package/src/base/_properties-disabled.css +107 -0
  20. package/src/base/_properties-focus-visible.css +107 -0
  21. package/src/base/_properties-focus-within.css +107 -0
  22. package/src/base/_properties-hover.css +107 -0
  23. package/src/base/_properties-lg.css +171 -0
  24. package/src/base/_properties-md.css +171 -0
  25. package/src/base/_properties-open.css +107 -0
  26. package/src/base/_properties-sm.css +171 -0
  27. package/src/base/_properties-starting.css +55 -0
  28. package/src/base/_properties-stuck.css +55 -0
  29. package/src/base/_properties-xl.css +171 -0
  30. package/src/base/_properties.css +555 -0
  31. package/src/base/_reset.css +67 -75
  32. package/src/base/_switches.css +145 -0
  33. package/src/base/_typography.css +437 -370
  34. package/src/base/_utilities-box.css +142 -0
  35. package/src/base/_utilities-color.css +290 -0
  36. package/src/base/_utilities-effects.css +235 -0
  37. package/src/base/_utilities-flow.css +312 -0
  38. package/src/base/_utilities-grid.css +143 -0
  39. package/src/base/_utilities-margin.css +376 -0
  40. package/src/base/_utilities-pseudo.css +426 -0
  41. package/src/base/_utilities-sizing.css +259 -0
  42. package/src/base/_utilities-spacing.css +190 -0
  43. package/src/base/_utilities-tier-2xl.css +93 -0
  44. package/src/base/_utilities-tier-active.css +61 -0
  45. package/src/base/_utilities-tier-checked.css +61 -0
  46. package/src/base/_utilities-tier-current.css +61 -0
  47. package/src/base/_utilities-tier-disabled.css +61 -0
  48. package/src/base/_utilities-tier-focus-visible.css +61 -0
  49. package/src/base/_utilities-tier-focus-within.css +61 -0
  50. package/src/base/_utilities-tier-hover.css +63 -0
  51. package/src/base/_utilities-tier-lg.css +93 -0
  52. package/src/base/_utilities-tier-md.css +93 -0
  53. package/src/base/_utilities-tier-open.css +61 -0
  54. package/src/base/_utilities-tier-sm.css +93 -0
  55. package/src/base/_utilities-tier-starting.css +35 -0
  56. package/src/base/_utilities-tier-stuck.css +114 -0
  57. package/src/base/_utilities-tier-xl.css +93 -0
  58. package/src/base/_utilities-typography.css +141 -0
  59. package/src/base/_variables.css +323 -372
  60. package/src/base/_view-transitions.css +10 -12
  61. package/src/base/command-score.d.ts.map +1 -1
  62. package/src/base/command-score.js +1 -2
  63. package/src/base/command-score.ts +1 -2
  64. package/src/base/dialog-lifecycle.js +1 -1
  65. package/src/base/dialog-lifecycle.ts +1 -1
  66. package/src/base/embla.d.ts +6 -7
  67. package/src/base/embla.d.ts.map +1 -1
  68. package/src/base/embla.js +89 -55
  69. package/src/base/embla.ts +89 -55
  70. package/src/base/hotkeys.d.ts +0 -5
  71. package/src/base/hotkeys.d.ts.map +1 -1
  72. package/src/base/hotkeys.ts +0 -5
  73. package/src/base/navigation.d.ts +12 -1
  74. package/src/base/navigation.d.ts.map +1 -1
  75. package/src/base/navigation.js +229 -86
  76. package/src/base/navigation.ts +224 -92
  77. package/src/base/reveal.js +14 -14
  78. package/src/base/reveal.ts +14 -14
  79. package/src/base/scroll-state.d.ts +21 -0
  80. package/src/base/scroll-state.d.ts.map +1 -0
  81. package/src/base/scroll-state.js +177 -0
  82. package/src/base/scroll-state.ts +188 -0
  83. package/src/base/signals.d.ts +1 -2
  84. package/src/base/signals.d.ts.map +1 -1
  85. package/src/base/signals.js +4 -6
  86. package/src/base/signals.ts +4 -6
  87. package/src/base/style-format.d.ts +33 -0
  88. package/src/base/style-format.d.ts.map +1 -0
  89. package/src/base/style-format.js +160 -0
  90. package/src/base/style-format.ts +180 -0
  91. package/src/base/typeahead.d.ts +19 -4
  92. package/src/base/typeahead.d.ts.map +1 -1
  93. package/src/base/typeahead.js +68 -21
  94. package/src/base/typeahead.ts +73 -23
  95. package/src/base/utilities.d.ts +188 -0
  96. package/src/base/utilities.d.ts.map +1 -0
  97. package/src/base/utilities.js +750 -0
  98. package/src/base/utilities.ts +865 -0
  99. package/src/base/utils.d.ts +3 -7
  100. package/src/base/utils.d.ts.map +1 -1
  101. package/src/base/utils.js +4 -8
  102. package/src/base/utils.ts +4 -8
  103. package/src/base/zazz-element.d.ts +14 -8
  104. package/src/base/zazz-element.d.ts.map +1 -1
  105. package/src/base/zazz-element.js +14 -8
  106. package/src/base/zazz-element.ts +15 -8
  107. package/src/globals.d.ts +1 -1
  108. package/src/head.d.ts +50 -4
  109. package/src/head.d.ts.map +1 -1
  110. package/src/head.js +119 -38
  111. package/src/head.ts +172 -41
  112. package/src/index.css +57 -14
  113. package/src/index.js +5 -0
  114. package/src/index.ts +6 -0
  115. package/src/manifest.d.ts +36 -5
  116. package/src/manifest.d.ts.map +1 -1
  117. package/src/manifest.js +150 -6
  118. package/src/manifest.ts +167 -9
  119. package/src/primitives/accordion/accordion.css +18 -17
  120. package/src/primitives/accordion/accordion.html +42 -9
  121. package/src/primitives/alert-dialog/alert-dialog.css +13 -13
  122. package/src/primitives/alert-dialog/alert-dialog.html +26 -12
  123. package/src/primitives/autocomplete/autocomplete-groups.html +64 -33
  124. package/src/primitives/autocomplete/autocomplete.css +45 -43
  125. package/src/primitives/autocomplete/autocomplete.d.ts +6 -5
  126. package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
  127. package/src/primitives/autocomplete/autocomplete.html +38 -26
  128. package/src/primitives/autocomplete/autocomplete.js +6 -5
  129. package/src/primitives/autocomplete/autocomplete.ts +6 -5
  130. package/src/primitives/avatar/avatar.html +110 -15
  131. package/src/primitives/badge/badge-icon.html +22 -8
  132. package/src/primitives/badge/badge.css +401 -128
  133. package/src/primitives/badge/badge.html +12 -6
  134. package/src/primitives/breadcrumbs/breadcrumbs.html +25 -5
  135. package/src/primitives/button/button-icon-only.html +17 -11
  136. package/src/primitives/button/button-icon.html +9 -3
  137. package/src/primitives/button/button.css +408 -164
  138. package/src/primitives/button/button.html +14 -7
  139. package/src/primitives/button-group/button-group-vertical.html +5 -5
  140. package/src/primitives/button-group/button-group.css +53 -25
  141. package/src/primitives/button-group/button-group.html +18 -12
  142. package/src/primitives/callout/callout.css +114 -0
  143. package/src/primitives/callout/callout.html +188 -0
  144. package/src/primitives/card/card-subgrid.html +249 -34
  145. package/src/primitives/card/card.css +125 -0
  146. package/src/primitives/card/card.html +141 -20
  147. package/src/primitives/carousel/carousel.css +30 -20
  148. package/src/primitives/carousel/carousel.d.ts +7 -10
  149. package/src/primitives/carousel/carousel.d.ts.map +1 -1
  150. package/src/primitives/carousel/carousel.html +420 -84
  151. package/src/primitives/carousel/carousel.js +1 -1
  152. package/src/primitives/carousel/carousel.ts +8 -11
  153. package/src/primitives/checkbox/checkbox-tasklist.html +6 -6
  154. package/src/primitives/checkbox/checkbox.css +98 -40
  155. package/src/primitives/checkbox/checkbox.d.ts.map +1 -1
  156. package/src/primitives/checkbox/checkbox.html +13 -8
  157. package/src/primitives/checkbox/checkbox.js +7 -9
  158. package/src/primitives/checkbox/checkbox.ts +7 -15
  159. package/src/primitives/combobox/combobox-multiselect.html +53 -33
  160. package/src/primitives/combobox/combobox.css +147 -126
  161. package/src/primitives/combobox/combobox.d.ts +12 -11
  162. package/src/primitives/combobox/combobox.d.ts.map +1 -1
  163. package/src/primitives/combobox/combobox.html +48 -28
  164. package/src/primitives/combobox/combobox.js +46 -51
  165. package/src/primitives/combobox/combobox.ts +48 -55
  166. package/src/primitives/command/command-actions.d.ts +2 -3
  167. package/src/primitives/command/command-actions.d.ts.map +1 -1
  168. package/src/primitives/command/command-actions.html +48 -33
  169. package/src/primitives/command/command-actions.js +12 -10
  170. package/src/primitives/command/command-actions.ts +12 -13
  171. package/src/primitives/command/command-dialog.html +49 -25
  172. package/src/primitives/command/command.css +52 -42
  173. package/src/primitives/command/command.d.ts +10 -7
  174. package/src/primitives/command/command.d.ts.map +1 -1
  175. package/src/primitives/command/command.html +95 -46
  176. package/src/primitives/command/command.js +30 -13
  177. package/src/primitives/command/command.ts +30 -12
  178. package/src/primitives/debug/audit-core.d.ts +64 -0
  179. package/src/primitives/debug/audit-core.d.ts.map +1 -0
  180. package/src/primitives/debug/audit-core.js +356 -0
  181. package/src/primitives/debug/audit-core.ts +535 -0
  182. package/src/primitives/debug/debug.d.ts +50 -0
  183. package/src/primitives/debug/debug.d.ts.map +1 -0
  184. package/src/primitives/debug/debug.js +168 -0
  185. package/src/primitives/debug/debug.ts +211 -0
  186. package/src/primitives/dialog/dialog-with-form.html +67 -45
  187. package/src/primitives/dialog/dialog.css +87 -61
  188. package/src/primitives/dialog/dialog.html +25 -17
  189. package/src/primitives/fields/fields.css +108 -134
  190. package/src/primitives/fields/fields.html +39 -0
  191. package/src/primitives/input/input-icon-leading.html +3 -3
  192. package/src/primitives/input/input-icon-trailing.html +3 -3
  193. package/src/primitives/input/input.css +87 -49
  194. package/src/primitives/input/input.html +15 -15
  195. package/src/primitives/input-group/input-group-password-group.html +15 -15
  196. package/src/primitives/input-group/input-group.css +118 -75
  197. package/src/primitives/input-group/input-group.html +42 -30
  198. package/src/primitives/kbd/kbd-group.html +15 -2
  199. package/src/primitives/kbd/kbd.css +44 -31
  200. package/src/primitives/kbd/kbd.html +7 -1
  201. package/src/primitives/layout/layout.css +159 -0
  202. package/src/primitives/layout/layout.html +35 -0
  203. package/src/primitives/lightbox/lightbox.css +178 -105
  204. package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
  205. package/src/primitives/lightbox/lightbox.html +138 -166
  206. package/src/primitives/lightbox/lightbox.js +10 -13
  207. package/src/primitives/lightbox/lightbox.ts +12 -13
  208. package/src/primitives/menu/menu-interest.html +60 -18
  209. package/src/primitives/menu/menu.css +22 -17
  210. package/src/primitives/menu/menu.d.ts +5 -5
  211. package/src/primitives/menu/menu.html +195 -40
  212. package/src/primitives/menu/menu.js +8 -8
  213. package/src/primitives/menu/menu.ts +8 -8
  214. package/src/primitives/menubar/menubar-help-search.html +78 -32
  215. package/src/primitives/menubar/menubar.html +166 -38
  216. package/src/primitives/meter/meter.css +41 -38
  217. package/src/primitives/meter/meter.html +44 -9
  218. package/src/primitives/mobile-menu/mobile-menu.css +47 -40
  219. package/src/primitives/mobile-menu/mobile-menu.html +1460 -179
  220. package/src/primitives/navigation-menu/navigation-menu-featured.html +155 -33
  221. package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +222 -47
  222. package/src/primitives/navigation-menu/navigation-menu-interest.html +130 -38
  223. package/src/primitives/navigation-menu/navigation-menu-megamenu.html +402 -72
  224. package/src/primitives/navigation-menu/navigation-menu-simple.html +90 -40
  225. package/src/primitives/navigation-menu/navigation-menu.css +104 -106
  226. package/src/primitives/navigation-menu/navigation-menu.html +554 -158
  227. package/src/primitives/otp/otp.css +43 -44
  228. package/src/primitives/otp/otp.d.ts +4 -5
  229. package/src/primitives/otp/otp.d.ts.map +1 -1
  230. package/src/primitives/otp/otp.html +7 -6
  231. package/src/primitives/otp/otp.js +13 -18
  232. package/src/primitives/otp/otp.ts +12 -19
  233. package/src/primitives/password-group/password-group.css +132 -107
  234. package/src/primitives/password-group/password-group.d.ts.map +1 -1
  235. package/src/primitives/password-group/password-group.html +23 -16
  236. package/src/primitives/password-group/password-group.js +11 -12
  237. package/src/primitives/password-group/password-group.ts +11 -12
  238. package/src/primitives/popover/popover.css +89 -95
  239. package/src/primitives/popover/popover.html +18 -0
  240. package/src/primitives/progress/progress-indeterminate.html +1 -1
  241. package/src/primitives/progress/progress.css +34 -35
  242. package/src/primitives/progress/progress.html +18 -4
  243. package/src/primitives/prose/prose.html +19 -12
  244. package/src/primitives/radio/radio.css +83 -46
  245. package/src/primitives/radio/radio.html +16 -11
  246. package/src/primitives/reveal/reveal.css +37 -46
  247. package/src/primitives/reveal/reveal.html +15 -0
  248. package/src/primitives/scroll-fade/scroll-fade.css +115 -0
  249. package/src/primitives/scroll-fade/scroll-fade.html +69 -0
  250. package/src/primitives/select/multiselect.d.ts +8 -10
  251. package/src/primitives/select/multiselect.d.ts.map +1 -1
  252. package/src/primitives/select/multiselect.js +23 -27
  253. package/src/primitives/select/multiselect.ts +23 -29
  254. package/src/primitives/select/select-align.html +79 -16
  255. package/src/primitives/select/select-multiple.html +8 -4
  256. package/src/primitives/select/select-sides.html +104 -21
  257. package/src/primitives/select/select.css +299 -191
  258. package/src/primitives/select/select.html +24 -5
  259. package/src/primitives/separator/separator.css +15 -18
  260. package/src/primitives/separator/separator.html +37 -10
  261. package/src/primitives/slider/slider.css +48 -38
  262. package/src/primitives/slider/slider.html +9 -1
  263. package/src/primitives/style-guard/style-guard.d.ts +19 -0
  264. package/src/primitives/style-guard/style-guard.d.ts.map +1 -0
  265. package/src/primitives/style-guard/style-guard.js +125 -0
  266. package/src/primitives/style-guard/style-guard.ts +153 -0
  267. package/src/primitives/switch/switch.css +42 -33
  268. package/src/primitives/switch/switch.html +11 -6
  269. package/src/primitives/table/table-alternating.html +1 -1
  270. package/src/primitives/table/table-grid.html +5 -5
  271. package/src/primitives/table/table-size-sm.html +1 -1
  272. package/src/primitives/table/table.css +64 -61
  273. package/src/primitives/table/table.html +7 -7
  274. package/src/primitives/tabs/tabs.css +167 -166
  275. package/src/primitives/tabs/tabs.d.ts +10 -11
  276. package/src/primitives/tabs/tabs.d.ts.map +1 -1
  277. package/src/primitives/tabs/tabs.html +192 -36
  278. package/src/primitives/tabs/tabs.js +14 -15
  279. package/src/primitives/tabs/tabs.ts +14 -15
  280. package/src/primitives/textarea/textarea.css +69 -44
  281. package/src/primitives/textarea/textarea.html +3 -3
  282. package/src/primitives/toaster/toaster.css +90 -92
  283. package/src/primitives/toaster/toaster.d.ts +0 -6
  284. package/src/primitives/toaster/toaster.d.ts.map +1 -1
  285. package/src/primitives/toaster/toaster.html +22 -18
  286. package/src/primitives/toaster/toaster.js +64 -72
  287. package/src/primitives/toaster/toaster.ts +71 -87
  288. package/src/primitives/toggle/toggle.css +368 -153
  289. package/src/primitives/toggle/toggle.html +27 -9
  290. package/src/primitives/toggle-group/toggle-group-multiple.html +3 -3
  291. package/src/primitives/toggle-group/toggle-group-vertical.html +4 -4
  292. package/src/primitives/toggle-group/toggle-group.css +71 -23
  293. package/src/primitives/toggle-group/toggle-group.html +3 -3
  294. package/src/primitives/toolbar/toolbar.html +35 -13
  295. package/src/primitives/tooltip/tooltip-disabled.html +3 -3
  296. package/src/primitives/tooltip/tooltip-sides.html +36 -14
  297. package/src/primitives/tooltip/tooltip-with-kbd.html +5 -5
  298. package/src/primitives/tooltip/tooltip.css +111 -80
  299. package/src/primitives/tooltip/tooltip.html +3 -3
  300. package/src/primitives/utilities/aspect-ratio.html +51 -7
  301. package/src/primitives/utilities/basis.html +64 -11
  302. package/src/primitives/utilities/col-span.html +65 -9
  303. package/src/primitives/utilities/compose.html +48 -10
  304. package/src/primitives/utilities/flex-align.html +89 -19
  305. package/src/primitives/utilities/flex-direction.html +111 -13
  306. package/src/primitives/utilities/flex-grow.html +41 -7
  307. package/src/primitives/utilities/gap.html +158 -19
  308. package/src/primitives/utilities/grid-cols.html +75 -7
  309. package/src/primitives/utilities/grid-responsive.html +111 -12
  310. package/src/primitives/utilities/margin-auto.html +38 -7
  311. package/src/primitives/utilities/object-fit.html +75 -13
  312. package/src/primitives/utilities/order.html +40 -4
  313. package/src/primitives/utilities/overflow.html +74 -20
  314. package/src/primitives/utilities/padding-compose.html +67 -10
  315. package/src/primitives/utilities/padding.html +84 -13
  316. package/src/primitives/utilities/pile.html +29 -0
  317. package/src/primitives/utilities/position.html +65 -8
  318. package/src/primitives/utilities/responsive-flex.html +54 -7
  319. package/src/primitives/utilities/responsive-grid.html +115 -12
  320. package/src/primitives/utilities/size.html +120 -16
  321. package/src/primitives/utilities/width.html +123 -16
  322. package/examples/about.html +0 -583
  323. package/examples/components.html +0 -1028
  324. package/examples/forms.html +0 -504
  325. package/examples/index.html +0 -261
  326. package/examples/layout.html +0 -313
  327. package/examples/products.html +0 -839
  328. package/examples/responsive.html +0 -332
  329. package/src/base/_layout.css +0 -571
  330. package/src/base/_utilities.css +0 -6758
  331. package/src/primitives/utilities/grid-pile.html +0 -5
@@ -1,23 +1,23 @@
1
1
  /**
2
- * reset.css — Native element baselines and shared control primitives.
2
+ * _reset.css — Native element baselines and shared control primitives.
3
3
  *
4
4
  * @layer reset
5
- * @requires layers.css, _properties.css, _variables.css
5
+ * @requires _layers.css, _properties.css, _variables.css
6
6
  * @uses appearance: none — select chevron reset
7
- * @uses ::details-content — accordion open/close (see _accordion.css for :where(ui-accordion, .ui-accordion))
8
- * @uses container-type — layout containers on main, article, section
7
+ * @uses ::details-content — accordion open/close (see accordion.css for :where(ui-accordion, [data-ui~="accordion"]))
8
+ * @uses container-type — inline-size containers on html, body, main, header, footer, section, article:
9
+ * the query containers breakpoint tiers read (the layout primitive owns the band grid)
9
10
  * @uses view-transition-name via the <main> tag - main-content and [data-transition-layer] —
10
11
  * global (animated in _view-transitions.css)
11
12
  * @uses text-box — vertical trim on headings
12
13
  * @uses color-mix(), oklch(from …), contrast-color() — mark/highlight tints
13
- * @tokens Native-control hooks declared per element — --code-*,
14
- * --search-cancel-*, --placeholder-color
14
+ * @tokens Native-element hooks declared in each element's rule (override them
15
+ * on the element): --code-* (incl. --code-font-family), --search-cancel-*,
16
+ * --placeholder-color, --strong-font-weight, --hr-bg,
17
+ * --optgroup-font-weight, --optgroup-option-pl; --selection-bg on html
15
18
  *
16
- * Note: Checkbox lives in _checkbox.css; range/slider in _slider.css;
17
- * switch in _switch.css.
18
- *
19
- * Note: <select> picker internals live in _select.css; popover in _popover.css;
20
- * dialog in _dialog.css.
19
+ * Checkbox, range, switch, select picker, popover and dialog internals live in
20
+ * their primitive stylesheets.
21
21
  */
22
22
  @layer reset {
23
23
  /* ===========================================================================
@@ -41,12 +41,17 @@
41
41
  line-height: 1.5;
42
42
  tab-size: 4;
43
43
  -webkit-text-size-adjust: 100%;
44
- background-color: var(--background);
44
+ background-color: var(--color-background);
45
45
  -webkit-tap-highlight-color: transparent;
46
- overflow: clip;
46
+ /* text selection tint (::selection reads it from the selected element) */
47
+ --selection-bg: oklch(from var(--color-primary) calc(l + 0.1) c h / 0.3);
47
48
 
48
- /* Enable container queries by default */
49
- container-type: normal;
49
+ /* html (the viewport) is the page's scrolling element, as browsers expect */
50
+ scroll-behavior: smooth;
51
+
52
+ /* The outermost query container: breakpoint tiers read the nearest
53
+ inline-size container, and this one is it when nothing closer is. */
54
+ container-type: inline-size;
50
55
  container-name: html;
51
56
  }
52
57
 
@@ -66,29 +71,29 @@
66
71
  -moz-osx-font-smoothing: grayscale;
67
72
  -webkit-font-smoothing: antialiased;
68
73
  text-wrap: pretty;
69
- color: var(--foreground);
70
- background-color: var(--background);
71
- block-size: 100svh;
72
- scroll-behavior: smooth;
73
- scrollbar-gutter: stable;
74
- overflow-y: auto;
74
+ color: var(--color-foreground);
75
+ background-color: var(--color-background);
76
+ /* at least a screen tall, so main (flex: 1) pins the footer on short pages */
77
+ min-block-size: 100svh;
78
+ /* clip, not hidden: no scroll container, so the viewport keeps scrolling */
75
79
  overflow-x: clip;
76
80
  font-size: var(--font-size-md);
77
81
  line-height: var(--leading-md);
78
82
  letter-spacing: var(--tracking-md);
83
+ font-synthesis-weight: none;
79
84
 
80
- /* Enable container queries by default */
81
85
  container-type: inline-size;
82
86
  container-name: body;
83
87
  }
84
88
 
85
89
  :where(:focus-visible) {
86
- outline: var(--outline-width) var(--outline-style) var(--ring);
90
+ outline: var(--outline-width) var(--outline-style) var(--ring-shadow-color);
87
91
  outline-offset: var(--outline-offset);
88
92
  }
89
93
 
90
94
  :where(b, strong) {
91
- font-weight: var(--font-weight-strong);
95
+ --strong-font-weight: var(--font-weight-strong);
96
+ font-weight: var(--strong-font-weight);
92
97
  }
93
98
 
94
99
  :where(main) {
@@ -96,7 +101,7 @@
96
101
  --_container-name: main;
97
102
  --_view-transition-name: main-content;
98
103
 
99
- /* Allow for more predictable z-indexing and spacing */
104
+ /* predictable z-indexing */
100
105
  isolation: isolate;
101
106
  position: relative;
102
107
 
@@ -105,11 +110,10 @@
105
110
  flex: 1 0 auto;
106
111
  overflow: clip;
107
112
 
108
- /* Enable container queries for main content */
109
113
  container-type: var(--_container-type);
110
114
  container-name: var(--_container-name);
111
115
 
112
- /* View transitions - Main content is isolated from the rest of the page and can be animated independently of, for example, the header or footer */
116
+ /* isolated so it can animate independently of header/footer */
113
117
  view-transition-name: var(--_view-transition-name);
114
118
  }
115
119
 
@@ -142,10 +146,8 @@
142
146
  }
143
147
 
144
148
  :where(header, footer, section, article) {
145
- /* Allow for more predictable z-indexing */
146
149
  position: relative;
147
150
 
148
- /* Enable container queries for main content sections */
149
151
  container-type: var(--_container-type);
150
152
  container-name: var(--_container-name, layout);
151
153
  }
@@ -165,11 +167,7 @@
165
167
  TYPOGRAPHY & SEMANTIC ELEMENTS
166
168
  =========================================================================== */
167
169
 
168
- /* Headings inherit by default — utility classes (.text-h1, etc.) drive size/weight */
169
- :where(h1, h2, h3, h4, h5, h6) {
170
- font-size: inherit;
171
- font-weight: inherit;
172
- }
170
+ /* Headings take their role from _typography.css */
173
171
 
174
172
  :where(small) {
175
173
  font-size: 80%;
@@ -196,33 +194,35 @@
196
194
  }
197
195
 
198
196
  :where(hr) {
197
+ --hr-bg: var(--color-border);
199
198
  block-size: 1px;
200
- color: var(--border);
201
- background-color: var(--border);
199
+ color: var(--hr-bg);
200
+ background-color: var(--hr-bg);
202
201
  border: 0;
203
202
  flex-shrink: 0;
204
203
  }
205
204
 
206
205
  :where(hr[data-orientation="vertical"]) {
207
206
  inline-size: 1px;
208
- color: var(--border);
209
- background-color: var(--border);
207
+ color: var(--hr-bg);
208
+ background-color: var(--hr-bg);
210
209
  border: 0;
211
210
  }
212
211
 
213
212
  :where(code, samp, pre) {
214
- font-family: var(--font-family-mono);
213
+ --code-font-family: var(--font-family-mono);
214
+ font-family: var(--code-font-family);
215
215
  font-size: 1em;
216
216
  }
217
217
 
218
218
  :where(code) {
219
219
  --code-display: inline;
220
- --code-background: var(--muted);
221
- --code-border: 1px solid var(--muted);
222
- --code-padding-inline: var(--step-1);
220
+ --code-background: var(--color-muted);
221
+ --code-border: 1px solid var(--color-muted);
222
+ --code-padding-inline: var(--spacing);
223
223
  --code-padding-block: 0em;
224
224
  --code-radius: var(--radius-xs);
225
- --code-color: var(--foreground);
225
+ --code-color: var(--color-foreground);
226
226
 
227
227
  display: var(--code-display);
228
228
  background-color: var(--code-background);
@@ -237,8 +237,6 @@
237
237
  max-inline-size: 100%;
238
238
  }
239
239
 
240
- /* <kbd> baseline lives with the Kbd primitive — see primitives/kbd/kbd.css */
241
-
242
240
  /* ===========================================================================
243
241
  LIST RESETS
244
242
  =========================================================================== */
@@ -270,7 +268,6 @@
270
268
  }
271
269
 
272
270
  :where(img, video) {
273
- /* Ensure the image is responsive */
274
271
  max-inline-size: 100%;
275
272
  block-size: auto;
276
273
  }
@@ -287,21 +284,24 @@
287
284
  /* Custom text selection styling — the tinted background is safe everywhere
288
285
  (relative oklch is Baseline). contrast-color() is Chromium-only, so it is
289
286
  gated: without it the selection keeps its inherited text color, which stays
290
- legible against a 30%-opacity tint in both light and dark modes. */
291
- ::selection {
292
- background-color: oklch(from var(--primary) calc(l + 0.1) c h / 0.3);
287
+ legible against a 30%-opacity tint in both light and dark modes.
288
+
289
+ On :root only, on purpose: highlight pseudo-elements inherit from the
290
+ parent's highlight pseudo-element (css-pseudo-4 highlight inheritance:
291
+ Chrome 134+, Firefox, WebKit), so one rule reaches every selection. A
292
+ universal `::selection` rule that reads a var() makes Chromium recalculate
293
+ an element's whole subtree whenever any custom property on it changes
294
+ (measured: a container's inline utility change restyled 1,000 styled
295
+ children, 194 ms per frame; 0.4 ms with this form). Engines without
296
+ highlight inheritance fall back to the UA selection color. */
297
+ :root::selection {
298
+ background-color: var(--selection-bg);
293
299
  }
294
300
 
295
301
  @supports (color: contrast-color(white)) {
296
- ::selection {
297
- /* Ensure text is always legible on the primary color at 30% opacity + the background color */
298
- color: contrast-color(
299
- color-mix(
300
- in oklch,
301
- var(--background) 50%,
302
- oklch(from var(--primary) calc(l + 0.1) c h / 0.3)
303
- )
304
- );
302
+ :root::selection {
303
+ /* legible on the 30% primary tint over the background */
304
+ color: contrast-color(color-mix(in oklch, var(--color-background) 50%, var(--selection-bg)));
305
305
  }
306
306
  }
307
307
 
@@ -309,7 +309,6 @@
309
309
  FORM ELEMENT RESETS
310
310
  =========================================================================== */
311
311
 
312
- /* Inherit font and color across all form controls */
313
312
  :where(button, input, optgroup, select, textarea),
314
313
  ::file-selector-button {
315
314
  font: inherit;
@@ -320,7 +319,6 @@
320
319
  padding: unset;
321
320
  }
322
321
 
323
- /* Preflight compatibility — cross-browser form baselines */
324
322
  :where(button, input, select, textarea),
325
323
  ::file-selector-button {
326
324
  border-radius: 0;
@@ -338,11 +336,13 @@
338
336
  }
339
337
 
340
338
  :where(select:is([multiple], [size])) optgroup {
341
- font-weight: var(--font-weight-strong);
339
+ --optgroup-font-weight: var(--font-weight-strong);
340
+ font-weight: var(--optgroup-font-weight);
342
341
  }
343
342
 
344
343
  :where(select:is([multiple], [size])) optgroup option {
345
- padding-inline-start: var(--gap-sm);
344
+ --optgroup-option-pl: var(--space-sm);
345
+ padding-inline-start: var(--optgroup-option-pl);
346
346
  }
347
347
 
348
348
  :-moz-ui-invalid {
@@ -366,8 +366,8 @@
366
366
  --search-cancel-display: block;
367
367
  --search-cancel-color: currentColor;
368
368
  --search-cancel-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'/%3E%3Cline x1='200' y1='56' x2='56' y2='200' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='200' y1='200' x2='56' y2='56' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E");
369
- --search-cancel-icon-size: var(--step-4);
370
- --search-cancel-size: var(--step-6);
369
+ --search-cancel-icon-size: calc(var(--spacing) * 4);
370
+ --search-cancel-size: calc(var(--spacing) * 6);
371
371
  --search-cancel-radius: var(--radius-sm);
372
372
 
373
373
  -webkit-appearance: none;
@@ -395,7 +395,7 @@
395
395
  }
396
396
 
397
397
  /* Suppress the browser's built-in password reveal / clear glyphs (Edge/IE) so
398
- they never double up with the Zazz [data-slot~="password-group-toggle"] button. */
398
+ they never double up with the Zazz [data-password-group-slot~="toggle"] button. */
399
399
  ::-ms-reveal,
400
400
  ::-ms-clear {
401
401
  display: none;
@@ -430,7 +430,6 @@
430
430
  line-height: 1;
431
431
  }
432
432
 
433
- /* Input field resets */
434
433
  :where(textarea, input) {
435
434
  font-size: unset;
436
435
  block-size: unset;
@@ -446,7 +445,7 @@
446
445
  }
447
446
 
448
447
  ::placeholder {
449
- --placeholder-color: var(--muted-foreground);
448
+ --placeholder-color: var(--color-muted-foreground);
450
449
  color: var(--placeholder-color);
451
450
  }
452
451
 
@@ -466,10 +465,6 @@
466
465
  margin: unset;
467
466
  }
468
467
 
469
- /* Native <select> internals (::picker panel, <option>, ::picker-icon) live in
470
- _select.css under @layer reset to keep the select styling modular. */
471
-
472
- /* Button resets */
473
468
  :where(button) {
474
469
  color: unset;
475
470
  padding: unset;
@@ -481,10 +476,7 @@
481
476
  BROWSER NORMALIZATION
482
477
  =========================================================================== */
483
478
 
484
- /* Strip UA chrome from progress/meter so the component files can redraw the
485
- track (the element box) and fill (vendor pseudo-elements) from theme tokens —
486
- same split as select: the plain appearance strip lives here, the redraw in
487
- progress.css / meter.css under @layer reset. */
479
+ /* Strip UA chrome so progress.css / meter.css can redraw track and fill. */
488
480
  :where(progress, meter) {
489
481
  -webkit-appearance: none;
490
482
  -moz-appearance: none;
@@ -0,0 +1,145 @@
1
+ /**
2
+ * _switches.css — Switches: fixed rule sets with no value, carried as
3
+ * `data-ui` tokens.
4
+ *
5
+ * @layer utilities
6
+ * @requires _layers.css
7
+ * @uses data-ui="sr-only": visually hidden, still in the accessibility tree
8
+ * @uses data-ui="pile": every child in one grid area
9
+ * @uses data-ui="isolate": a new stacking context (isolation: isolate)
10
+ * @uses data-ui="not-prose": a prose ancestor stops styling this subtree
11
+ * (a widget inside an article; rules in _typography.css)
12
+ * @uses data-ui="truncate": one line, overflow cut with an ellipsis
13
+ * (`--line-clamp` clamps to more lines)
14
+ * @uses data-ui="spin": a full turn every second (loading indicators)
15
+ * @uses data-ui="ping": scale up and fade out every second, like a radar
16
+ * ping (notification dots)
17
+ * @uses data-ui="pulse": fade to half opacity and back every two
18
+ * seconds (skeleton loaders)
19
+ * @uses data-ui="bounce": drop and rise every second (scroll hints)
20
+ * @uses data-ui="divide-x" / "divide-y": a border between direct children,
21
+ * sized and colored by the container's `--divide` (default 1px --color-border)
22
+ * @uses data-ui="container": an inline-size query container, so breakpoint
23
+ * tiers inside it (`--grid-cols--md`) follow its width, not the page's
24
+ */
25
+
26
+ @layer ui.utilities {
27
+ :where([data-ui~="sr-only"]) {
28
+ position: absolute;
29
+ inline-size: 1px;
30
+ block-size: 1px;
31
+ padding: 0;
32
+ margin: -1px;
33
+ overflow: hidden;
34
+ clip: rect(0, 0, 0, 0);
35
+ white-space: nowrap;
36
+ border-width: 0;
37
+ }
38
+
39
+ :where([data-ui~="pile"]) {
40
+ display: grid;
41
+ grid-template-areas: "pile";
42
+ place-items: center;
43
+
44
+ > * {
45
+ grid-area: pile;
46
+ }
47
+ }
48
+
49
+ :where([data-ui~="isolate"]) {
50
+ isolation: isolate;
51
+ }
52
+
53
+ /* needs a width to overflow: a block, a sized element, or a flex item with
54
+ `--min-w: 0` (a flex item's min width is its content by default) */
55
+ :where([data-ui~="truncate"]) {
56
+ overflow: hidden;
57
+ text-overflow: ellipsis;
58
+ white-space: nowrap;
59
+ }
60
+
61
+ /* dividers: a border on the trailing edge of every direct child but the last.
62
+ `--divide` on the container sets it with the border shorthand's grammar (a
63
+ number is px in --color-border, a color is 1px of it, a length is the width);
64
+ its width and color channels inherit so the children read them. A switch,
65
+ not a `--divide-x` utility: a `[style*=…] > *` rule would make every inline
66
+ style change invalidate the changed element's whole subtree (CONVENTIONS §6). */
67
+ :where([data-ui~="divide-x"]) > :where(:not(:last-child)) {
68
+ border-inline-end-width: var(--_divide-w, 1px);
69
+ border-inline-end-style: solid;
70
+ border-inline-end-color: var(--_divide-c, var(--color-border));
71
+ }
72
+
73
+ :where([data-ui~="divide-y"]) > :where(:not(:last-child)) {
74
+ border-block-end-width: var(--_divide-w, 1px);
75
+ border-block-end-style: solid;
76
+ border-block-end-color: var(--_divide-c, var(--color-border));
77
+ }
78
+
79
+ /* Tailwind's looping animations, on the kit's transition easing (applied to
80
+ each keyframe segment). They animate `transform`, so the `--rotate`,
81
+ `--scale`, and `--translate` utilities still compose with them; reduced
82
+ motion stops them, like every looping animation in the kit. */
83
+ @media (prefers-reduced-motion: no-preference) {
84
+ :where([data-ui~="spin"]) {
85
+ animation: ui-spin 1s var(--default-transition-timing-function) infinite;
86
+ }
87
+
88
+ :where([data-ui~="ping"]) {
89
+ animation: ui-ping 1s var(--default-transition-timing-function) infinite;
90
+ }
91
+
92
+ :where([data-ui~="pulse"]) {
93
+ animation: ui-pulse 2s var(--default-transition-timing-function) infinite;
94
+ }
95
+
96
+ :where([data-ui~="bounce"]) {
97
+ animation: ui-bounce 1s var(--default-transition-timing-function) infinite;
98
+ }
99
+ }
100
+
101
+ @keyframes ui-spin {
102
+ to {
103
+ transform: rotate(360deg);
104
+ }
105
+ }
106
+
107
+ @keyframes ui-ping {
108
+ 75%,
109
+ 100% {
110
+ transform: scale(2);
111
+ opacity: 0;
112
+ }
113
+ }
114
+
115
+ @keyframes ui-pulse {
116
+ 50% {
117
+ opacity: 0.5;
118
+ }
119
+ }
120
+
121
+ @keyframes ui-bounce {
122
+ 0%,
123
+ 100% {
124
+ transform: translateY(-25%);
125
+ }
126
+
127
+ 50% {
128
+ transform: none;
129
+ }
130
+ }
131
+
132
+ /* inline-size containment: its width cannot come from its content, so it
133
+ needs a definite or stretched width (a block, grid or flex item, a cell) */
134
+ :where([data-ui~="container"]) {
135
+ container-type: inline-size;
136
+ }
137
+
138
+ /* a sticky container is also the stuck state's scroll-state container
139
+ (_utilities-tier-stuck.css); this file loads after it, so keep both */
140
+ @supports (container-type: scroll-state) {
141
+ :where([data-ui~="container"]:is([style*=": sticky"], [style*="--stuck-state:"])) {
142
+ container-type: inline-size scroll-state;
143
+ }
144
+ }
145
+ }