zyzz 0.0.9 → 0.0.12

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/README.md +1 -1
  2. package/dist/Style.js +2 -2
  3. package/dist/Style.js.map +1 -1
  4. package/dist/Vars.d.ts +2 -2
  5. package/dist/Vars.d.ts.map +1 -1
  6. package/dist/Vars.js.map +1 -1
  7. package/dist/compiler/Source.d.ts.map +1 -1
  8. package/dist/compiler/Source.js +10 -0
  9. package/dist/compiler/Source.js.map +1 -1
  10. package/dist/compiler/internal/Contract.d.ts.map +1 -1
  11. package/dist/compiler/internal/Contract.js +11 -6
  12. package/dist/compiler/internal/Contract.js.map +1 -1
  13. package/dist/compiler/internal/Contributions.d.ts.map +1 -1
  14. package/dist/compiler/internal/Contributions.js +592 -556
  15. package/dist/compiler/internal/Contributions.js.map +1 -1
  16. package/dist/compiler/internal/Expression.d.ts +4 -0
  17. package/dist/compiler/internal/Expression.d.ts.map +1 -1
  18. package/dist/compiler/internal/Expression.js +45 -0
  19. package/dist/compiler/internal/Expression.js.map +1 -1
  20. package/dist/compiler/internal/RecipeConditions.js +2 -2
  21. package/dist/compiler/internal/RecipeConditions.js.map +1 -1
  22. package/dist/compiler/internal/Themes.d.ts.map +1 -1
  23. package/dist/compiler/internal/Themes.js +2 -0
  24. package/dist/compiler/internal/Themes.js.map +1 -1
  25. package/dist/default.d.ts +75 -19
  26. package/dist/default.d.ts.map +1 -1
  27. package/dist/default.js +76 -11
  28. package/dist/default.js.map +2 -2
  29. package/dist/default.js.zyzz.json +1 -1
  30. package/dist/internal/Condition.d.ts +1 -1
  31. package/dist/internal/Condition.d.ts.map +1 -1
  32. package/dist/internal/Configuration.js +2 -2
  33. package/dist/internal/Configuration.js.map +1 -1
  34. package/dist/internal/Query.d.ts +2 -2
  35. package/dist/internal/Query.d.ts.map +1 -1
  36. package/dist/internal/Query.js +1 -1
  37. package/dist/internal/Query.js.map +1 -1
  38. package/dist/internal/Theme.d.ts +4 -4
  39. package/dist/internal/Theme.d.ts.map +1 -1
  40. package/dist/internal/Theme.js +6 -6
  41. package/dist/internal/Theme.js.map +1 -1
  42. package/dist/internal/Token.d.ts +185 -2
  43. package/dist/internal/Token.d.ts.map +1 -1
  44. package/dist/internal/Token.js +236 -23
  45. package/dist/internal/Token.js.map +1 -1
  46. package/dist/internal/VariableSets.d.ts.map +1 -1
  47. package/dist/internal/VariableSets.js +9 -6
  48. package/dist/internal/VariableSets.js.map +1 -1
  49. package/dist/unplugin/index.d.ts.map +1 -1
  50. package/dist/unplugin/index.js +14 -0
  51. package/dist/unplugin/index.js.map +1 -1
  52. package/dist/variants.d.ts +13 -2
  53. package/dist/variants.d.ts.map +1 -1
  54. package/dist/variants.js.map +1 -1
  55. package/dist/web/colorProfile.d.ts +9 -5
  56. package/dist/web/colorProfile.d.ts.map +1 -1
  57. package/dist/web/colorProfile.js.map +1 -1
  58. package/dist/web/counterStyle.d.ts +13 -9
  59. package/dist/web/counterStyle.d.ts.map +1 -1
  60. package/dist/web/counterStyle.js.map +1 -1
  61. package/dist/web/cssFunction.d.ts +19 -14
  62. package/dist/web/cssFunction.d.ts.map +1 -1
  63. package/dist/web/cssFunction.js.map +1 -1
  64. package/dist/web/fontFace.d.ts +6 -1
  65. package/dist/web/fontFace.d.ts.map +1 -1
  66. package/dist/web/fontFace.js.map +1 -1
  67. package/dist/web/fontFeatureValues.d.ts +11 -7
  68. package/dist/web/fontFeatureValues.d.ts.map +1 -1
  69. package/dist/web/fontFeatureValues.js.map +1 -1
  70. package/dist/web/fontPaletteValues.d.ts +8 -3
  71. package/dist/web/fontPaletteValues.d.ts.map +1 -1
  72. package/dist/web/fontPaletteValues.js.map +1 -1
  73. package/dist/web/internal/Context.d.ts +3 -3
  74. package/dist/web/internal/Context.d.ts.map +1 -1
  75. package/dist/web/keyframes.d.ts +7 -3
  76. package/dist/web/keyframes.d.ts.map +1 -1
  77. package/dist/web/keyframes.js.map +1 -1
  78. package/dist/web/page.d.ts +11 -4
  79. package/dist/web/page.d.ts.map +1 -1
  80. package/dist/web/page.js.map +1 -1
  81. package/dist/web/positionTry.d.ts +6 -1
  82. package/dist/web/positionTry.d.ts.map +1 -1
  83. package/dist/web/positionTry.js.map +1 -1
  84. package/dist/web/property.d.ts +10 -5
  85. package/dist/web/property.d.ts.map +1 -1
  86. package/dist/web/property.js.map +1 -1
  87. package/dist/web/viewTransition.d.ts +10 -6
  88. package/dist/web/viewTransition.d.ts.map +1 -1
  89. package/dist/web/viewTransition.js.map +1 -1
  90. package/package.json +1 -1
  91. package/src/Style.ts +2 -2
  92. package/src/Vars.ts +2 -3
  93. package/src/compiler/Source.ts +19 -0
  94. package/src/compiler/internal/Contract.ts +19 -8
  95. package/src/compiler/internal/Contributions.ts +734 -685
  96. package/src/compiler/internal/Expression.ts +57 -0
  97. package/src/compiler/internal/RecipeConditions.ts +2 -2
  98. package/src/compiler/internal/Themes.ts +2 -0
  99. package/src/default.ts +175 -30
  100. package/src/internal/Condition.ts +3 -3
  101. package/src/internal/Configuration.ts +2 -2
  102. package/src/internal/Query.ts +3 -3
  103. package/src/internal/Theme.ts +12 -12
  104. package/src/internal/Token.ts +253 -33
  105. package/src/internal/VariableSets.ts +28 -25
  106. package/src/unplugin/index.ts +14 -0
  107. package/src/variants.ts +35 -2
  108. package/src/web/colorProfile.ts +25 -10
  109. package/src/web/counterStyle.ts +29 -14
  110. package/src/web/cssFunction.ts +47 -24
  111. package/src/web/fontFace.ts +16 -3
  112. package/src/web/fontFeatureValues.ts +35 -18
  113. package/src/web/fontPaletteValues.ts +25 -11
  114. package/src/web/internal/Context.ts +9 -3
  115. package/src/web/keyframes.ts +24 -9
  116. package/src/web/page.ts +22 -5
  117. package/src/web/positionTry.ts +20 -5
  118. package/src/web/property.ts +23 -9
  119. package/src/web/viewTransition.ts +28 -13
