tailwindcss 0.0.0-insiders.fe08e91 → 0.0.0-oxide.6d7c311

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 (186) hide show
  1. package/CHANGELOG.md +384 -3
  2. package/LICENSE +1 -2
  3. package/README.md +12 -8
  4. package/colors.d.ts +3 -0
  5. package/defaultConfig.d.ts +3 -0
  6. package/defaultTheme.d.ts +4 -0
  7. package/lib/cli/build/deps.js +54 -0
  8. package/lib/cli/build/index.js +48 -0
  9. package/lib/cli/build/plugin.js +367 -0
  10. package/lib/cli/build/utils.js +78 -0
  11. package/lib/cli/build/watching.js +178 -0
  12. package/lib/cli/help/index.js +71 -0
  13. package/lib/cli/index.js +239 -0
  14. package/lib/cli/init/index.js +46 -0
  15. package/lib/cli/shared.js +13 -0
  16. package/lib/cli-peer-dependencies.js +20 -7
  17. package/lib/cli.js +4 -740
  18. package/lib/constants.js +27 -20
  19. package/lib/corePluginList.js +6 -3
  20. package/lib/corePlugins.js +2064 -1811
  21. package/lib/css/preflight.css +5 -5
  22. package/lib/featureFlags.js +31 -22
  23. package/lib/index.js +4 -28
  24. package/lib/lib/cacheInvalidation.js +90 -0
  25. package/lib/lib/collapseAdjacentRules.js +27 -9
  26. package/lib/lib/collapseDuplicateDeclarations.js +12 -9
  27. package/lib/lib/content.js +176 -0
  28. package/lib/lib/defaultExtractor.js +225 -31
  29. package/lib/lib/detectNesting.js +13 -10
  30. package/lib/lib/evaluateTailwindFunctions.js +118 -55
  31. package/lib/lib/expandApplyAtRules.js +439 -190
  32. package/lib/lib/expandTailwindAtRules.js +151 -134
  33. package/lib/lib/findAtConfigPath.js +44 -0
  34. package/lib/lib/generateRules.js +454 -187
  35. package/lib/lib/getModuleDependencies.js +11 -8
  36. package/lib/lib/normalizeTailwindDirectives.js +36 -32
  37. package/lib/lib/offsets.js +217 -0
  38. package/lib/lib/partitionApplyAtRules.js +56 -0
  39. package/lib/lib/regex.js +60 -0
  40. package/lib/lib/resolveDefaultsAtRules.js +89 -67
  41. package/lib/lib/setupContextUtils.js +667 -376
  42. package/lib/lib/setupTrackingContext.js +38 -67
  43. package/lib/lib/sharedState.js +27 -14
  44. package/lib/lib/substituteScreenAtRules.js +11 -9
  45. package/lib/oxide/cli.d.js +1 -0
  46. package/lib/oxide/cli.js +2 -0
  47. package/lib/oxide/postcss-plugin.d.js +1 -0
  48. package/lib/oxide/postcss-plugin.js +2 -0
  49. package/lib/plugin.js +48 -0
  50. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  51. package/lib/postcss-plugins/nesting/index.js +19 -0
  52. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  53. package/lib/processTailwindFeatures.js +35 -25
  54. package/lib/public/colors.js +247 -245
  55. package/lib/public/create-plugin.js +6 -4
  56. package/lib/public/default-config.js +7 -5
  57. package/lib/public/default-theme.js +7 -5
  58. package/lib/public/resolve-config.js +8 -5
  59. package/lib/util/bigSign.js +4 -1
  60. package/lib/util/buildMediaQuery.js +11 -6
  61. package/lib/util/cloneDeep.js +7 -6
  62. package/lib/util/cloneNodes.js +21 -3
  63. package/lib/util/color.js +53 -54
  64. package/lib/util/configurePlugins.js +5 -2
  65. package/lib/util/createPlugin.js +6 -6
  66. package/lib/util/createUtilityPlugin.js +12 -14
  67. package/lib/util/dataTypes.js +119 -110
  68. package/lib/util/defaults.js +4 -1
  69. package/lib/util/escapeClassName.js +7 -4
  70. package/lib/util/escapeCommas.js +5 -2
  71. package/lib/util/flattenColorPalette.js +9 -12
  72. package/lib/util/formatVariantSelector.js +184 -85
  73. package/lib/util/getAllConfigs.js +27 -8
  74. package/lib/util/hashConfig.js +6 -3
  75. package/lib/util/isKeyframeRule.js +5 -2
  76. package/lib/util/isPlainObject.js +5 -2
  77. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +23 -15
  78. package/lib/util/log.js +20 -14
  79. package/lib/util/nameClass.js +20 -9
  80. package/lib/util/negateValue.js +23 -8
  81. package/lib/util/normalizeConfig.js +116 -72
  82. package/lib/util/normalizeScreens.js +120 -11
  83. package/lib/util/parseAnimationValue.js +42 -40
  84. package/lib/util/parseBoxShadowValue.js +30 -23
  85. package/lib/util/parseDependency.js +38 -56
  86. package/lib/util/parseGlob.js +34 -0
  87. package/lib/util/parseObjectStyles.js +11 -8
  88. package/lib/util/pluginUtils.js +147 -50
  89. package/lib/util/prefixSelector.js +10 -8
  90. package/lib/util/removeAlphaVariables.js +29 -0
  91. package/lib/util/resolveConfig.js +97 -85
  92. package/lib/util/resolveConfigPath.js +11 -9
  93. package/lib/util/responsive.js +8 -5
  94. package/lib/util/splitAtTopLevelOnly.js +43 -0
  95. package/lib/util/tap.js +4 -1
  96. package/lib/util/toColorValue.js +5 -3
  97. package/lib/util/toPath.js +20 -4
  98. package/lib/util/transformThemeValue.js +37 -29
  99. package/lib/util/validateConfig.js +24 -0
  100. package/lib/util/validateFormalSyntax.js +24 -0
  101. package/lib/util/withAlphaVariable.js +23 -15
  102. package/nesting/index.js +2 -12
  103. package/package.json +52 -46
  104. package/peers/index.js +11381 -7950
  105. package/plugin.d.ts +11 -0
  106. package/resolveConfig.d.ts +12 -0
  107. package/scripts/generate-types.js +105 -0
  108. package/scripts/release-channel.js +18 -0
  109. package/scripts/release-notes.js +21 -0
  110. package/scripts/type-utils.js +27 -0
  111. package/src/cli/build/deps.js +56 -0
  112. package/src/cli/build/index.js +49 -0
  113. package/src/cli/build/plugin.js +439 -0
  114. package/src/cli/build/utils.js +76 -0
  115. package/src/cli/build/watching.js +227 -0
  116. package/src/cli/help/index.js +70 -0
  117. package/src/cli/index.js +234 -0
  118. package/src/cli/init/index.js +50 -0
  119. package/src/cli/shared.js +6 -0
  120. package/src/cli-peer-dependencies.js +7 -1
  121. package/src/cli.js +4 -810
  122. package/src/corePluginList.js +1 -1
  123. package/src/corePlugins.js +532 -217
  124. package/src/css/preflight.css +5 -5
  125. package/src/featureFlags.js +15 -9
  126. package/src/index.js +4 -27
  127. package/src/lib/cacheInvalidation.js +52 -0
  128. package/src/lib/collapseAdjacentRules.js +21 -2
  129. package/src/lib/content.js +212 -0
  130. package/src/lib/defaultExtractor.js +196 -33
  131. package/src/lib/evaluateTailwindFunctions.js +78 -7
  132. package/src/lib/expandApplyAtRules.js +482 -183
  133. package/src/lib/expandTailwindAtRules.js +106 -85
  134. package/src/lib/findAtConfigPath.js +48 -0
  135. package/src/lib/generateRules.js +418 -129
  136. package/src/lib/normalizeTailwindDirectives.js +1 -0
  137. package/src/lib/offsets.js +270 -0
  138. package/src/lib/partitionApplyAtRules.js +52 -0
  139. package/src/lib/regex.js +74 -0
  140. package/src/lib/resolveDefaultsAtRules.js +51 -30
  141. package/src/lib/setupContextUtils.js +556 -208
  142. package/src/lib/setupTrackingContext.js +11 -48
  143. package/src/lib/sharedState.js +5 -0
  144. package/src/oxide/cli.d.ts +0 -0
  145. package/src/oxide/cli.ts +1 -0
  146. package/src/oxide/postcss-plugin.d.ts +0 -0
  147. package/src/oxide/postcss-plugin.ts +1 -0
  148. package/src/plugin.js +47 -0
  149. package/src/postcss-plugins/nesting/README.md +42 -0
  150. package/src/postcss-plugins/nesting/index.js +13 -0
  151. package/src/postcss-plugins/nesting/plugin.js +80 -0
  152. package/src/processTailwindFeatures.js +8 -0
  153. package/src/util/buildMediaQuery.js +5 -3
  154. package/src/util/cloneNodes.js +19 -2
  155. package/src/util/color.js +25 -21
  156. package/src/util/dataTypes.js +29 -21
  157. package/src/util/formatVariantSelector.js +184 -61
  158. package/src/util/getAllConfigs.js +19 -0
  159. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  160. package/src/util/log.js +8 -8
  161. package/src/util/nameClass.js +4 -0
  162. package/src/util/negateValue.js +11 -3
  163. package/src/util/normalizeConfig.js +44 -6
  164. package/src/util/normalizeScreens.js +99 -4
  165. package/src/util/parseBoxShadowValue.js +4 -3
  166. package/src/util/parseDependency.js +37 -42
  167. package/src/util/parseGlob.js +24 -0
  168. package/src/util/pluginUtils.js +132 -10
  169. package/src/util/prefixSelector.js +7 -5
  170. package/src/util/removeAlphaVariables.js +24 -0
  171. package/src/util/resolveConfig.js +70 -32
  172. package/src/util/splitAtTopLevelOnly.js +45 -0
  173. package/src/util/toPath.js +1 -1
  174. package/src/util/transformThemeValue.js +13 -3
  175. package/src/util/validateConfig.js +13 -0
  176. package/src/util/validateFormalSyntax.js +34 -0
  177. package/src/util/withAlphaVariable.js +1 -1
  178. package/stubs/defaultConfig.stub.js +167 -164
  179. package/stubs/simpleConfig.stub.js +1 -0
  180. package/types/config.d.ts +362 -0
  181. package/types/generated/.gitkeep +0 -0
  182. package/types/generated/colors.d.ts +276 -0
  183. package/types/generated/corePluginList.d.ts +1 -0
  184. package/types/generated/default-theme.d.ts +342 -0
  185. package/types/index.d.ts +7 -0
  186. package/nesting/plugin.js +0 -41