@@ -32,6 +32,63 @@ export function acceptsColor(
32
32
  }
33
33
  }
34
34
 
35
+ /** Validates explicit variable substitutions in compound values, including every conditional fallback. */
36
+ export function acceptsVariables(
37
+ expression: Token.Expression,
38
+ property: keyof Literal.Properties,
39
+ ): boolean {
40
+ if (
41
+ !['filter', 'backdropFilter', 'boxShadow', 'textShadow'].includes(property)
42
+ )
43
+ return false
44
+ function values(value: Token.Value): readonly string[] {
45
+ if (Token.is(value)) return values(value.value)
46
+ if (typeof value === 'object') return Object.values(value).flatMap(values)
47
+ return [String(value)]
48
+ }
49
+ let candidates = ['']
50
+ for (const part of expression.parts) {
51
+ if (Binding.is(part)) return false
52
+ const alternatives = typeof part === 'string' ? [part] : values(part.value)
53
+ // Bound combinations of independent responsive variables before grammar checks.
54
+ if (candidates.length * alternatives.length > 256) return false
55
+ candidates = candidates.flatMap((prefix) =>
56
+ alternatives.map((value) => prefix + value),
57
+ )
58
+ }
59
+ try {
60
+ return candidates.every(
61
+ (value) =>
62
+ Tree.lexer.matchProperty(
63
+ Literal.name(property),
64
+ value.replace(/ !important$/, ''),
65
+ ).error === null,
66
+ )
67
+ } catch {
68
+ return false
69
+ }
70
+ }
71
+
72
+ /** Checks every identifier-token branch before its value becomes a CSS variable. */
73
+ export function acceptsIdentifier(
74
+ reference: Token.Reference,
75
+ property: keyof Literal.Properties,
76
+ ): boolean {
77
+ function check(value: Token.Value): boolean {
78
+ if (Token.is(value)) return check(value.value)
79
+ if (typeof value === 'object') return Object.values(value).every(check)
80
+ try {
81
+ return (
82
+ Tree.lexer.matchProperty(Literal.name(property), String(value))
83
+ .error === null
84
+ )
85
+ } catch {
86
+ return false
87
+ }
88
+ }
89
+ return check(reference.value)
90
+ }
91
+
35
92
  /** Folds cooked template text and literal primitive substitutions; unresolved syntax returns undefined. */