@@ -3,6 +3,7 @@ import * as path from 'path'
3
3
  import postcss from 'postcss'
4
4
  import createUtilityPlugin from './util/createUtilityPlugin'
5
5
  import buildMediaQuery from './util/buildMediaQuery'
6
+ import escapeClassName from './util/escapeClassName'
6
7
  import parseAnimationValue from './util/parseAnimationValue'
7
8
  import flattenColorPalette from './util/flattenColorPalette'
8
9
  import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
@@ -11,21 +12,43 @@ import isPlainObject from './util/isPlainObject'
11
12
  import transformThemeValue from './util/transformThemeValue'
12
13
  import { version as tailwindVersion } from '../package.json'
13
14
  import log from './util/log'
14
- import { normalizeScreens } from './util/normalizeScreens'
15
+ import {
16
+ normalizeScreens,
17
+ isScreenSortable,
18
+ compareScreens,
19
+ toScreen,
20
+ } from './util/normalizeScreens'
15
21
  import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
22
+ import { removeAlphaVariables } from './util/removeAlphaVariables'
23
+ import { flagEnabled } from './featureFlags'
24
+ import { normalize } from './util/dataTypes'
16
25
 
17
26
  export let variantPlugins = {
18
27
  pseudoElementVariants: ({ addVariant }) => {
19
28
  addVariant('first-letter', '&::first-letter')
20
29
  addVariant('first-line', '&::first-line')
21
30
 
22
- addVariant('marker', ['& *::marker', '&::marker'])
31
+ addVariant('marker', [
32
+ ({ container }) => {
33
+ removeAlphaVariables(container, ['--tw-text-opacity'])
34
+
35
+ return '& *::marker'
36
+ },
37
+ ({ container }) => {
38
+ removeAlphaVariables(container, ['--tw-text-opacity'])
39
+
40
+ return '&::marker'
41
+ },
42
+ ])
43
+
23
44
  addVariant('selection', ['& *::selection', '&::selection'])
24
45
 
25
46
  addVariant('file', '&::file-selector-button')
26
47
 
27
48
  addVariant('placeholder', '&::placeholder')
28
49
 
50
+ addVariant('backdrop', '&::backdrop')
51
+
29
52
  addVariant('before', ({ container }) => {
30
53
  container.walkRules((rule) => {
31
54
  let foundContent = false
@@ -57,22 +80,33 @@ export let variantPlugins = {
57
80
  })
58
81
  },
59
82
 
60
- pseudoClassVariants: ({ addVariant }) => {
83
+ pseudoClassVariants: ({ addVariant, matchVariant, config }) => {
61
84
  let pseudoVariants = [
62
85
  // Positional
63
- ['first', ':first-child'],
64
- ['last', ':last-child'],
65
- ['only', ':only-child'],
66
- ['odd', ':nth-child(odd)'],
67
- ['even', ':nth-child(even)'],
86
+ ['first', '&:first-child'],
87
+ ['last', '&:last-child'],
88
+ ['only', '&:only-child'],
89
+ ['odd', '&:nth-child(odd)'],
90
+ ['even', '&:nth-child(even)'],
68
91
  'first-of-type',
69
92
  'last-of-type',
70
93
  'only-of-type',
71
94
 
72
95
  // State
73
- 'visited',
96
+ [
97
+ 'visited',
98
+ ({ container }) => {
99
+ removeAlphaVariables(container, [
100
+ '--tw-text-opacity',
101
+ '--tw-border-opacity',
102
+ '--tw-bg-opacity',
103
+ ])
104
+
105
+ return '&:visited'
106
+ },
107
+ ],
74
108
  'target',
75
- ['open', '[open]'],
109
+ ['open', '&[open]'],
76
110
 
77
111
  // Forms
78
112
  'default',
@@ -80,6 +114,7 @@ export let variantPlugins = {
80
114
  'indeterminate',
81
115
  'placeholder-shown',
82
116
  'autofill',
117
+ 'optional',
83
118
  'required',
84
119
  'valid',
85
120
  'invalid',
@@ -92,23 +127,46 @@ export let variantPlugins = {
92
127
 
93
128
  // Interactive
94
129
  'focus-within',
95
- 'hover',
130
+ [
131
+ 'hover',
132
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
133
+ ? '&:hover'
134
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
135
+ ],
96
136
  'focus',
97
137
  'focus-visible',
98
138
  'active',
139
+ 'enabled',
99
140
  'disabled',
100
- ].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
141
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
101
142
 
102
143
  for (let [variantName, state] of pseudoVariants) {
103
- addVariant(variantName, `&${state}`)
144
+ addVariant(variantName, (ctx) => {
145
+ let result = typeof state === 'function' ? state(ctx) : state
146
+
147
+ return result
148
+ })
104
149
  }
105
150
 
106
- for (let [variantName, state] of pseudoVariants) {
107
- addVariant(`group-${variantName}`, `:merge(.group)${state} &`)
151
+ let variants = {
152
+ group: (_, { modifier }) =>
153
+ modifier ? [`:merge(.group\\/${modifier})`, ' &'] : [`:merge(.group)`, ' &'],
154
+ peer: (_, { modifier }) =>
155
+ modifier ? [`:merge(.peer\\/${modifier})`, ' ~ &'] : [`:merge(.peer)`, ' ~ &'],
108
156
  }
109
157
 
110
- for (let [variantName, state] of pseudoVariants) {
111
- addVariant(`peer-${variantName}`, `:merge(.peer)${state} ~ &`)
158
+ for (let [name, fn] of Object.entries(variants)) {
159
+ matchVariant(
160
+ name,
161
+ (value = '', extra) => {
162
+ let result = normalize(typeof value === 'function' ? value(extra) : value)
163
+ if (!result.includes('&')) result = '&' + result
164
+
165
+ let [a, b] = fn('', extra)
166
+ return result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
167
+ },
168
+ { values: Object.fromEntries(pseudoVariants) }
169
+ )
112
170
  }
113
171
  },
114
172
 
@@ -138,17 +196,19 @@ export let variantPlugins = {
138
196
  },
139
197
 
140
198
  darkVariants: ({ config, addVariant }) => {
141
- let mode = config('darkMode', 'media')
199
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
200
+
142
201
  if (mode === false) {
143
202
  mode = 'media'
144
203
  log.warn('darkmode-false', [
145
204
  'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
146
205
  'Change `darkMode` to `media` or remove it entirely.',
206
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
147
207
  ])
148
208
  }
149
209
 
150
210
  if (mode === 'class') {
151
- addVariant('dark', '.dark &')
211
+ addVariant('dark', `${className} &`)
152
212
  } else if (mode === 'media') {
153
213
  addVariant('dark', '@media (prefers-color-scheme: dark)')
154
214
  }
@@ -158,20 +218,246 @@ export let variantPlugins = {
158
218
  addVariant('print', '@media print')
159
219
  },
160
220
 
161
- screenVariants: ({ theme, addVariant }) => {
162
- for (let screen of normalizeScreens(theme('screens'))) {
163
- let query = buildMediaQuery(screen)
221
+ screenVariants: ({ theme, addVariant, matchVariant }) => {
222
+ let rawScreens = theme('screens') ?? {}
223
+ let areSimpleScreens = Object.values(rawScreens).every((v) => typeof v === 'string')
224
+ let screens = normalizeScreens(theme('screens'))
225
+
226
+ /** @type {Set<string>} */
227
+ let unitCache = new Set([])
228
+
229
+ /** @param {string} value */
230
+ function units(value) {
231
+ return value.match(/(\D+)$/)?.[1] ?? '(none)'
232
+ }
233
+
234
+ /** @param {string} value */
235
+ function recordUnits(value) {
236
+ if (value !== undefined) {
237
+ unitCache.add(units(value))
238
+ }
239
+ }
240
+
241
+ /** @param {string} value */
242
+ function canUseUnits(value) {
243
+ recordUnits(value)
164
244
 
165
- addVariant(screen.name, `@media ${query}`)
245
+ // If the cache was empty it'll become 1 because we've just added the current unit
246
+ // If the cache was not empty and the units are the same the size doesn't change
247
+ // Otherwise, if the units are different from what is already known the size will always be > 1
248
+ return unitCache.size === 1
166
249
  }
250
+
251
+ for (const screen of screens) {
252
+ for (const value of screen.values) {
253
+ recordUnits(value.min)
254
+ recordUnits(value.max)
255
+ }
256
+ }
257
+
258
+ let screensUseConsistentUnits = unitCache.size <= 1
259
+
260
+ /**
261
+ * @typedef {import('./util/normalizeScreens').Screen} Screen
262
+ */
263
+
264
+ /**
265
+ * @param {'min' | 'max'} type
266
+ * @returns {Record<string, Screen>}
267
+ */
268
+ function buildScreenValues(type) {
269
+ return Object.fromEntries(
270
+ screens
271
+ .filter((screen) => isScreenSortable(screen).result)
272
+ .map((screen) => {
273
+ let { min, max } = screen.values[0]
274
+
275
+ if (type === 'min' && min !== undefined) {
276
+ return screen
277
+ } else if (type === 'min' && max !== undefined) {
278
+ return { ...screen, not: !screen.not }
279
+ } else if (type === 'max' && max !== undefined) {
280
+ return screen
281
+ } else if (type === 'max' && min !== undefined) {
282
+ return { ...screen, not: !screen.not }
283
+ }
284
+ })
285
+ .map((screen) => [screen.name, screen])
286
+ )
287
+ }
288
+
289
+ /**
290
+ * @param {'min' | 'max'} type
291
+ * @returns {(a: { value: string | Screen }, z: { value: string | Screen }) => number}
292
+ */
293
+ function buildSort(type) {
294
+ return (a, z) => compareScreens(type, a.value, z.value)
295
+ }
296
+
297
+ let maxSort = buildSort('max')
298
+ let minSort = buildSort('min')
299
+
300
+ /** @param {'min'|'max'} type */
301
+ function buildScreenVariant(type) {
302
+ return (value) => {
303
+ if (!areSimpleScreens) {
304
+ log.warn('complex-screen-config', [
305
+ 'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects.',
306
+ ])
307
+
308
+ return []
309
+ } else if (!screensUseConsistentUnits) {
310
+ log.warn('mixed-screen-units', [
311
+ 'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
312
+ ])
313
+
314
+ return []
315
+ } else if (typeof value === 'string' && !canUseUnits(value)) {
316
+ log.warn('minmax-have-mixed-units', [
317
+ 'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
318
+ ])
319
+
320
+ return []
321
+ }
322
+
323
+ return [`@media ${buildMediaQuery(toScreen(value, type))}`]
324
+ }
325
+ }
326
+
327
+ matchVariant('max', buildScreenVariant('max'), {
328
+ sort: maxSort,
329
+ values: areSimpleScreens ? buildScreenValues('max') : {},
330
+ })
331
+
332
+ // screens and min-* are sorted together when they can be
333
+ let id = 'min-screens'
334
+ for (let screen of screens) {
335
+ addVariant(screen.name, `@media ${buildMediaQuery(screen)}`, {
336
+ id,
337
+ sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined,
338
+ value: screen,
339
+ })
340
+ }
341
+
342
+ matchVariant('min', buildScreenVariant('min'), {
343
+ id,
344
+ sort: minSort,
345
+ })
346
+ },
347
+
348
+ supportsVariants: ({ matchVariant, theme }) => {
349
+ matchVariant(
350
+ 'supports',
351
+ (value = '') => {
352
+ let check = normalize(value)
353
+ let isRaw = /^\w*\s*\(/.test(check)
354
+
355
+ // Chrome has a bug where `(condtion1)or(condition2)` is not valid
356
+ // But `(condition1) or (condition2)` is supported.
357
+ check = isRaw ? check.replace(/\b(and|or|not)\b/g, ' $1 ') : check
358
+
359
+ if (isRaw) {
360
+ return `@supports ${check}`
361
+ }
362
+
363
+ if (!check.includes(':')) {
364
+ check = `${check}: var(--tw)`
365
+ }
366
+
367
+ if (!(check.startsWith('(') && check.endsWith(')'))) {
368
+ check = `(${check})`
369
+ }
370
+
371
+ return `@supports ${check}`
372
+ },
373
+ { values: theme('supports') ?? {} }
374
+ )
375
+ },
376
+
377
+ ariaVariants: ({ matchVariant, theme }) => {
378
+ matchVariant('aria', (value) => `&[aria-${normalize(value)}]`, { values: theme('aria') ?? {} })
379
+ matchVariant(
380
+ 'group-aria',
381
+ (value, { modifier }) =>
382
+ modifier
383
+ ? `:merge(.group\\/${modifier})[aria-${normalize(value)}] &`
384
+ : `:merge(.group)[aria-${normalize(value)}] &`,
385
+ { values: theme('aria') ?? {} }
386
+ )
387
+ matchVariant(
388
+ 'peer-aria',
389
+ (value, { modifier }) =>
390
+ modifier
391
+ ? `:merge(.peer\\/${modifier})[aria-${normalize(value)}] ~ &`
392
+ : `:merge(.peer)[aria-${normalize(value)}] ~ &`,
393
+ { values: theme('aria') ?? {} }
394
+ )
395
+ },
396
+
397
+ dataVariants: ({ matchVariant, theme }) => {
398
+ matchVariant('data', (value) => `&[data-${normalize(value)}]`, { values: theme('data') ?? {} })
399
+ matchVariant(
400
+ 'group-data',
401
+ (value, { modifier }) =>
402
+ modifier
403
+ ? `:merge(.group\\/${modifier})[data-${normalize(value)}] &`
404
+ : `:merge(.group)[data-${normalize(value)}] &`,
405
+ { values: theme('data') ?? {} }
406
+ )
407
+ matchVariant(
408
+ 'peer-data',
409
+ (value, { modifier }) =>
410
+ modifier
411
+ ? `:merge(.peer\\/${modifier})[data-${normalize(value)}] ~ &`
412
+ : `:merge(.peer)[data-${normalize(value)}] ~ &`,
413
+ { values: theme('data') ?? {} }
414
+ )
167
415
  },
168
416
 
169
417
  orientationVariants: ({ addVariant }) => {
170
418
  addVariant('portrait', '@media (orientation: portrait)')
171
419
  addVariant('landscape', '@media (orientation: landscape)')
172
420
  },
421
+
422
+ prefersContrastVariants: ({ addVariant }) => {
423
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
424
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
425
+ },
173
426
  }
174
427
 
428
+ let cssTransformValue = [
429
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
430
+ 'rotate(var(--tw-rotate))',
431
+ 'skewX(var(--tw-skew-x))',
432
+ 'skewY(var(--tw-skew-y))',
433
+ 'scaleX(var(--tw-scale-x))',
434
+ 'scaleY(var(--tw-scale-y))',
435
+ ].join(' ')
436
+
437
+ let cssFilterValue = [
438
+ 'var(--tw-blur)',
439
+ 'var(--tw-brightness)',
440
+ 'var(--tw-contrast)',
441
+ 'var(--tw-grayscale)',
442
+ 'var(--tw-hue-rotate)',
443
+ 'var(--tw-invert)',
444
+ 'var(--tw-saturate)',
445
+ 'var(--tw-sepia)',
446
+ 'var(--tw-drop-shadow)',
447
+ ].join(' ')
448
+
449
+ let cssBackdropFilterValue = [
450
+ 'var(--tw-backdrop-blur)',
451
+ 'var(--tw-backdrop-brightness)',
452
+ 'var(--tw-backdrop-contrast)',
453
+ 'var(--tw-backdrop-grayscale)',
454
+ 'var(--tw-backdrop-hue-rotate)',
455
+ 'var(--tw-backdrop-invert)',
456
+ 'var(--tw-backdrop-opacity)',
457
+ 'var(--tw-backdrop-saturate)',
458
+ 'var(--tw-backdrop-sepia)',
459
+ ].join(' ')
460
+
175
461
  export let corePlugins = {
176
462
  preflight: ({ addBase }) => {
177
463
  let preflightStyles = postcss.parse(
@@ -310,6 +596,7 @@ export let corePlugins = {
310
596
  addUtilities({
311
597
  '.visible': { visibility: 'visible' },
312
598
  '.invisible': { visibility: 'hidden' },
599
+ '.collapse': { visibility: 'collapse' },
313
600
  })
314
601
  },
315
602
 
@@ -460,6 +747,41 @@ export let corePlugins = {
460
747
  })
461
748
  },
462
749
 
750
+ borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
751
+ addDefaults('border-spacing', {
752
+ '--tw-border-spacing-x': 0,
753
+ '--tw-border-spacing-y': 0,
754
+ })
755
+
756
+ matchUtilities(
757
+ {
758
+ 'border-spacing': (value) => {
759
+ return {
760
+ '--tw-border-spacing-x': value,
761
+ '--tw-border-spacing-y': value,
762
+ '@defaults border-spacing': {},
763
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
764
+ }
765
+ },
766
+ 'border-spacing-x': (value) => {
767
+ return {
768
+ '--tw-border-spacing-x': value,
769
+ '@defaults border-spacing': {},
770
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
771
+ }
772
+ },
773
+ 'border-spacing-y': (value) => {
774
+ return {
775
+ '--tw-border-spacing-y': value,
776
+ '@defaults border-spacing': {},
777
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
778
+ }
779
+ },
780
+ },
781
+ { values: theme('borderSpacing') }
782
+ )
783
+ },
784
+
463
785
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
464
786
  translate: createUtilityPlugin(
465
787
  'translate',
@@ -467,11 +789,11 @@ export let corePlugins = {
467
789
  [
468
790
  [
469
791
  'translate-x',
470
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
792
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
471
793
  ],
472
794
  [
473
795
  'translate-y',
474
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
796
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
475
797
  ],
476
798
  ],
477
799
  ],
@@ -479,26 +801,15 @@ export let corePlugins = {
479
801
  ),
480
802
  rotate: createUtilityPlugin(
481
803
  'rotate',
482
- [
483
- [
484
- 'rotate',
485
- [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
486
- ],
487
- ],
804
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
488
805
  { supportsNegativeValues: true }
489
806
  ),
490
807
  skew: createUtilityPlugin(
491
808
  'skew',
492
809
  [
493
810
  [
494
- [
495
- 'skew-x',
496
- [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
497
- ],
498
- [
499
- 'skew-y',
500
- [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
501
- ],
811
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
812
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
502
813
  ],
503
814
  ],
504
815
  { supportsNegativeValues: true }
@@ -512,17 +823,17 @@ export let corePlugins = {
512
823
  ['@defaults transform', {}],
513
824
  '--tw-scale-x',
514
825
  '--tw-scale-y',
515
- ['transform', 'var(--tw-transform)'],
826
+ ['transform', cssTransformValue],
516
827
  ],
517
828
  ],
518
829
  [
519
830
  [
520
831
  'scale-x',
521
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
832
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
522
833
  ],
523
834
  [
524
835
  'scale-y',
525
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
836
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
526
837
  ],
527
838
  ],
528
839
  ],
@@ -538,46 +849,25 @@ export let corePlugins = {
538
849
  '--tw-skew-y': '0',
539
850
  '--tw-scale-x': '1',
540
851
  '--tw-scale-y': '1',
541
- '--tw-transform': [
542
- 'translateX(var(--tw-translate-x))',
543
- 'translateY(var(--tw-translate-y))',
544
- 'rotate(var(--tw-rotate))',
545
- 'skewX(var(--tw-skew-x))',
546
- 'skewY(var(--tw-skew-y))',
547
- 'scaleX(var(--tw-scale-x))',
548
- 'scaleY(var(--tw-scale-y))',
549
- ].join(' '),
550
852
  })
551
853
 
552
854
  addUtilities({
553
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
855
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
554
856
  '.transform-cpu': {
555
- '--tw-transform': [
556
- 'translateX(var(--tw-translate-x))',
557
- 'translateY(var(--tw-translate-y))',
558
- 'rotate(var(--tw-rotate))',
559
- 'skewX(var(--tw-skew-x))',
560
- 'skewY(var(--tw-skew-y))',
561
- 'scaleX(var(--tw-scale-x))',
562
- 'scaleY(var(--tw-scale-y))',
563
- ].join(' '),
857
+ transform: cssTransformValue,
564
858
  },
565
859
  '.transform-gpu': {
566
- '--tw-transform': [
567
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
568
- 'rotate(var(--tw-rotate))',
569
- 'skewX(var(--tw-skew-x))',
570
- 'skewY(var(--tw-skew-y))',
571
- 'scaleX(var(--tw-scale-x))',
572
- 'scaleY(var(--tw-scale-y))',
573
- ].join(' '),
860
+ transform: cssTransformValue.replace(
861
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
862
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
863
+ ),
574
864
  },
575
865
  '.transform-none': { transform: 'none' },
576
866
  })
577
867
  },
578
868
 
579
- animation: ({ matchUtilities, theme, prefix }) => {
580
- let prefixName = (name) => prefix(`.${name}`).slice(1)
869
+ animation: ({ matchUtilities, theme, config }) => {
870
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
581
871
  let keyframes = Object.fromEntries(
582
872
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
583
873
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -612,49 +902,50 @@ export let corePlugins = {
612
902
 
613
903
  touchAction: ({ addDefaults, addUtilities }) => {
614
904
  addDefaults('touch-action', {
615
- '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
616
- '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
617
- '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
618
- '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
905
+ '--tw-pan-x': ' ',
906
+ '--tw-pan-y': ' ',
907
+ '--tw-pinch-zoom': ' ',
619
908
  })
620
909
 
910
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
911
+
621
912
  addUtilities({
622
913
  '.touch-auto': { 'touch-action': 'auto' },
623
914
  '.touch-none': { 'touch-action': 'none' },
624
915
  '.touch-pan-x': {
625
916
  '@defaults touch-action': {},
626
917
  '--tw-pan-x': 'pan-x',
627
- 'touch-action': 'var(--tw-touch-action)',
918
+ 'touch-action': cssTouchActionValue,
628
919
  },
629
920
  '.touch-pan-left': {
630
921
  '@defaults touch-action': {},
631
922
  '--tw-pan-x': 'pan-left',
632
- 'touch-action': 'var(--tw-touch-action)',
923
+ 'touch-action': cssTouchActionValue,
633
924
  },
634
925
  '.touch-pan-right': {
635
926
  '@defaults touch-action': {},
636
927
  '--tw-pan-x': 'pan-right',
637
- 'touch-action': 'var(--tw-touch-action)',
928
+ 'touch-action': cssTouchActionValue,
638
929
  },
639
930
  '.touch-pan-y': {
640
931
  '@defaults touch-action': {},
641
932
  '--tw-pan-y': 'pan-y',
642
- 'touch-action': 'var(--tw-touch-action)',
933
+ 'touch-action': cssTouchActionValue,
643
934
  },
644
935
  '.touch-pan-up': {
645
936
  '@defaults touch-action': {},
646
937
  '--tw-pan-y': 'pan-up',
647
- 'touch-action': 'var(--tw-touch-action)',
938
+ 'touch-action': cssTouchActionValue,
648
939
  },
649
940
  '.touch-pan-down': {
650
941
  '@defaults touch-action': {},
651
942
  '--tw-pan-y': 'pan-down',
652
- 'touch-action': 'var(--tw-touch-action)',
943
+ 'touch-action': cssTouchActionValue,
653
944
  },
654
945
  '.touch-pinch-zoom': {
655
946
  '@defaults touch-action': {},
656
947
  '--tw-pinch-zoom': 'pinch-zoom',
657
- 'touch-action': 'var(--tw-touch-action)',
948
+ 'touch-action': cssTouchActionValue,
658
949
  },
659
950
  '.touch-manipulation': { 'touch-action': 'manipulation' },
660
951
  })
@@ -808,6 +1099,7 @@ export let corePlugins = {
808
1099
  addUtilities({
809
1100
  '.grid-flow-row': { gridAutoFlow: 'row' },
810
1101
  '.grid-flow-col': { gridAutoFlow: 'column' },
1102
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
811
1103
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
812
1104
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
813
1105
  })
@@ -844,6 +1136,7 @@ export let corePlugins = {
844
1136
  '.place-content-between': { 'place-content': 'space-between' },
845
1137
  '.place-content-around': { 'place-content': 'space-around' },
846
1138
  '.place-content-evenly': { 'place-content': 'space-evenly' },
1139
+ '.place-content-baseline': { 'place-content': 'baseline' },
847
1140
  '.place-content-stretch': { 'place-content': 'stretch' },
848
1141
  })
849
1142
  },
@@ -853,6 +1146,7 @@ export let corePlugins = {
853
1146
  '.place-items-start': { 'place-items': 'start' },
854
1147
  '.place-items-end': { 'place-items': 'end' },
855
1148
  '.place-items-center': { 'place-items': 'center' },
1149
+ '.place-items-baseline': { 'place-items': 'baseline' },
856
1150
  '.place-items-stretch': { 'place-items': 'stretch' },
857
1151
  })
858
1152
  },
@@ -865,6 +1159,7 @@ export let corePlugins = {
865
1159
  '.content-between': { 'align-content': 'space-between' },
866
1160
  '.content-around': { 'align-content': 'space-around' },
867
1161
  '.content-evenly': { 'align-content': 'space-evenly' },
1162
+ '.content-baseline': { 'align-content': 'baseline' },
868
1163
  })
869
1164
  },
870
1165
 
@@ -969,7 +1264,7 @@ export let corePlugins = {
969
1264
  }
970
1265
  },
971
1266
  },
972
- { values: theme('divideWidth'), type: ['line-width', 'length'] }
1267
+ { values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
973
1268
  )
974
1269
 
975
1270
  addUtilities({
@@ -1017,7 +1312,7 @@ export let corePlugins = {
1017
1312
  },
1018
1313
  {
1019
1314
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1020
- type: 'color',
1315
+ type: ['color', 'any'],
1021
1316
  }
1022
1317
  )
1023
1318
  },
@@ -1129,6 +1424,7 @@ export let corePlugins = {
1129
1424
  '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1130
1425
  '.break-words': { 'overflow-wrap': 'break-word' },
1131
1426
  '.break-all': { 'word-break': 'break-all' },
1427
+ '.break-keep': { 'word-break': 'keep-all' },
1132
1428
  })
1133
1429
  },
1134
1430
 
@@ -1177,23 +1473,7 @@ export let corePlugins = {
1177
1473
  })
1178
1474
  },
1179
1475
 
1180
- borderColor: ({ addDefaults, matchUtilities, theme, corePlugins }) => {
1181
- if (!corePlugins('borderOpacity')) {
1182
- let value = theme('borderColor.DEFAULT', 'currentColor')
1183
- addDefaults('border-width', {
1184
- 'border-color': toColorValue(value),
1185
- })
1186
- } else {
1187
- addDefaults(
1188
- 'border-width',
1189
- withAlphaVariable({
1190
- color: theme('borderColor.DEFAULT', 'currentColor'),
1191
- property: 'border-color',
1192
- variable: '--tw-border-opacity',
1193
- })
1194
- )
1195
- }
1196
-
1476
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1197
1477
  matchUtilities(
1198
1478
  {
1199
1479
  border: (value) => {
@@ -1212,7 +1492,7 @@ export let corePlugins = {
1212
1492
  },
1213
1493
  {
1214
1494
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1215
- type: ['color'],
1495
+ type: ['color', 'any'],
1216
1496
  }
1217
1497
  )
1218
1498
 
@@ -1249,7 +1529,7 @@ export let corePlugins = {
1249
1529
  },
1250
1530
  {
1251
1531
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1252
- type: 'color',
1532
+ type: ['color', 'any'],
1253
1533
  }
1254
1534
  )
1255
1535
 
@@ -1310,7 +1590,7 @@ export let corePlugins = {
1310
1590
  },
1311
1591
  {
1312
1592
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1313
- type: 'color',
1593
+ type: ['color', 'any'],
1314
1594
  }
1315
1595
  )
1316
1596
  },
@@ -1336,7 +1616,7 @@ export let corePlugins = {
1336
1616
  })
1337
1617
  },
1338
1618
  },
1339
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1619
+ { values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
1340
1620
  )
1341
1621
  },
1342
1622
 
@@ -1364,7 +1644,8 @@ export let corePlugins = {
1364
1644
 
1365
1645
  return {
1366
1646
  '--tw-gradient-from': toColorValue(value, 'from'),
1367
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1647
+ '--tw-gradient-to': transparentToValue,
1648
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
1368
1649
  }
1369
1650
  },
1370
1651
  },
@@ -1376,10 +1657,11 @@ export let corePlugins = {
1376
1657
  let transparentToValue = transparentTo(value)
1377
1658
 
1378
1659
  return {
1660
+ '--tw-gradient-to': transparentToValue,
1379
1661
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1380
1662
  value,
1381
1663
  'via'
1382
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1664
+ )}, var(--tw-gradient-to)`,
1383
1665
  }
1384
1666
  },
1385
1667
  },
@@ -1402,7 +1684,7 @@ export let corePlugins = {
1402
1684
  },
1403
1685
 
1404
1686
  backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1405
- type: ['lookup', 'length', 'percentage'],
1687
+ type: ['lookup', 'length', 'percentage', 'size'],
1406
1688
  }),
1407
1689
 
1408
1690
  backgroundAttachment: ({ addUtilities }) => {
@@ -1423,7 +1705,7 @@ export let corePlugins = {
1423
1705
  },
1424
1706
 
1425
1707
  backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1426
- type: ['lookup', 'position'],
1708
+ type: ['lookup', ['position', { preferOnConflict: true }]],
1427
1709
  }),
1428
1710
 
1429
1711
  backgroundRepeat: ({ addUtilities }) => {
@@ -1463,7 +1745,7 @@ export let corePlugins = {
1463
1745
  return { stroke: toColorValue(value) }
1464
1746
  },
1465
1747
  },
1466
- { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1748
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
1467
1749
  )
1468
1750
  },
1469
1751
 
@@ -1502,6 +1784,8 @@ export let corePlugins = {
1502
1784
  '.text-center': { 'text-align': 'center' },
1503
1785
  '.text-right': { 'text-align': 'right' },
1504
1786
  '.text-justify': { 'text-align': 'justify' },
1787
+ '.text-start': { 'text-align': 'start' },
1788
+ '.text-end': { 'text-align': 'end' },
1505
1789
  })
1506
1790
  },
1507
1791
 
@@ -1524,16 +1808,43 @@ export let corePlugins = {
1524
1808
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1525
1809
  },
1526
1810
 
1527
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1528
- type: ['lookup', 'generic-name', 'family-name'],
1529
- }),
1811
+ fontFamily: ({ matchUtilities, theme }) => {
1812
+ matchUtilities(
1813
+ {
1814
+ font: (value) => {
1815
+ let [families, options = {}] =
1816
+ Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
1817
+ let { fontFeatureSettings } = options
1818
+
1819
+ return {
1820
+ 'font-family': Array.isArray(families) ? families.join(', ') : families,
1821
+ ...(fontFeatureSettings === undefined
1822
+ ? {}
1823
+ : { 'font-feature-settings': fontFeatureSettings }),
1824
+ }
1825
+ },
1826
+ },
1827
+ {
1828
+ values: theme('fontFamily'),
1829
+ type: ['lookup', 'generic-name', 'family-name'],
1830
+ }
1831
+ )
1832
+ },
1530
1833
 
1531
1834
  fontSize: ({ matchUtilities, theme }) => {
1532
1835
  matchUtilities(
1533
1836
  {
1534
- text: (value) => {
1837
+ text: (value, { modifier }) => {
1535
1838
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1536
- let { lineHeight, letterSpacing } = isPlainObject(options)
1839
+
1840
+ if (modifier) {
1841
+ return {
1842
+ 'font-size': fontSize,
1843
+ 'line-height': modifier,
1844
+ }
1845
+ }
1846
+
1847
+ let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1537
1848
  ? options
1538
1849
  : { lineHeight: options }
1539
1850
 
@@ -1541,18 +1852,20 @@ export let corePlugins = {
1541
1852
  'font-size': fontSize,
1542
1853
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1543
1854
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1855
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1544
1856
  }
1545
1857
  },
1546
1858
  },
1547
1859
  {
1548
1860
  values: theme('fontSize'),
1861
+ modifiers: theme('lineHeight'),
1549
1862
  type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1550
1863
  }
1551
1864
  )
1552
1865
  },
1553
1866
 
1554
1867
  fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1555
- type: ['lookup', 'number'],
1868
+ type: ['lookup', 'number', 'any'],
1556
1869
  }),
1557
1870
 
1558
1871
  textTransform: ({ addUtilities }) => {
@@ -1571,57 +1884,59 @@ export let corePlugins = {
1571
1884
  })
1572
1885
  },
1573
1886
 
1574
- fontVariantNumeric: ({ addUtilities }) => {
1887
+ fontVariantNumeric: ({ addDefaults, addUtilities }) => {
1888
+ let cssFontVariantNumericValue =
1889
+ 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
1890
+
1891
+ addDefaults('font-variant-numeric', {
1892
+ '--tw-ordinal': ' ',
1893
+ '--tw-slashed-zero': ' ',
1894
+ '--tw-numeric-figure': ' ',
1895
+ '--tw-numeric-spacing': ' ',
1896
+ '--tw-numeric-fraction': ' ',
1897
+ })
1898
+
1575
1899
  addUtilities({
1576
- '@defaults font-variant-numeric': {
1577
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1578
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1579
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1580
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1581
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1582
- '--tw-font-variant-numeric':
1583
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1584
- },
1585
1900
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1586
1901
  '.ordinal': {
1587
1902
  '@defaults font-variant-numeric': {},
1588
1903
  '--tw-ordinal': 'ordinal',
1589
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1904
+ 'font-variant-numeric': cssFontVariantNumericValue,
1590
1905
  },
1591
1906
  '.slashed-zero': {
1592
1907
  '@defaults font-variant-numeric': {},
1593
1908
  '--tw-slashed-zero': 'slashed-zero',
1594
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1909
+ 'font-variant-numeric': cssFontVariantNumericValue,
1595
1910
  },
1596
1911
  '.lining-nums': {
1597
1912
  '@defaults font-variant-numeric': {},
1598
1913
  '--tw-numeric-figure': 'lining-nums',
1599
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1914
+ 'font-variant-numeric': cssFontVariantNumericValue,
1600
1915
  },
1601
1916
  '.oldstyle-nums': {
1602
1917
  '@defaults font-variant-numeric': {},
1603
1918
  '--tw-numeric-figure': 'oldstyle-nums',
1604
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1919
+ 'font-variant-numeric': cssFontVariantNumericValue,
1605
1920
  },
1606
1921
  '.proportional-nums': {
1607
1922
  '@defaults font-variant-numeric': {},
1608
1923
  '--tw-numeric-spacing': 'proportional-nums',
1609
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1924
+ 'font-variant-numeric': cssFontVariantNumericValue,
1610
1925
  },
1611
1926
  '.tabular-nums': {
1612
1927
  '@defaults font-variant-numeric': {},
1613
1928
  '--tw-numeric-spacing': 'tabular-nums',
1614
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1929
+ 'font-variant-numeric': cssFontVariantNumericValue,
1615
1930
  },
1616
1931
  '.diagonal-fractions': {
1617
1932
  '@defaults font-variant-numeric': {},
1618
1933
  '--tw-numeric-fraction': 'diagonal-fractions',
1619
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1934
+ 'font-variant-numeric': cssFontVariantNumericValue,
1620
1935
  },
1621
1936
  '.stacked-fractions': {
1622
1937
  '@defaults font-variant-numeric': {},
1623
1938
  '--tw-numeric-fraction': 'stacked-fractions',
1624
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1939
+ 'font-variant-numeric': cssFontVariantNumericValue,
1625
1940
  },
1626
1941
  })
1627
1942
  },
@@ -1646,7 +1961,7 @@ export let corePlugins = {
1646
1961
  })
1647
1962
  },
1648
1963
  },
1649
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
1964
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
1650
1965
  )
1651
1966
  },
1652
1967
 
@@ -1668,7 +1983,7 @@ export let corePlugins = {
1668
1983
  return { 'text-decoration-color': toColorValue(value) }
1669
1984
  },
1670
1985
  },
1671
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
1986
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1672
1987
  )
1673
1988
  },
1674
1989
 
@@ -1691,7 +2006,7 @@ export let corePlugins = {
1691
2006
  textUnderlineOffset: createUtilityPlugin(
1692
2007
  'textUnderlineOffset',
1693
2008
  [['underline-offset', ['text-underline-offset']]],
1694
- { type: ['length', 'percentage'] }
2009
+ { type: ['length', 'percentage', 'any'] }
1695
2010
  ),
1696
2011
 
1697
2012
  fontSmoothing: ({ addUtilities }) => {
@@ -1806,6 +2121,7 @@ export let corePlugins = {
1806
2121
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1807
2122
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1808
2123
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
2124
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1809
2125
  })
1810
2126
  },
1811
2127
 
@@ -1863,7 +2179,7 @@ export let corePlugins = {
1863
2179
  }
1864
2180
  },
1865
2181
  },
1866
- { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
2182
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
1867
2183
  )
1868
2184
  },
1869
2185
 
@@ -1877,7 +2193,6 @@ export let corePlugins = {
1877
2193
  '.outline-dashed': { 'outline-style': 'dashed' },
1878
2194
  '.outline-dotted': { 'outline-style': 'dotted' },
1879
2195
  '.outline-double': { 'outline-style': 'double' },
1880
- '.outline-hidden': { 'outline-style': 'hidden' },
1881
2196
  })
1882
2197
  },
1883
2198
 
@@ -1886,7 +2201,8 @@ export let corePlugins = {
1886
2201
  }),
1887
2202
 
1888
2203
  outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1889
- type: ['length', 'number', 'percentage'],
2204
+ type: ['length', 'number', 'percentage', 'any'],
2205
+ supportsNegativeValues: true,
1890
2206
  }),
1891
2207
 
1892
2208
  outlineColor: ({ matchUtilities, theme }) => {
@@ -1896,20 +2212,31 @@ export let corePlugins = {
1896
2212
  return { 'outline-color': toColorValue(value) }
1897
2213
  },
1898
2214
  },
1899
- { values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
2215
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
1900
2216
  )
1901
2217
  },
1902
2218
 
1903
- ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
1904
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1905
- let ringColorDefault = withAlphaValue(
1906
- theme('ringColor.DEFAULT'),
1907
- ringOpacityDefault,
1908
- `rgb(147 197 253 / ${ringOpacityDefault})`
1909
- )
2219
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
2220
+ let ringColorDefault = (() => {
2221
+ if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
2222
+ return theme('ringColor.DEFAULT')
2223
+ }
2224
+
2225
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
2226
+
2227
+ if (!theme('ringColor')?.DEFAULT) {
2228
+ return `rgb(147 197 253 / ${ringOpacityDefault})`
2229
+ }
2230
+
2231
+ return withAlphaValue(
2232
+ theme('ringColor')?.DEFAULT,
2233
+ ringOpacityDefault,
2234
+ `rgb(147 197 253 / ${ringOpacityDefault})`
2235
+ )
2236
+ })()
1910
2237
 
1911
2238
  addDefaults('ring-width', {
1912
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
2239
+ '--tw-ring-inset': ' ',
1913
2240
  '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1914
2241
  '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1915
2242
  '--tw-ring-color': ringColorDefault,
@@ -1942,10 +2269,16 @@ export let corePlugins = {
1942
2269
  })
1943
2270
  },
1944
2271
 
1945
- ringColor: ({ matchUtilities, theme }) => {
2272
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1946
2273
  matchUtilities(
1947
2274
  {
1948
2275
  ring: (value) => {
2276
+ if (!corePlugins('ringOpacity')) {
2277
+ return {
2278
+ '--tw-ring-color': toColorValue(value),
2279
+ }
2280
+ }
2281
+
1949
2282
  return withAlphaVariable({
1950
2283
  color: value,
1951
2284
  property: '--tw-ring-color',
@@ -1959,14 +2292,18 @@ export let corePlugins = {
1959
2292
  ([modifier]) => modifier !== 'DEFAULT'
1960
2293
  )
1961
2294
  ),
1962
- type: 'color',
2295
+ type: ['color', 'any'],
1963
2296
  }
1964
2297
  )
1965
2298
  },
1966
2299
 
1967
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1968
- filterDefault: true,
1969
- }),
2300
+ ringOpacity: (helpers) => {
2301
+ let { config } = helpers
2302
+
2303
+ return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
2304
+ filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
2305
+ })(helpers)
2306
+ },
1970
2307
  ringOffsetWidth: createUtilityPlugin(
1971
2308
  'ringOffsetWidth',
1972
2309
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -1982,7 +2319,7 @@ export let corePlugins = {
1982
2319
  }
1983
2320
  },
1984
2321
  },
1985
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
2322
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
1986
2323
  )
1987
2324
  },
1988
2325
 
@@ -1993,7 +2330,7 @@ export let corePlugins = {
1993
2330
  return {
1994
2331
  '--tw-blur': `blur(${value})`,
1995
2332
  '@defaults filter': {},
1996
- filter: 'var(--tw-filter)',
2333
+ filter: cssFilterValue,
1997
2334
  }
1998
2335
  },
1999
2336
  },
@@ -2008,7 +2345,7 @@ export let corePlugins = {
2008
2345
  return {
2009
2346
  '--tw-brightness': `brightness(${value})`,
2010
2347
  '@defaults filter': {},
2011
- filter: 'var(--tw-filter)',
2348
+ filter: cssFilterValue,
2012
2349
  }
2013
2350
  },
2014
2351
  },
@@ -2023,7 +2360,7 @@ export let corePlugins = {
2023
2360
  return {
2024
2361
  '--tw-contrast': `contrast(${value})`,
2025
2362
  '@defaults filter': {},
2026
- filter: 'var(--tw-filter)',
2363
+ filter: cssFilterValue,
2027
2364
  }
2028
2365
  },
2029
2366
  },
@@ -2040,7 +2377,7 @@ export let corePlugins = {
2040
2377
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2041
2378
  : `drop-shadow(${value})`,
2042
2379
  '@defaults filter': {},
2043
- filter: 'var(--tw-filter)',
2380
+ filter: cssFilterValue,
2044
2381
  }
2045
2382
  },
2046
2383
  },
@@ -2055,7 +2392,7 @@ export let corePlugins = {
2055
2392
  return {
2056
2393
  '--tw-grayscale': `grayscale(${value})`,
2057
2394
  '@defaults filter': {},
2058
- filter: 'var(--tw-filter)',
2395
+ filter: cssFilterValue,
2059
2396
  }
2060
2397
  },
2061
2398
  },
@@ -2070,7 +2407,7 @@ export let corePlugins = {
2070
2407
  return {
2071
2408
  '--tw-hue-rotate': `hue-rotate(${value})`,
2072
2409
  '@defaults filter': {},
2073
- filter: 'var(--tw-filter)',
2410
+ filter: cssFilterValue,
2074
2411
  }
2075
2412
  },
2076
2413
  },
@@ -2085,7 +2422,7 @@ export let corePlugins = {
2085
2422
  return {
2086
2423
  '--tw-invert': `invert(${value})`,
2087
2424
  '@defaults filter': {},
2088
- filter: 'var(--tw-filter)',
2425
+ filter: cssFilterValue,
2089
2426
  }
2090
2427
  },
2091
2428
  },
@@ -2100,7 +2437,7 @@ export let corePlugins = {
2100
2437
  return {
2101
2438
  '--tw-saturate': `saturate(${value})`,
2102
2439
  '@defaults filter': {},
2103
- filter: 'var(--tw-filter)',
2440
+ filter: cssFilterValue,
2104
2441
  }
2105
2442
  },
2106
2443
  },
@@ -2115,7 +2452,7 @@ export let corePlugins = {
2115
2452
  return {
2116
2453
  '--tw-sepia': `sepia(${value})`,
2117
2454
  '@defaults filter': {},
2118
- filter: 'var(--tw-filter)',
2455
+ filter: cssFilterValue,
2119
2456
  }
2120
2457
  },
2121
2458
  },
@@ -2125,29 +2462,18 @@ export let corePlugins = {
2125
2462
 
2126
2463
  filter: ({ addDefaults, addUtilities }) => {
2127
2464
  addDefaults('filter', {
2128
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2129
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2130
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2131
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2132
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2133
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2134
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2135
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2136
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2137
- '--tw-filter': [
2138
- 'var(--tw-blur)',
2139
- 'var(--tw-brightness)',
2140
- 'var(--tw-contrast)',
2141
- 'var(--tw-grayscale)',
2142
- 'var(--tw-hue-rotate)',
2143
- 'var(--tw-invert)',
2144
- 'var(--tw-saturate)',
2145
- 'var(--tw-sepia)',
2146
- 'var(--tw-drop-shadow)',
2147
- ].join(' '),
2148
- })
2149
- addUtilities({
2150
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2465
+ '--tw-blur': ' ',
2466
+ '--tw-brightness': ' ',
2467
+ '--tw-contrast': ' ',
2468
+ '--tw-grayscale': ' ',
2469
+ '--tw-hue-rotate': ' ',
2470
+ '--tw-invert': ' ',
2471
+ '--tw-saturate': ' ',
2472
+ '--tw-sepia': ' ',
2473
+ '--tw-drop-shadow': ' ',
2474
+ })
2475
+ addUtilities({
2476
+ '.filter': { '@defaults filter': {}, filter: cssFilterValue },
2151
2477
  '.filter-none': { filter: 'none' },
2152
2478
  })
2153
2479
  },
@@ -2159,7 +2485,7 @@ export let corePlugins = {
2159
2485
  return {
2160
2486
  '--tw-backdrop-blur': `blur(${value})`,
2161
2487
  '@defaults backdrop-filter': {},
2162
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2488
+ 'backdrop-filter': cssBackdropFilterValue,
2163
2489
  }
2164
2490
  },
2165
2491
  },
@@ -2174,7 +2500,7 @@ export let corePlugins = {
2174
2500
  return {
2175
2501
  '--tw-backdrop-brightness': `brightness(${value})`,
2176
2502
  '@defaults backdrop-filter': {},
2177
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2503
+ 'backdrop-filter': cssBackdropFilterValue,
2178
2504
  }
2179
2505
  },
2180
2506
  },
@@ -2189,7 +2515,7 @@ export let corePlugins = {
2189
2515
  return {
2190
2516
  '--tw-backdrop-contrast': `contrast(${value})`,
2191
2517
  '@defaults backdrop-filter': {},
2192
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2518
+ 'backdrop-filter': cssBackdropFilterValue,
2193
2519
  }
2194
2520
  },
2195
2521
  },
@@ -2204,7 +2530,7 @@ export let corePlugins = {
2204
2530
  return {
2205
2531
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2206
2532
  '@defaults backdrop-filter': {},
2207
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2533
+ 'backdrop-filter': cssBackdropFilterValue,
2208
2534
  }
2209
2535
  },
2210
2536
  },
@@ -2219,7 +2545,7 @@ export let corePlugins = {
2219
2545
  return {
2220
2546
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2221
2547
  '@defaults backdrop-filter': {},
2222
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2548
+ 'backdrop-filter': cssBackdropFilterValue,
2223
2549
  }
2224
2550
  },
2225
2551
  },
@@ -2234,7 +2560,7 @@ export let corePlugins = {
2234
2560
  return {
2235
2561
  '--tw-backdrop-invert': `invert(${value})`,
2236
2562
  '@defaults backdrop-filter': {},
2237
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2563
+ 'backdrop-filter': cssBackdropFilterValue,
2238
2564
  }
2239
2565
  },
2240
2566
  },
@@ -2249,7 +2575,7 @@ export let corePlugins = {
2249
2575
  return {
2250
2576
  '--tw-backdrop-opacity': `opacity(${value})`,
2251
2577
  '@defaults backdrop-filter': {},
2252
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2578
+ 'backdrop-filter': cssBackdropFilterValue,
2253
2579
  }
2254
2580
  },
2255
2581
  },
@@ -2264,7 +2590,7 @@ export let corePlugins = {
2264
2590
  return {
2265
2591
  '--tw-backdrop-saturate': `saturate(${value})`,
2266
2592
  '@defaults backdrop-filter': {},
2267
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2593
+ 'backdrop-filter': cssBackdropFilterValue,
2268
2594
  }
2269
2595
  },
2270
2596
  },
@@ -2279,7 +2605,7 @@ export let corePlugins = {
2279
2605
  return {
2280
2606
  '--tw-backdrop-sepia': `sepia(${value})`,
2281
2607
  '@defaults backdrop-filter': {},
2282
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2608
+ 'backdrop-filter': cssBackdropFilterValue,
2283
2609
  }
2284
2610
  },
2285
2611
  },
@@ -2289,31 +2615,20 @@ export let corePlugins = {
2289
2615
 
2290
2616
  backdropFilter: ({ addDefaults, addUtilities }) => {
2291
2617
  addDefaults('backdrop-filter', {
2292
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2293
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2294
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2295
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2296
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2297
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2298
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2299
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2300
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2301
- '--tw-backdrop-filter': [
2302
- 'var(--tw-backdrop-blur)',
2303
- 'var(--tw-backdrop-brightness)',
2304
- 'var(--tw-backdrop-contrast)',
2305
- 'var(--tw-backdrop-grayscale)',
2306
- 'var(--tw-backdrop-hue-rotate)',
2307
- 'var(--tw-backdrop-invert)',
2308
- 'var(--tw-backdrop-opacity)',
2309
- 'var(--tw-backdrop-saturate)',
2310
- 'var(--tw-backdrop-sepia)',
2311
- ].join(' '),
2618
+ '--tw-backdrop-blur': ' ',
2619
+ '--tw-backdrop-brightness': ' ',
2620
+ '--tw-backdrop-contrast': ' ',
2621
+ '--tw-backdrop-grayscale': ' ',
2622
+ '--tw-backdrop-hue-rotate': ' ',
2623
+ '--tw-backdrop-invert': ' ',
2624
+ '--tw-backdrop-opacity': ' ',
2625
+ '--tw-backdrop-saturate': ' ',
2626
+ '--tw-backdrop-sepia': ' ',
2312
2627
  })
2313
2628
  addUtilities({
2314
2629
  '.backdrop-filter': {
2315
2630
  '@defaults backdrop-filter': {},
2316
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2631
+ 'backdrop-filter': cssBackdropFilterValue,
2317
2632
  },
2318
2633
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2319
2634
  })