36
93
  export function template(
37
94
  node: Ast.TemplateLiteral,
@@ -34,9 +34,9 @@ export function read(options: read.Options): Condition {
34
34
  const rule = Query.resolve(
35
35
  node.value,
36
36
  options.queries ?? {
37
- breakpoints: {},
37
+ breakpoint: {},
38
38
  containerNames: [],
39
- containers: {},
39
+ container: {},
40
40
  },
41
41
  )
42
42
  const match = /^@(media|supports)(?=[\s(])\s*([\s\S]+)$/.exec(
@@ -1212,6 +1212,8 @@ export function collect(program: Ast.Program, options: collect.Options) {
1212
1212
  tokenType: theme.tokenType,
1213
1213
  type: theme.type,
1214
1214
  options: theme.options,
1215
+ variableConfig: theme.variableConfig,
1216
+ variableMappings: theme.variableMappings,
1215
1217
  output: theme.output,
1216
1218
  })
1217
1219
 
package/src/default.ts CHANGED
@@ -3,31 +3,63 @@
3
3
  * @module
4
4
  */
5
5
  import { Config } from 'zyzz'
6
+ import { keyframes } from 'zyzz/web'
7
+
8
+ const spin = keyframes(
9
+ { to: { transform: 'rotate(360deg)' } },
10
+ { id: 'zyzz-spin' },
11
+ )
12
+ const ping = keyframes(
13
+ { '75%, 100%': { transform: 'scale(2)', opacity: 0 } },
14
+ { id: 'zyzz-ping' },
15
+ )
16
+ const pulse = keyframes({ '50%': { opacity: 0.5 } }, { id: 'zyzz-pulse' })
17
+ const bounce = keyframes(
18
+ {
19
+ '0%, 100%': {
20
+ transform: 'translateY(-25%)',
21
+ animationTimingFunction: 'cubic-bezier(0.8, 0, 1, 1)',
22
+ },
23
+ '50%': {
24
+ transform: 'none',
25
+ animationTimingFunction: 'cubic-bezier(0, 0, 0.2, 1)',
26
+ },
27
+ },
28
+ { id: 'zyzz-bounce' },
29
+ )
30
+
31
+ // Retain keyframes referenced by the generated literal animation tokens.
32
+ void [spin, ping, pulse, bounce]
6
33
 
7
34
  /**
8
35
  * Raw bundled values, independent of portable references.
9
36
  *
10
- * Breakpoints, containers, spacing, radii, font sizes, weights, tracking, and
11
- * leading use the conventional named and quarter-rem scales. Fractional spacing
12
- * steps are omitted because token paths reserve the dot separator. Colors are
13
- * ten-step light/dark scales plus `background`, `grayAlpha`, `black`, and
14
- * `white`. `foreground` aliases `gray.1000` and `surface` aliases
15
- * `background.100`. Font stacks lead with the named faces and fall back to
16
- * system fonts. Typography sets use https://vercel.com/geist/typography,
17
- * with explicit zero tracking outside headings. No fonts are loaded.
37
+ * Colors retain Geist light/dark pairs. Effects, radii, and query scales follow Tailwind CSS 4.3.3.
38
+ * Spacing uses an explicit quarter-rem table. Font scales and Geist typography
39
+ * retain their existing values. Font stacks fall back to system fonts;
40
+ * no fonts are loaded.
18
41
  */
19
42
  export const tokens = {
20
- borderRadius: {
21
- xs: '0.125rem',
22
- sm: '0.25rem',
23
- md: '0.375rem',
24
- lg: '0.5rem',
25
- xl: '0.75rem',
26
- '2xl': '1rem',
27
- '3xl': '1.5rem',
28
- '4xl': '2rem',
43
+ animate: {
44
+ spin: 'z-kid-7a-79-7a-7a-2d-73-70-69-6e 1s linear infinite',
45
+ ping: 'z-kid-7a-79-7a-7a-2d-70-69-6e-67 1s cubic-bezier(0, 0, 0.2, 1) infinite',
46
+ pulse:
47
+ 'z-kid-7a-79-7a-7a-2d-70-75-6c-73-65 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
48
+ bounce: 'z-kid-7a-79-7a-7a-2d-62-6f-75-6e-63-65 1s infinite',
49
+ },
50
+ aspect: {
51
+ video: '16 / 9',
29
52
  },
30
- breakpoints: {
53
+ blur: {
54
+ xs: '4px',
55
+ sm: '8px',
56
+ md: '12px',
57
+ lg: '16px',
58
+ xl: '24px',
59
+ '2xl': '40px',
60
+ '3xl': '64px',
61
+ },
62
+ breakpoint: {
31
63
  sm: '40rem',
32
64
  md: '48rem',
33
65
  lg: '64rem',
@@ -152,7 +184,7 @@ export const tokens = {
152
184
  },
153
185
  white: '#fff',
154
186
  },
155
- containers: {
187
+ container: {
156
188
  '3xs': '16rem',
157
189
  '2xs': '18rem',
158
190
  xs: '20rem',
@@ -167,6 +199,19 @@ export const tokens = {
167
199
  '6xl': '72rem',
168
200
  '7xl': '80rem',
169
201
  },
202
+ dropShadow: {
203
+ xs: '0 1px 1px rgb(0 0 0 / 0.05)',
204
+ sm: '0 1px 2px rgb(0 0 0 / 0.15)',
205
+ md: '0 3px 3px rgb(0 0 0 / 0.12)',
206
+ lg: '0 4px 4px rgb(0 0 0 / 0.15)',
207
+ xl: '0 9px 7px rgb(0 0 0 / 0.1)',
208
+ '2xl': '0 25px 25px rgb(0 0 0 / 0.15)',
209
+ },
210
+ ease: {
211
+ in: 'cubic-bezier(0.4, 0, 1, 1)',
212
+ out: 'cubic-bezier(0, 0, 0.2, 1)',
213
+ 'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
214
+ },
170
215
  fontFamily: {
171
216
  mono: '"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
172
217
  sans: 'Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
@@ -198,6 +243,11 @@ export const tokens = {
198
243
  extrabold: 800,
199
244
  black: 900,
200
245
  },
246
+ insetShadow: {
247
+ '2xs': 'inset 0 1px rgb(0 0 0 / 0.05)',
248
+ xs: 'inset 0 1px 1px rgb(0 0 0 / 0.05)',
249
+ sm: 'inset 0 2px 4px rgb(0 0 0 / 0.05)',
250
+ },
201
251
  letterSpacing: {
202
252
  tighter: '-0.05em',
203
253
  tight: '-0.025em',
@@ -213,6 +263,33 @@ export const tokens = {
213
263
  relaxed: 1.625,
214
264
  loose: 2,
215
265
  },
266
+ perspective: {
267
+ dramatic: '100px',
268
+ near: '300px',
269
+ normal: '500px',
270
+ midrange: '800px',
271
+ distant: '1200px',
272
+ },
273
+ radius: {
274
+ xs: '0.125rem',
275
+ sm: '0.25rem',
276
+ md: '0.375rem',
277
+ lg: '0.5rem',
278
+ xl: '0.75rem',
279
+ '2xl': '1rem',
280
+ '3xl': '1.5rem',
281
+ '4xl': '2rem',
282
+ },
283
+ shadow: {
284
+ '2xs': '0 1px rgb(0 0 0 / 0.05)',
285
+ xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
286
+ sm: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
287
+ md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
288
+ lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
289
+ xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
290
+ '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
291
+ inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
292
+ },
216
293
  spacing: {
217
294
  0: '0rem',
218
295
  1: '0.25rem',
@@ -246,6 +323,13 @@ export const tokens = {
246
323
  96: '24rem',
247
324
  px: '1px',
248
325
  },
326
+ textShadow: {
327
+ '2xs': '0px 1px 0px rgb(0 0 0 / 0.15)',
328
+ xs: '0px 1px 1px rgb(0 0 0 / 0.2)',
329
+ sm: '0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075)',
330
+ md: '0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1)',
331
+ lg: '0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1)',
332
+ },
249
333
  typography: {
250
334
  button: {
251
335
  '12': {
@@ -598,17 +682,26 @@ export const tokens = {
598
682
  // Generated from tokens by scripts/default-theme.ts; edit tokens and regenerate.
599
683
  const config = Config.create({
600
684
  vars: {
601
- borderRadius: {
602
- xs: '0.125rem',
603
- sm: '0.25rem',
604
- md: '0.375rem',
605
- lg: '0.5rem',
606
- xl: '0.75rem',
607
- '2xl': '1rem',
608
- '3xl': '1.5rem',
609
- '4xl': '2rem',
685
+ animate: {
686
+ spin: 'z-kid-7a-79-7a-7a-2d-73-70-69-6e 1s linear infinite',
687
+ ping: 'z-kid-7a-79-7a-7a-2d-70-69-6e-67 1s cubic-bezier(0, 0, 0.2, 1) infinite',
688
+ pulse:
689
+ 'z-kid-7a-79-7a-7a-2d-70-75-6c-73-65 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
690
+ bounce: 'z-kid-7a-79-7a-7a-2d-62-6f-75-6e-63-65 1s infinite',
691
+ },
692
+ aspect: {
693
+ video: '16 / 9',
610
694
  },
611
- breakpoints: {
695
+ blur: {
696
+ xs: '4px',
697
+ sm: '8px',
698
+ md: '12px',
699
+ lg: '16px',
700
+ xl: '24px',
701
+ '2xl': '40px',
702
+ '3xl': '64px',
703
+ },
704
+ breakpoint: {
612
705
  sm: '40rem',
613
706
  md: '48rem',
614
707
  lg: '64rem',
@@ -733,7 +826,7 @@ const config = Config.create({
733
826
  },
734
827
  white: '#fff',
735
828
  },
736
- containers: {
829
+ container: {
737
830
  '3xs': '16rem',
738
831
  '2xs': '18rem',
739
832
  xs: '20rem',
@@ -748,6 +841,19 @@ const config = Config.create({
748
841
  '6xl': '72rem',
749
842
  '7xl': '80rem',
750
843
  },
844
+ dropShadow: {
845
+ xs: '0 1px 1px rgb(0 0 0 / 0.05)',
846
+ sm: '0 1px 2px rgb(0 0 0 / 0.15)',
847
+ md: '0 3px 3px rgb(0 0 0 / 0.12)',
848
+ lg: '0 4px 4px rgb(0 0 0 / 0.15)',
849
+ xl: '0 9px 7px rgb(0 0 0 / 0.1)',
850
+ '2xl': '0 25px 25px rgb(0 0 0 / 0.15)',
851
+ },
852
+ ease: {
853
+ in: 'cubic-bezier(0.4, 0, 1, 1)',
854
+ out: 'cubic-bezier(0, 0, 0.2, 1)',
855
+ 'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
856
+ },
751
857
  fontFamily: {
752
858
  mono: '"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
753
859
  sans: 'Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
@@ -779,6 +885,11 @@ const config = Config.create({
779
885
  extrabold: 800,
780
886
  black: 900,
781
887
  },
888
+ insetShadow: {
889
+ '2xs': 'inset 0 1px rgb(0 0 0 / 0.05)',
890
+ xs: 'inset 0 1px 1px rgb(0 0 0 / 0.05)',
891
+ sm: 'inset 0 2px 4px rgb(0 0 0 / 0.05)',
892
+ },
782
893
  letterSpacing: {
783
894
  tighter: '-0.05em',
784
895
  tight: '-0.025em',
@@ -794,6 +905,33 @@ const config = Config.create({
794
905
  relaxed: 1.625,
795
906
  loose: 2,
796
907
  },
908
+ perspective: {
909
+ dramatic: '100px',
910
+ near: '300px',
911
+ normal: '500px',
912
+ midrange: '800px',
913
+ distant: '1200px',
914
+ },
915
+ radius: {
916
+ xs: '0.125rem',
917
+ sm: '0.25rem',
918
+ md: '0.375rem',
919
+ lg: '0.5rem',
920
+ xl: '0.75rem',
921
+ '2xl': '1rem',
922
+ '3xl': '1.5rem',
923
+ '4xl': '2rem',
924
+ },
925
+ shadow: {
926
+ '2xs': '0 1px rgb(0 0 0 / 0.05)',
927
+ xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
928
+ sm: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
929
+ md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
930
+ lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
931
+ xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
932
+ '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
933
+ inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
934
+ },
797
935
  spacing: {
798
936
  0: '0rem',
799
937
  1: '0.25rem',
@@ -827,6 +965,13 @@ const config = Config.create({
827
965
  96: '24rem',
828
966
  px: '1px',
829
967
  },
968
+ textShadow: {
969
+ '2xs': '0px 1px 0px rgb(0 0 0 / 0.15)',
970
+ xs: '0px 1px 1px rgb(0 0 0 / 0.2)',
971
+ sm: '0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075)',
972
+ md: '0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1)',
973
+ lg: '0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1)',
974
+ },
830
975
  typography: {
831
976
  button: {
832
977
  '12': {
@@ -98,9 +98,9 @@ export type Keys<
98
98
  ? symbol
99
99
  : Relationship | Query)
100
100
  | Raw
101
- | `@media ${Alias<Names<tokens, 'breakpoints'>>}`
102
- | `@container ${Alias<Names<tokens, 'containers'>>}`
103
- | `@container ${Containers<tokens>} ${Alias<Names<tokens, 'containers'>>}`
101
+ | `@media ${Alias<Names<tokens, 'breakpoint'>>}`
102
+ | `@container ${Alias<Names<tokens, 'container'>>}`
103
+ | `@container ${Containers<tokens>} ${Alias<Names<tokens, 'container'>>}`
104
104
 
105
105
  /** Recognizes structured rule keys before declaration parsing. */
106
106
  export function is(key: string): boolean {
@@ -344,8 +344,8 @@ export function create(
344
344
  const data = theme[Token.definition].queries
345
345
 
346
346
  return JSON.stringify({
347
- breakpoints: Object.keys(data?.breakpoints ?? {}).sort(),
348
- containers: Object.keys(data?.containers ?? {}).sort(),
347
+ breakpoint: Object.keys(data?.breakpoint ?? {}).sort(),
348
+ container: Object.keys(data?.container ?? {}).sort(),
349
349
  containerNames: [...(data?.containerNames ?? [])].sort(),
350
350
  })
351
351
  }
@@ -3,9 +3,9 @@ import * as Literal from './Literal.js'
3
3
 
4
4
  /** Named thresholds and eligible container identities. */
5
5
  export type Metadata = {
6
- readonly breakpoints: Readonly<Record<string, string>>
6
+ readonly breakpoint: Readonly<Record<string, string>>
7
7
  readonly containerNames: readonly string[]
8
- readonly containers: Readonly<Record<string, string>>
8
+ readonly container: Readonly<Record<string, string>>
9
9
  }
10
10
 
11
11
  /** Supported fixed nonnegative threshold lengths. */
@@ -52,7 +52,7 @@ export function resolve(key: string, metadata: Metadata): string {
52
52
  if (pieces.length !== 1) throw new Error('Malformed query alias.')
53
53
 
54
54
  const alias = pieces[0]!
55
- const values = kind === 'media' ? metadata.breakpoints : metadata.containers
55
+ const values = kind === 'media' ? metadata.breakpoint : metadata.container
56
56
 
57
57
  const read = (name: string) => {
58
58
  const value = Object.hasOwn(values, name) ? values[name] : undefined
@@ -239,7 +239,7 @@ type Scalar<group> = group extends
239
239
  NonNullable<Literal.Properties[group]>,
240
240
  'initial' | 'inherit' | 'unset' | 'revert' | 'revert-layer'
241
241
  >
242
- : group extends 'breakpoints' | 'containers'
242
+ : group extends 'breakpoint' | 'container'
243
243
  ? Query.Length
244
244
  : Color
245
245
 
@@ -255,13 +255,13 @@ export type Tokens = {
255
255
  | Palette<Exclude<Literal.Length, `${number}%`>>
256
256
  | undefined
257
257
  /** Compile-time viewport width thresholds. */
258
- readonly breakpoints?: Readonly<Record<string, Query.Length>> | undefined
258
+ readonly breakpoint?: Readonly<Record<string, Query.Length>> | undefined
259
259
  /** Shared colors available to every supported color property. */
260
260
  readonly color?: Palette<Color> | undefined
261
261
  /** Finite CSS container identities for named queries. */
262
262
  readonly containerNames?: readonly string[] | undefined
263
263
  /** Compile-time container width thresholds. */
264
- readonly containers?: Readonly<Record<string, Query.Length>> | undefined
264
+ readonly container?: Readonly<Record<string, Query.Length>> | undefined
265
265
  /** Font family token values; does not load font files. */
266
266
  readonly fontFamily?:
267
267
  | Palette<NonNullable<Literal.Properties['fontFamily']>>
@@ -308,14 +308,14 @@ function build(
308
308
  )
309
309
 
310
310
  const queries = {
311
- breakpoints: Object.assign(
311
+ breakpoint: Object.assign(
312
312
  Object.create(null),
313
- baseQueries?.breakpoints,
313
+ baseQueries?.breakpoint,
314
314
  ) as Record<string, string>,
315
315
  containerNames: baseQueries?.containerNames ?? [],
316
- containers: Object.assign(
316
+ container: Object.assign(
317
317
  Object.create(null),
318
- baseQueries?.containers,
318
+ baseQueries?.container,
319
319
  ) as Record<string, string>,
320
320
  }
321
321
 
@@ -486,13 +486,13 @@ function build(
486
486
  continue
487
487
  }
488
488
 
489
- if (group === 'breakpoints' || group === 'containers') {
489
+ if (group === 'breakpoint' || group === 'container') {
490
490
  hasQueries = true
491
491
 
492
492
  for (const [name, value] of record(palette, [group])) {
493
493
  if (
494
494
  !/^[a-zA-Z0-9_][a-zA-Z0-9_-]*$/.test(name) ||
495
- (group === 'breakpoints' &&
495
+ (group === 'breakpoint' &&
496
496
  ['all', 'screen', 'print'].includes(name)) ||
497
497
  !Query.threshold(value)
498
498
  )
@@ -628,9 +628,9 @@ function build(
628
628
  ...(hasQueries
629
629
  ? {
630
630
  queries: Object.freeze({
631
- breakpoints: Object.freeze(queries.breakpoints),
631
+ breakpoint: Object.freeze(queries.breakpoint),
632
632
  containerNames: queries.containerNames,
633
- containers: Object.freeze(queries.containers),
633
+ container: Object.freeze(queries.container),
634
634
  }),
635
635
  }
636
636
  : {}),
@@ -785,7 +785,7 @@ type ValidTree<tree, group> = tree extends string | number
785
785
  ? group extends 'typography'
786
786
  ? never
787
787
  : tree extends Scalar<group>
788
- ? group extends 'breakpoints' | 'containers'
788
+ ? group extends 'breakpoint' | 'container'
789
789
  ? tree extends `-${string}`
790
790
  ? never
791
791
  : Literal.Checked<tree>