tailwindcss 0.0.0-insiders.ca1dfd6 → 0.0.0-insiders.cb6e45a

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 (190) hide show
  1. package/CHANGELOG.md +526 -2
  2. package/LICENSE +1 -2
  3. package/README.md +13 -6
  4. package/colors.d.ts +3 -0
  5. package/colors.js +2 -1
  6. package/defaultConfig.d.ts +3 -0
  7. package/defaultConfig.js +2 -1
  8. package/defaultTheme.d.ts +4 -0
  9. package/defaultTheme.js +2 -1
  10. package/lib/cli/build/deps.js +54 -0
  11. package/lib/cli/build/index.js +44 -0
  12. package/lib/cli/build/plugin.js +335 -0
  13. package/lib/cli/build/utils.js +78 -0
  14. package/lib/cli/build/watching.js +113 -0
  15. package/lib/cli/help/index.js +71 -0
  16. package/lib/cli/index.js +18 -0
  17. package/lib/cli/init/index.js +46 -0
  18. package/lib/cli/shared.js +12 -0
  19. package/lib/cli-peer-dependencies.js +20 -7
  20. package/lib/cli.js +91 -569
  21. package/lib/constants.js +27 -20
  22. package/lib/corePluginList.js +16 -4
  23. package/lib/corePlugins.js +2247 -1873
  24. package/lib/css/preflight.css +20 -9
  25. package/lib/featureFlags.js +37 -23
  26. package/lib/index.js +28 -12
  27. package/lib/lib/cacheInvalidation.js +90 -0
  28. package/lib/lib/collapseAdjacentRules.js +27 -9
  29. package/lib/lib/collapseDuplicateDeclarations.js +83 -0
  30. package/lib/lib/content.js +167 -0
  31. package/lib/lib/defaultExtractor.js +236 -0
  32. package/lib/lib/detectNesting.js +21 -3
  33. package/lib/lib/evaluateTailwindFunctions.js +117 -50
  34. package/lib/lib/expandApplyAtRules.js +439 -160
  35. package/lib/lib/expandTailwindAtRules.js +141 -151
  36. package/lib/lib/findAtConfigPath.js +44 -0
  37. package/lib/lib/generateRules.js +572 -105
  38. package/lib/lib/getModuleDependencies.js +11 -8
  39. package/lib/lib/normalizeTailwindDirectives.js +45 -33
  40. package/lib/lib/offsets.js +217 -0
  41. package/lib/lib/partitionApplyAtRules.js +56 -0
  42. package/lib/lib/regex.js +60 -0
  43. package/lib/lib/resolveDefaultsAtRules.js +114 -81
  44. package/lib/lib/setupContextUtils.js +777 -385
  45. package/lib/lib/setupTrackingContext.js +43 -71
  46. package/lib/lib/sharedState.js +49 -18
  47. package/lib/lib/substituteScreenAtRules.js +13 -8
  48. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  49. package/lib/postcss-plugins/nesting/index.js +19 -0
  50. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  51. package/lib/processTailwindFeatures.js +36 -21
  52. package/lib/public/colors.js +250 -252
  53. package/lib/public/create-plugin.js +6 -4
  54. package/lib/public/default-config.js +7 -5
  55. package/lib/public/default-theme.js +7 -5
  56. package/lib/public/resolve-config.js +8 -5
  57. package/lib/util/bigSign.js +4 -1
  58. package/lib/util/buildMediaQuery.js +18 -24
  59. package/lib/util/cloneDeep.js +7 -6
  60. package/lib/util/cloneNodes.js +21 -3
  61. package/lib/util/color.js +54 -40
  62. package/lib/util/configurePlugins.js +5 -2
  63. package/lib/util/createPlugin.js +6 -6
  64. package/lib/util/createUtilityPlugin.js +11 -13
  65. package/lib/util/dataTypes.js +137 -100
  66. package/lib/util/defaults.js +10 -1
  67. package/lib/util/escapeClassName.js +7 -4
  68. package/lib/util/escapeCommas.js +5 -2
  69. package/lib/util/flattenColorPalette.js +9 -12
  70. package/lib/util/formatVariantSelector.js +285 -0
  71. package/lib/util/getAllConfigs.js +27 -8
  72. package/lib/util/hashConfig.js +6 -3
  73. package/lib/util/isKeyframeRule.js +5 -2
  74. package/lib/util/isPlainObject.js +5 -2
  75. package/lib/util/isValidArbitraryValue.js +72 -0
  76. package/lib/util/log.js +44 -22
  77. package/lib/util/nameClass.js +20 -8
  78. package/lib/util/negateValue.js +23 -6
  79. package/lib/util/normalizeConfig.js +267 -0
  80. package/lib/util/normalizeScreens.js +170 -0
  81. package/lib/util/parseAnimationValue.js +42 -40
  82. package/lib/util/parseBoxShadowValue.js +84 -0
  83. package/lib/util/parseDependency.js +38 -56
  84. package/lib/util/parseGlob.js +34 -0
  85. package/lib/util/parseObjectStyles.js +11 -8
  86. package/lib/util/pluginUtils.js +171 -189
  87. package/lib/util/prefixSelector.js +10 -10
  88. package/lib/util/removeAlphaVariables.js +29 -0
  89. package/lib/util/resolveConfig.js +92 -126
  90. package/lib/util/resolveConfigPath.js +11 -9
  91. package/lib/util/responsive.js +8 -5
  92. package/lib/util/splitAtTopLevelOnly.js +43 -0
  93. package/lib/util/tap.js +4 -1
  94. package/lib/util/toColorValue.js +5 -3
  95. package/lib/util/toPath.js +24 -3
  96. package/lib/util/transformThemeValue.js +49 -31
  97. package/lib/util/validateConfig.js +24 -0
  98. package/lib/util/validateFormalSyntax.js +24 -0
  99. package/lib/util/withAlphaVariable.js +23 -15
  100. package/nesting/index.js +2 -12
  101. package/package.json +48 -46
  102. package/peers/index.js +14817 -12471
  103. package/plugin.d.ts +11 -0
  104. package/plugin.js +2 -1
  105. package/resolveConfig.d.ts +3 -0
  106. package/resolveConfig.js +2 -1
  107. package/scripts/create-plugin-list.js +2 -2
  108. package/scripts/generate-types.js +105 -0
  109. package/scripts/release-channel.js +18 -0
  110. package/scripts/release-notes.js +21 -0
  111. package/scripts/type-utils.js +27 -0
  112. package/src/cli/build/deps.js +56 -0
  113. package/src/cli/build/index.js +45 -0
  114. package/src/cli/build/plugin.js +397 -0
  115. package/src/cli/build/utils.js +76 -0
  116. package/src/cli/build/watching.js +134 -0
  117. package/src/cli/help/index.js +70 -0
  118. package/src/cli/index.js +3 -0
  119. package/src/cli/init/index.js +50 -0
  120. package/src/cli/shared.js +5 -0
  121. package/src/cli-peer-dependencies.js +7 -1
  122. package/src/cli.js +26 -565
  123. package/src/corePluginList.js +1 -1
  124. package/src/corePlugins.js +905 -615
  125. package/src/css/preflight.css +20 -9
  126. package/src/featureFlags.js +26 -10
  127. package/src/index.js +19 -6
  128. package/src/lib/cacheInvalidation.js +52 -0
  129. package/src/lib/collapseAdjacentRules.js +21 -2
  130. package/src/lib/collapseDuplicateDeclarations.js +93 -0
  131. package/src/lib/content.js +205 -0
  132. package/src/lib/defaultExtractor.js +211 -0
  133. package/src/lib/detectNesting.js +22 -3
  134. package/src/lib/evaluateTailwindFunctions.js +84 -10
  135. package/src/lib/expandApplyAtRules.js +488 -153
  136. package/src/lib/expandTailwindAtRules.js +94 -106
  137. package/src/lib/findAtConfigPath.js +50 -0
  138. package/src/lib/generateRules.js +589 -67
  139. package/src/lib/normalizeTailwindDirectives.js +10 -3
  140. package/src/lib/offsets.js +270 -0
  141. package/src/lib/partitionApplyAtRules.js +52 -0
  142. package/src/lib/regex.js +74 -0
  143. package/src/lib/resolveDefaultsAtRules.js +98 -60
  144. package/src/lib/setupContextUtils.js +737 -246
  145. package/src/lib/setupTrackingContext.js +16 -54
  146. package/src/lib/sharedState.js +44 -7
  147. package/src/lib/substituteScreenAtRules.js +6 -3
  148. package/src/postcss-plugins/nesting/README.md +42 -0
  149. package/src/postcss-plugins/nesting/index.js +13 -0
  150. package/src/postcss-plugins/nesting/plugin.js +80 -0
  151. package/src/processTailwindFeatures.js +17 -2
  152. package/src/public/colors.js +4 -9
  153. package/src/util/buildMediaQuery.js +14 -16
  154. package/src/util/cloneNodes.js +19 -2
  155. package/src/util/color.js +31 -14
  156. package/src/util/createUtilityPlugin.js +2 -2
  157. package/src/util/dataTypes.js +57 -21
  158. package/src/util/defaults.js +6 -0
  159. package/src/util/formatVariantSelector.js +319 -0
  160. package/src/util/getAllConfigs.js +19 -0
  161. package/src/util/isValidArbitraryValue.js +61 -0
  162. package/src/util/log.js +23 -22
  163. package/src/util/nameClass.js +6 -2
  164. package/src/util/negateValue.js +14 -4
  165. package/src/util/normalizeConfig.js +282 -0
  166. package/src/util/normalizeScreens.js +140 -0
  167. package/src/util/parseBoxShadowValue.js +72 -0
  168. package/src/util/parseDependency.js +37 -42
  169. package/src/util/parseGlob.js +24 -0
  170. package/src/util/pluginUtils.js +144 -152
  171. package/src/util/prefixSelector.js +7 -8
  172. package/src/util/removeAlphaVariables.js +24 -0
  173. package/src/util/resolveConfig.js +82 -81
  174. package/src/util/splitAtTopLevelOnly.js +45 -0
  175. package/src/util/toPath.js +23 -1
  176. package/src/util/transformThemeValue.js +33 -8
  177. package/src/util/validateConfig.js +13 -0
  178. package/src/util/validateFormalSyntax.js +34 -0
  179. package/src/util/withAlphaVariable.js +1 -1
  180. package/stubs/defaultConfig.stub.js +173 -93
  181. package/stubs/simpleConfig.stub.js +1 -1
  182. package/types/config.d.ts +361 -0
  183. package/types/generated/.gitkeep +0 -0
  184. package/types/generated/colors.d.ts +276 -0
  185. package/types/generated/corePluginList.d.ts +1 -0
  186. package/types/generated/default-theme.d.ts +342 -0
  187. package/types/index.d.ts +7 -0
  188. package/lib/lib/setupWatchingContext.js +0 -284
  189. package/nesting/plugin.js +0 -41
  190. package/src/lib/setupWatchingContext.js +0 -306
@@ -1,146 +1,112 @@
1
1
  import fs from 'fs'
2
+ import * as path from 'path'
2
3
  import postcss from 'postcss'
3
4
  import createUtilityPlugin from './util/createUtilityPlugin'
4
5
  import buildMediaQuery from './util/buildMediaQuery'
5
- import prefixSelector from './util/prefixSelector'
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'
9
10
  import toColorValue from './util/toColorValue'
10
11
  import isPlainObject from './util/isPlainObject'
11
12
  import transformThemeValue from './util/transformThemeValue'
12
- import {
13
- applyStateToMarker,
14
- updateLastClasses,
15
- updateAllClasses,
16
- transformAllSelectors,
17
- transformAllClasses,
18
- transformLastClasses,
19
- } from './util/pluginUtils'
20
13
  import { version as tailwindVersion } from '../package.json'
21
14
  import log from './util/log'
22
-
23
- export default {
24
- // Variant plugins
25
- pseudoElementVariants: ({ config, addVariant }) => {
26
- addVariant(
27
- 'first-letter',
28
- transformAllSelectors((selector) => {
29
- return updateAllClasses(selector, (className, { withPseudo }) => {
30
- return withPseudo(`first-letter${config('separator')}${className}`, '::first-letter')
31
- })
32
- })
33
- )
34
-
35
- addVariant(
36
- 'first-line',
37
- transformAllSelectors((selector) => {
38
- return updateAllClasses(selector, (className, { withPseudo }) => {
39
- return withPseudo(`first-line${config('separator')}${className}`, '::first-line')
40
- })
41
- })
42
- )
15
+ import {
16
+ normalizeScreens,
17
+ isScreenSortable,
18
+ compareScreens,
19
+ toScreen,
20
+ } from './util/normalizeScreens'
21
+ import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
22
+ import { removeAlphaVariables } from './util/removeAlphaVariables'
23
+ import { flagEnabled } from './featureFlags'
24
+ import { normalize } from './util/dataTypes'
25
+
26
+ export let variantPlugins = {
27
+ pseudoElementVariants: ({ addVariant }) => {
28
+ addVariant('first-letter', '&::first-letter')
29
+ addVariant('first-line', '&::first-line')
43
30
 
44
31
  addVariant('marker', [
45
- transformAllSelectors((selector) => {
46
- let variantSelector = updateAllClasses(selector, (className) => {
47
- return `marker${config('separator')}${className}`
48
- })
32
+ ({ container }) => {
33
+ removeAlphaVariables(container, ['--tw-text-opacity'])
49
34
 
50
- return `${variantSelector} *::marker`
51
- }),
52
- transformAllSelectors((selector) => {
53
- return updateAllClasses(selector, (className, { withPseudo }) => {
54
- return withPseudo(`marker${config('separator')}${className}`, '::marker')
55
- })
56
- }),
35
+ return '& *::marker'
36
+ },
37
+ ({ container }) => {
38
+ removeAlphaVariables(container, ['--tw-text-opacity'])
39
+
40
+ return '&::marker'
41
+ },
57
42
  ])
58
43
 
59
- addVariant('selection', [
60
- transformAllSelectors((selector) => {
61
- let variantSelector = updateAllClasses(selector, (className) => {
62
- return `selection${config('separator')}${className}`
63
- })
44
+ addVariant('selection', ['& *::selection', '&::selection'])
64
45
 
65
- return `${variantSelector} *::selection`
66
- }),
67
- transformAllSelectors((selector) => {
68
- return updateAllClasses(selector, (className, { withPseudo }) => {
69
- return withPseudo(`selection${config('separator')}${className}`, '::selection')
70
- })
71
- }),
72
- ])
46
+ addVariant('file', '&::file-selector-button')
73
47
 
74
- addVariant(
75
- 'file',
76
- transformAllSelectors((selector) => {
77
- return updateAllClasses(selector, (className, { withPseudo }) => {
78
- return withPseudo(`file${config('separator')}${className}`, '::file-selector-button')
48
+ addVariant('placeholder', '&::placeholder')
49
+
50
+ addVariant('backdrop', '&::backdrop')
51
+
52
+ addVariant('before', ({ container }) => {
53
+ container.walkRules((rule) => {
54
+ let foundContent = false
55
+ rule.walkDecls('content', () => {
56
+ foundContent = true
79
57
  })
80
- })
81
- )
82
58
 
83
- addVariant(
84
- 'before',
85
- transformAllSelectors(
86
- (selector) => {
87
- return updateAllClasses(selector, (className, { withPseudo }) => {
88
- return withPseudo(`before${config('separator')}${className}`, '::before')
89
- })
90
- },
91
- {
92
- withRule: (rule) => {
93
- let foundContent = false
94
- rule.walkDecls('content', () => {
95
- foundContent = true
96
- })
97
- if (!foundContent) {
98
- rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
99
- }
100
- },
59
+ if (!foundContent) {
60
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
101
61
  }
102
- )
103
- )
62
+ })
104
63
 
105
- addVariant(
106
- 'after',
107
- transformAllSelectors(
108
- (selector) => {
109
- return updateAllClasses(selector, (className, { withPseudo }) => {
110
- return withPseudo(`after${config('separator')}${className}`, '::after')
111
- })
112
- },
113
- {
114
- withRule: (rule) => {
115
- let foundContent = false
116
- rule.walkDecls('content', () => {
117
- foundContent = true
118
- })
119
- if (!foundContent) {
120
- rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
121
- }
122
- },
64
+ return '&::before'
65
+ })
66
+
67
+ addVariant('after', ({ container }) => {
68
+ container.walkRules((rule) => {
69
+ let foundContent = false
70
+ rule.walkDecls('content', () => {
71
+ foundContent = true
72
+ })
73
+
74
+ if (!foundContent) {
75
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
123
76
  }
124
- )
125
- )
77
+ })
78
+
79
+ return '&::after'
80
+ })
126
81
  },
127
82
 
128
- pseudoClassVariants: ({ config, addVariant }) => {
83
+ pseudoClassVariants: ({ addVariant, matchVariant, config }) => {
129
84
  let pseudoVariants = [
130
85
  // Positional
131
- ['first', ':first-child'],
132
- ['last', ':last-child'],
133
- ['only', ':only-child'],
134
- ['odd', ':nth-child(odd)'],
135
- ['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)'],
136
91
  'first-of-type',
137
92
  'last-of-type',
138
93
  'only-of-type',
139
94
 
140
95
  // State
141
- '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
+ ],
142
108
  'target',
143
- ['open', '[open]'],
109
+ ['open', '&[open]'],
144
110
 
145
111
  // Forms
146
112
  'default',
@@ -148,6 +114,7 @@ export default {
148
114
  'indeterminate',
149
115
  'placeholder-shown',
150
116
  'autofill',
117
+ 'optional',
151
118
  'required',
152
119
  'valid',
153
120
  'invalid',
@@ -160,204 +127,349 @@ export default {
160
127
 
161
128
  // Interactive
162
129
  'focus-within',
163
- 'hover',
130
+ [
131
+ 'hover',
132
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
133
+ ? '&:hover'
134
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
135
+ ],
164
136
  'focus',
165
137
  'focus-visible',
166
138
  'active',
139
+ 'enabled',
167
140
  'disabled',
168
- ]
169
-
170
- for (let variant of pseudoVariants) {
171
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
172
-
173
- addVariant(
174
- variantName,
175
- transformAllClasses((className, { withAttr, withPseudo }) => {
176
- if (state.startsWith(':')) {
177
- return withPseudo(`${variantName}${config('separator')}${className}`, state)
178
- } else if (state.startsWith('[')) {
179
- return withAttr(`${variantName}${config('separator')}${className}`, state)
180
- }
181
- })
182
- )
183
- }
184
-
185
- let groupMarker = prefixSelector(config('prefix'), '.group')
186
- for (let variant of pseudoVariants) {
187
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
188
- let groupVariantName = `group-${variantName}`
189
-
190
- addVariant(
191
- groupVariantName,
192
- transformAllSelectors((selector) => {
193
- let variantSelector = updateAllClasses(selector, (className) => {
194
- if (`.${className}` === groupMarker) return className
195
- return `${groupVariantName}${config('separator')}${className}`
196
- })
141
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
197
142
 
198
- if (variantSelector === selector) {
199
- return null
200
- }
143
+ for (let [variantName, state] of pseudoVariants) {
144
+ addVariant(variantName, (ctx) => {
145
+ let result = typeof state === 'function' ? state(ctx) : state
201
146
 
202
- return applyStateToMarker(
203
- variantSelector,
204
- groupMarker,
205
- state,
206
- (marker, selector) => `${marker} ${selector}`
207
- )
208
- })
209
- )
147
+ return result
148
+ })
210
149
  }
211
150
 
212
- let peerMarker = prefixSelector(config('prefix'), '.peer')
213
- for (let variant of pseudoVariants) {
214
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
215
- let peerVariantName = `peer-${variantName}`
216
-
217
- addVariant(
218
- peerVariantName,
219
- transformAllSelectors((selector) => {
220
- let variantSelector = updateAllClasses(selector, (className) => {
221
- if (`.${className}` === peerMarker) return className
222
- return `${peerVariantName}${config('separator')}${className}`
223
- })
151
+ let variants = {
152
+ group: (_, { modifier }) =>
153
+ modifier ? [`:merge(.group\\/${modifier})`, ' &'] : [`:merge(.group)`, ' &'],
154
+ peer: (_, { modifier }) =>
155
+ modifier ? [`:merge(.peer\\/${modifier})`, ' ~ &'] : [`:merge(.peer)`, ' ~ &'],
156
+ }
224
157
 
225
- if (variantSelector === selector) {
226
- return null
158
+ for (let [name, fn] of Object.entries(variants)) {
159
+ matchVariant(
160
+ name,
161
+ (value = '', extra) => {
162
+ if (extra.modifier) {
163
+ log.warn(`modifier-${name}-experimental`, [
164
+ `The ${name} variant modifier feature in Tailwind CSS is currently in preview.`,
165
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
166
+ ])
227
167
  }
228
168
 
229
- return applyStateToMarker(variantSelector, peerMarker, state, (marker, selector) =>
230
- selector.trim().startsWith('~') ? `${marker}${selector}` : `${marker} ~ ${selector}`
231
- )
232
- })
169
+ let result = normalize(typeof value === 'function' ? value(extra) : value)
170
+ if (!result.includes('&')) result = '&' + result
171
+
172
+ let [a, b] = fn('', extra)
173
+ return result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
174
+ },
175
+ { values: Object.fromEntries(pseudoVariants) }
233
176
  )
234
177
  }
235
178
  },
236
179
 
237
- directionVariants: ({ config, addVariant }) => {
238
- addVariant(
239
- 'ltr',
240
- transformAllSelectors(
241
- (selector) =>
242
- `[dir="ltr"] ${updateAllClasses(
243
- selector,
244
- (className) => `ltr${config('separator')}${className}`
245
- )}`
246
- )
247
- )
180
+ directionVariants: ({ addVariant }) => {
181
+ addVariant('ltr', () => {
182
+ log.warn('rtl-experimental', [
183
+ 'The RTL features in Tailwind CSS are currently in preview.',
184
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
185
+ ])
248
186
 
249
- addVariant(
250
- 'rtl',
251
- transformAllSelectors(
252
- (selector) =>
253
- `[dir="rtl"] ${updateAllClasses(
254
- selector,
255
- (className) => `rtl${config('separator')}${className}`
256
- )}`
257
- )
258
- )
259
- },
187
+ return '[dir="ltr"] &'
188
+ })
260
189
 
261
- reducedMotionVariants: ({ config, addVariant }) => {
262
- addVariant(
263
- 'motion-safe',
264
- transformLastClasses(
265
- (className) => {
266
- return `motion-safe${config('separator')}${className}`
267
- },
268
- {
269
- wrap: () =>
270
- postcss.atRule({
271
- name: 'media',
272
- params: '(prefers-reduced-motion: no-preference)',
273
- }),
274
- }
275
- )
276
- )
190
+ addVariant('rtl', () => {
191
+ log.warn('rtl-experimental', [
192
+ 'The RTL features in Tailwind CSS are currently in preview.',
193
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
194
+ ])
277
195
 
278
- addVariant(
279
- 'motion-reduce',
280
- transformLastClasses(
281
- (className) => {
282
- return `motion-reduce${config('separator')}${className}`
283
- },
284
- {
285
- wrap: () =>
286
- postcss.atRule({
287
- name: 'media',
288
- params: '(prefers-reduced-motion: reduce)',
289
- }),
290
- }
291
- )
292
- )
196
+ return '[dir="rtl"] &'
197
+ })
198
+ },
199
+
200
+ reducedMotionVariants: ({ addVariant }) => {
201
+ addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)')
202
+ addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)')
293
203
  },
294
204
 
295
205
  darkVariants: ({ config, addVariant }) => {
296
- let mode = config('darkMode', 'media')
206
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
207
+
297
208
  if (mode === false) {
298
209
  mode = 'media'
299
- log.warn([
300
- '`darkMode` is set to `false` in your config.',
301
- 'This will behave just like the `media` value.',
210
+ log.warn('darkmode-false', [
211
+ 'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
212
+ 'Change `darkMode` to `media` or remove it entirely.',
213
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
302
214
  ])
303
215
  }
304
216
 
305
217
  if (mode === 'class') {
306
- addVariant(
307
- 'dark',
308
- transformAllSelectors((selector) => {
309
- let variantSelector = updateLastClasses(selector, (className) => {
310
- return `dark${config('separator')}${className}`
311
- })
218
+ addVariant('dark', `${className} &`)
219
+ } else if (mode === 'media') {
220
+ addVariant('dark', '@media (prefers-color-scheme: dark)')
221
+ }
222
+ },
312
223
 
313
- if (variantSelector === selector) {
314
- return null
315
- }
224
+ printVariant: ({ addVariant }) => {
225
+ addVariant('print', '@media print')
226
+ },
316
227
 
317
- let darkSelector = prefixSelector(config('prefix'), `.dark`)
228
+ screenVariants: ({ theme, addVariant, matchVariant }) => {
229
+ let rawScreens = theme('screens') ?? {}
230
+ let areSimpleScreens = Object.values(rawScreens).every((v) => typeof v === 'string')
231
+ let screens = normalizeScreens(theme('screens'))
318
232
 
319
- return `${darkSelector} ${variantSelector}`
320
- })
321
- )
322
- } else if (mode === 'media') {
323
- addVariant(
324
- 'dark',
325
- transformLastClasses(
326
- (className) => {
327
- return `dark${config('separator')}${className}`
328
- },
329
- {
330
- wrap: () =>
331
- postcss.atRule({
332
- name: 'media',
333
- params: '(prefers-color-scheme: dark)',
334
- }),
335
- }
336
- )
337
- )
233
+ /** @type {Set<string>} */
234
+ let unitCache = new Set([])
235
+
236
+ /** @param {string} value */
237
+ function units(value) {
238
+ return value.match(/(\D+)$/)?.[1] ?? '(none)'
239
+ }
240
+
241
+ /** @param {string} value */
242
+ function recordUnits(value) {
243
+ if (value !== undefined) {
244
+ unitCache.add(units(value))
245
+ }
338
246
  }
339
- },
340
247
 
341
- screenVariants: ({ config, theme, addVariant }) => {
342
- for (let screen in theme('screens')) {
343
- let size = theme('screens')[screen]
344
- let query = buildMediaQuery(size)
248
+ /** @param {string} value */
249
+ function canUseUnits(value) {
250
+ recordUnits(value)
345
251
 
346
- addVariant(
347
- screen,
348
- transformLastClasses(
349
- (className) => {
350
- return `${screen}${config('separator')}${className}`
351
- },
352
- { wrap: () => postcss.atRule({ name: 'media', params: query }) }
353
- )
252
+ // If the cache was empty it'll become 1 because we've just added the current unit
253
+ // If the cache was not empty and the units are the same the size doesn't change
254
+ // Otherwise, if the units are different from what is already known the size will always be > 1
255
+ return unitCache.size === 1
256
+ }
257
+
258
+ for (const screen of screens) {
259
+ for (const value of screen.values) {
260
+ recordUnits(value.min)
261
+ recordUnits(value.max)
262
+ }
263
+ }
264
+
265
+ let screensUseConsistentUnits = unitCache.size <= 1
266
+
267
+ /**
268
+ * @typedef {import('./util/normalizeScreens').Screen} Screen
269
+ */
270
+
271
+ /**
272
+ * @param {'min' | 'max'} type
273
+ * @returns {Record<string, Screen>}
274
+ */
275
+ function buildScreenValues(type) {
276
+ return Object.fromEntries(
277
+ screens
278
+ .filter((screen) => isScreenSortable(screen).result)
279
+ .map((screen) => {
280
+ let { min, max } = screen.values[0]
281
+
282
+ if (type === 'min' && min !== undefined) {
283
+ return screen
284
+ } else if (type === 'min' && max !== undefined) {
285
+ return { ...screen, not: !screen.not }
286
+ } else if (type === 'max' && max !== undefined) {
287
+ return screen
288
+ } else if (type === 'max' && min !== undefined) {
289
+ return { ...screen, not: !screen.not }
290
+ }
291
+ })
292
+ .map((screen) => [screen.name, screen])
354
293
  )
355
294
  }
295
+
296
+ /**
297
+ * @param {'min' | 'max'} type
298
+ * @returns {(a: { value: string | Screen }, z: { value: string | Screen }) => number}
299
+ */
300
+ function buildSort(type) {
301
+ return (a, z) => compareScreens(type, a.value, z.value)
302
+ }
303
+
304
+ let maxSort = buildSort('max')
305
+ let minSort = buildSort('min')
306
+
307
+ /** @param {'min'|'max'} type */
308
+ function buildScreenVariant(type) {
309
+ return (value) => {
310
+ if (!areSimpleScreens) {
311
+ log.warn('complex-screen-config', [
312
+ 'The min and max variants are not supported with a screen configuration containing objects.',
313
+ ])
314
+
315
+ return []
316
+ } else if (!screensUseConsistentUnits) {
317
+ log.warn('mixed-screen-units', [
318
+ 'The min and max variants are not supported with a screen configuration containing mixed units.',
319
+ ])
320
+
321
+ return []
322
+ } else if (typeof value === 'string' && !canUseUnits(value)) {
323
+ log.warn('minmax-have-mixed-units', [
324
+ 'The min and max variants are not supported with a screen configuration containing mixed units.',
325
+ ])
326
+
327
+ return []
328
+ }
329
+
330
+ return [`@media ${buildMediaQuery(toScreen(value, type))}`]
331
+ }
332
+ }
333
+
334
+ matchVariant('max', buildScreenVariant('max'), {
335
+ sort: maxSort,
336
+ values: areSimpleScreens ? buildScreenValues('max') : {},
337
+ })
338
+
339
+ // screens and min-* are sorted together when they can be
340
+ let id = 'min-screens'
341
+ for (let screen of screens) {
342
+ addVariant(screen.name, `@media ${buildMediaQuery(screen)}`, {
343
+ id,
344
+ sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined,
345
+ value: screen,
346
+ })
347
+ }
348
+
349
+ matchVariant('min', buildScreenVariant('min'), {
350
+ id,
351
+ sort: minSort,
352
+ })
353
+ },
354
+
355
+ supportsVariants: ({ matchVariant, theme }) => {
356
+ matchVariant(
357
+ 'supports',
358
+ (value = '') => {
359
+ let check = normalize(value)
360
+ let isRaw = /^\w*\s*\(/.test(check)
361
+
362
+ // Chrome has a bug where `(condtion1)or(condition2)` is not valid
363
+ // But `(condition1) or (condition2)` is supported.
364
+ check = isRaw ? check.replace(/\b(and|or|not)\b/g, ' $1 ') : check
365
+
366
+ if (isRaw) {
367
+ return `@supports ${check}`
368
+ }
369
+
370
+ if (!check.includes(':')) {
371
+ check = `${check}: var(--tw)`
372
+ }
373
+
374
+ if (!(check.startsWith('(') && check.endsWith(')'))) {
375
+ check = `(${check})`
376
+ }
377
+
378
+ return `@supports ${check}`
379
+ },
380
+ { values: theme('supports') ?? {} }
381
+ )
382
+ },
383
+
384
+ ariaVariants: ({ matchVariant, theme }) => {
385
+ matchVariant('aria', (value) => `&[aria-${normalize(value)}]`, { values: theme('aria') ?? {} })
386
+ matchVariant(
387
+ 'group-aria',
388
+ (value, { modifier }) =>
389
+ modifier
390
+ ? `:merge(.group\\/${modifier})[aria-${normalize(value)}] &`
391
+ : `:merge(.group)[aria-${normalize(value)}] &`,
392
+ { values: theme('aria') ?? {} }
393
+ )
394
+ matchVariant(
395
+ 'peer-aria',
396
+ (value, { modifier }) =>
397
+ modifier
398
+ ? `:merge(.peer\\/${modifier})[aria-${normalize(value)}] ~ &`
399
+ : `:merge(.peer)[aria-${normalize(value)}] ~ &`,
400
+ { values: theme('aria') ?? {} }
401
+ )
402
+ },
403
+
404
+ dataVariants: ({ matchVariant, theme }) => {
405
+ matchVariant('data', (value) => `&[data-${normalize(value)}]`, { values: theme('data') ?? {} })
406
+ matchVariant(
407
+ 'group-data',
408
+ (value, { modifier }) =>
409
+ modifier
410
+ ? `:merge(.group\\/${modifier})[data-${normalize(value)}] &`
411
+ : `:merge(.group)[data-${normalize(value)}] &`,
412
+ { values: theme('data') ?? {} }
413
+ )
414
+ matchVariant(
415
+ 'peer-data',
416
+ (value, { modifier }) =>
417
+ modifier
418
+ ? `:merge(.peer\\/${modifier})[data-${normalize(value)}] ~ &`
419
+ : `:merge(.peer)[data-${normalize(value)}] ~ &`,
420
+ { values: theme('data') ?? {} }
421
+ )
356
422
  },
357
423
 
358
- // Actual plugins
424
+ orientationVariants: ({ addVariant }) => {
425
+ addVariant('portrait', '@media (orientation: portrait)')
426
+ addVariant('landscape', '@media (orientation: landscape)')
427
+ },
428
+
429
+ prefersContrastVariants: ({ addVariant }) => {
430
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
431
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
432
+ },
433
+ }
434
+
435
+ let cssTransformValue = [
436
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
437
+ 'rotate(var(--tw-rotate))',
438
+ 'skewX(var(--tw-skew-x))',
439
+ 'skewY(var(--tw-skew-y))',
440
+ 'scaleX(var(--tw-scale-x))',
441
+ 'scaleY(var(--tw-scale-y))',
442
+ ].join(' ')
443
+
444
+ let cssFilterValue = [
445
+ 'var(--tw-blur)',
446
+ 'var(--tw-brightness)',
447
+ 'var(--tw-contrast)',
448
+ 'var(--tw-grayscale)',
449
+ 'var(--tw-hue-rotate)',
450
+ 'var(--tw-invert)',
451
+ 'var(--tw-saturate)',
452
+ 'var(--tw-sepia)',
453
+ 'var(--tw-drop-shadow)',
454
+ ].join(' ')
455
+
456
+ let cssBackdropFilterValue = [
457
+ 'var(--tw-backdrop-blur)',
458
+ 'var(--tw-backdrop-brightness)',
459
+ 'var(--tw-backdrop-contrast)',
460
+ 'var(--tw-backdrop-grayscale)',
461
+ 'var(--tw-backdrop-hue-rotate)',
462
+ 'var(--tw-backdrop-invert)',
463
+ 'var(--tw-backdrop-opacity)',
464
+ 'var(--tw-backdrop-saturate)',
465
+ 'var(--tw-backdrop-sepia)',
466
+ ].join(' ')
467
+
468
+ export let corePlugins = {
359
469
  preflight: ({ addBase }) => {
360
- let preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8'))
470
+ let preflightStyles = postcss.parse(
471
+ fs.readFileSync(path.join(__dirname, './css/preflight.css'), 'utf8')
472
+ )
361
473
 
362
474
  addBase([
363
475
  postcss.comment({
@@ -368,24 +480,10 @@ export default {
368
480
  },
369
481
 
370
482
  container: (() => {
371
- function extractMinWidths(breakpoints) {
372
- return Object.values(breakpoints ?? {}).flatMap((breakpoints) => {
373
- if (typeof breakpoints === 'string') {
374
- breakpoints = { min: breakpoints }
375
- }
376
-
377
- if (!Array.isArray(breakpoints)) {
378
- breakpoints = [breakpoints]
379
- }
380
-
381
- return breakpoints
382
- .filter((breakpoint) => {
383
- return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
384
- })
385
- .map((breakpoint) => {
386
- return breakpoint['min-width'] ?? breakpoint.min
387
- })
388
- })
483
+ function extractMinWidths(breakpoints = []) {
484
+ return breakpoints
485
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
486
+ .filter((v) => v !== undefined)
389
487
  }
390
488
 
391
489
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
@@ -414,16 +512,11 @@ export default {
414
512
  }
415
513
 
416
514
  for (let minWidth of minWidths) {
417
- for (let [screen, value] of Object.entries(screens)) {
418
- let screenMinWidth =
419
- typeof value === 'object' && value !== null ? value.min || value['min-width'] : value
420
-
421
- if (`${screenMinWidth}` === `${minWidth}`) {
422
- mapping.push({
423
- screen,
424
- minWidth,
425
- padding: paddings[screen],
426
- })
515
+ for (let screen of screens) {
516
+ for (let { min } of screen.values) {
517
+ if (min === minWidth) {
518
+ mapping.push({ minWidth, padding: paddings[screen.name] })
519
+ }
427
520
  }
428
521
  }
429
522
  }
@@ -432,12 +525,12 @@ export default {
432
525
  }
433
526
 
434
527
  return function ({ addComponents, theme }) {
435
- let screens = theme('container.screens', theme('screens'))
528
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
436
529
  let minWidths = extractMinWidths(screens)
437
530
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
438
531
 
439
532
  let generatePaddingFor = (minWidth) => {
440
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
533
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
441
534
 
442
535
  if (!paddingConfig) {
443
536
  return {}
@@ -510,6 +603,7 @@ export default {
510
603
  addUtilities({
511
604
  '.visible': { visibility: 'visible' },
512
605
  '.invisible': { visibility: 'hidden' },
606
+ '.collapse': { visibility: 'collapse' },
513
607
  })
514
608
  },
515
609
 
@@ -523,19 +617,23 @@ export default {
523
617
  })
524
618
  },
525
619
 
526
- inset: createUtilityPlugin('inset', [
527
- ['inset', ['top', 'right', 'bottom', 'left']],
528
- [
529
- ['inset-x', ['left', 'right']],
530
- ['inset-y', ['top', 'bottom']],
531
- ],
620
+ inset: createUtilityPlugin(
621
+ 'inset',
532
622
  [
533
- ['top', ['top']],
534
- ['right', ['right']],
535
- ['bottom', ['bottom']],
536
- ['left', ['left']],
623
+ ['inset', ['top', 'right', 'bottom', 'left']],
624
+ [
625
+ ['inset-x', ['left', 'right']],
626
+ ['inset-y', ['top', 'bottom']],
627
+ ],
628
+ [
629
+ ['top', ['top']],
630
+ ['right', ['right']],
631
+ ['bottom', ['bottom']],
632
+ ['left', ['left']],
633
+ ],
537
634
  ],
538
- ]),
635
+ { supportsNegativeValues: true }
636
+ ),
539
637
 
540
638
  isolation: ({ addUtilities }) => {
541
639
  addUtilities({
@@ -544,8 +642,8 @@ export default {
544
642
  })
545
643
  },
546
644
 
547
- zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]]),
548
- order: createUtilityPlugin('order'),
645
+ zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]], { supportsNegativeValues: true }),
646
+ order: createUtilityPlugin('order', undefined, { supportsNegativeValues: true }),
549
647
  gridColumn: createUtilityPlugin('gridColumn', [['col', ['gridColumn']]]),
550
648
  gridColumnStart: createUtilityPlugin('gridColumnStart', [['col-start', ['gridColumnStart']]]),
551
649
  gridColumnEnd: createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]]),
@@ -570,19 +668,23 @@ export default {
570
668
  })
571
669
  },
572
670
 
573
- margin: createUtilityPlugin('margin', [
574
- ['m', ['margin']],
575
- [
576
- ['mx', ['margin-left', 'margin-right']],
577
- ['my', ['margin-top', 'margin-bottom']],
578
- ],
671
+ margin: createUtilityPlugin(
672
+ 'margin',
579
673
  [
580
- ['mt', ['margin-top']],
581
- ['mr', ['margin-right']],
582
- ['mb', ['margin-bottom']],
583
- ['ml', ['margin-left']],
674
+ ['m', ['margin']],
675
+ [
676
+ ['mx', ['margin-left', 'margin-right']],
677
+ ['my', ['margin-top', 'margin-bottom']],
678
+ ],
679
+ [
680
+ ['mt', ['margin-top']],
681
+ ['mr', ['margin-right']],
682
+ ['mb', ['margin-bottom']],
683
+ ['ml', ['margin-left']],
684
+ ],
584
685
  ],
585
- ]),
686
+ { supportsNegativeValues: true }
687
+ ),
586
688
 
587
689
  boxSizing: ({ addUtilities }) => {
588
690
  addUtilities({
@@ -628,8 +730,15 @@ export default {
628
730
  maxWidth: createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]]),
629
731
 
630
732
  flex: createUtilityPlugin('flex'),
631
- flexShrink: createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]]),
632
- flexGrow: createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]]),
733
+ flexShrink: createUtilityPlugin('flexShrink', [
734
+ ['flex-shrink', ['flex-shrink']], // Deprecated
735
+ ['shrink', ['flex-shrink']],
736
+ ]),
737
+ flexGrow: createUtilityPlugin('flexGrow', [
738
+ ['flex-grow', ['flex-grow']], // Deprecated
739
+ ['grow', ['flex-grow']],
740
+ ]),
741
+ flexBasis: createUtilityPlugin('flexBasis', [['basis', ['flex-basis']]]),
633
742
 
634
743
  tableLayout: ({ addUtilities }) => {
635
744
  addUtilities({
@@ -645,133 +754,151 @@ export default {
645
754
  })
646
755
  },
647
756
 
757
+ borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
758
+ addDefaults('border-spacing', {
759
+ '--tw-border-spacing-x': 0,
760
+ '--tw-border-spacing-y': 0,
761
+ })
762
+
763
+ matchUtilities(
764
+ {
765
+ 'border-spacing': (value) => {
766
+ return {
767
+ '--tw-border-spacing-x': value,
768
+ '--tw-border-spacing-y': value,
769
+ '@defaults border-spacing': {},
770
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
771
+ }
772
+ },
773
+ 'border-spacing-x': (value) => {
774
+ return {
775
+ '--tw-border-spacing-x': value,
776
+ '@defaults border-spacing': {},
777
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
778
+ }
779
+ },
780
+ 'border-spacing-y': (value) => {
781
+ return {
782
+ '--tw-border-spacing-y': value,
783
+ '@defaults border-spacing': {},
784
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
785
+ }
786
+ },
787
+ },
788
+ { values: theme('borderSpacing') }
789
+ )
790
+ },
791
+
648
792
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
649
- translate: createUtilityPlugin('translate', [
650
- [
651
- [
652
- 'translate-x',
653
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
654
- ],
655
- [
656
- 'translate-y',
657
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
658
- ],
659
- ],
660
- ]),
661
- rotate: createUtilityPlugin('rotate', [
662
- ['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']]],
663
- ]),
664
- skew: createUtilityPlugin('skew', [
793
+ translate: createUtilityPlugin(
794
+ 'translate',
665
795
  [
666
796
  [
667
- 'skew-x',
668
- [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
669
- ],
670
- [
671
- 'skew-y',
672
- [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
797
+ [
798
+ 'translate-x',
799
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
800
+ ],
801
+ [
802
+ 'translate-y',
803
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
804
+ ],
673
805
  ],
674
806
  ],
675
- ]),
676
- scale: createUtilityPlugin('scale', [
807
+ { supportsNegativeValues: true }
808
+ ),
809
+ rotate: createUtilityPlugin(
810
+ 'rotate',
811
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
812
+ { supportsNegativeValues: true }
813
+ ),
814
+ skew: createUtilityPlugin(
815
+ 'skew',
677
816
  [
678
- 'scale',
679
817
  [
680
- ['@defaults transform', {}],
681
- '--tw-scale-x',
682
- '--tw-scale-y',
683
- ['transform', 'var(--tw-transform)'],
818
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
819
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
684
820
  ],
685
821
  ],
822
+ { supportsNegativeValues: true }
823
+ ),
824
+ scale: createUtilityPlugin(
825
+ 'scale',
686
826
  [
687
827
  [
688
- 'scale-x',
689
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
828
+ 'scale',
829
+ [
830
+ ['@defaults transform', {}],
831
+ '--tw-scale-x',
832
+ '--tw-scale-y',
833
+ ['transform', cssTransformValue],
834
+ ],
690
835
  ],
691
836
  [
692
- 'scale-y',
693
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
837
+ [
838
+ 'scale-x',
839
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
840
+ ],
841
+ [
842
+ 'scale-y',
843
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
844
+ ],
694
845
  ],
695
846
  ],
696
- ]),
847
+ { supportsNegativeValues: true }
848
+ ),
697
849
 
698
- transform: ({ addBase, addUtilities }) => {
699
- addBase({
700
- '@defaults transform': {
701
- '--tw-translate-x': '0',
702
- '--tw-translate-y': '0',
703
- '--tw-rotate': '0',
704
- '--tw-skew-x': '0',
705
- '--tw-skew-y': '0',
706
- '--tw-scale-x': '1',
707
- '--tw-scale-y': '1',
708
- '--tw-transform': [
709
- 'translateX(var(--tw-translate-x))',
710
- 'translateY(var(--tw-translate-y))',
711
- 'rotate(var(--tw-rotate))',
712
- 'skewX(var(--tw-skew-x))',
713
- 'skewY(var(--tw-skew-y))',
714
- 'scaleX(var(--tw-scale-x))',
715
- 'scaleY(var(--tw-scale-y))',
716
- ].join(' '),
717
- },
718
- })
719
- addUtilities({
720
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
850
+ transform: ({ addDefaults, addUtilities }) => {
851
+ addDefaults('transform', {
852
+ '--tw-translate-x': '0',
853
+ '--tw-translate-y': '0',
854
+ '--tw-rotate': '0',
855
+ '--tw-skew-x': '0',
856
+ '--tw-skew-y': '0',
857
+ '--tw-scale-x': '1',
858
+ '--tw-scale-y': '1',
859
+ })
860
+
861
+ addUtilities({
862
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
721
863
  '.transform-cpu': {
722
- '--tw-transform': [
723
- 'translateX(var(--tw-translate-x))',
724
- 'translateY(var(--tw-translate-y))',
725
- 'rotate(var(--tw-rotate))',
726
- 'skewX(var(--tw-skew-x))',
727
- 'skewY(var(--tw-skew-y))',
728
- 'scaleX(var(--tw-scale-x))',
729
- 'scaleY(var(--tw-scale-y))',
730
- ].join(' '),
864
+ transform: cssTransformValue,
731
865
  },
732
866
  '.transform-gpu': {
733
- '--tw-transform': [
734
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
735
- 'rotate(var(--tw-rotate))',
736
- 'skewX(var(--tw-skew-x))',
737
- 'skewY(var(--tw-skew-y))',
738
- 'scaleX(var(--tw-scale-x))',
739
- 'scaleY(var(--tw-scale-y))',
740
- ].join(' '),
867
+ transform: cssTransformValue.replace(
868
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
869
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
870
+ ),
741
871
  },
742
872
  '.transform-none': { transform: 'none' },
743
873
  })
744
874
  },
745
875
 
746
- animation: ({ matchUtilities, theme, prefix }) => {
747
- let prefixName = (name) => prefix(`.${name}`).slice(1)
876
+ animation: ({ matchUtilities, theme, config }) => {
877
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
748
878
  let keyframes = Object.fromEntries(
749
879
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
750
- return [key, [{ [`@keyframes ${prefixName(key)}`]: value }]]
880
+ return [key, { [`@keyframes ${prefixName(key)}`]: value }]
751
881
  })
752
882
  )
753
883
 
754
884
  matchUtilities(
755
885
  {
756
- animate: (value, { includeRules }) => {
886
+ animate: (value) => {
757
887
  let animations = parseAnimationValue(value)
758
888
 
759
- for (let { name } of animations) {
760
- if (keyframes[name] !== undefined) {
761
- includeRules(keyframes[name], { respectImportant: false })
762
- }
763
- }
764
-
765
- return {
766
- animation: animations
767
- .map(({ name, value }) => {
768
- if (name === undefined || keyframes[name] === undefined) {
769
- return value
770
- }
771
- return value.replace(name, prefixName(name))
772
- })
773
- .join(', '),
774
- }
889
+ return [
890
+ ...animations.flatMap((animation) => keyframes[animation.name]),
891
+ {
892
+ animation: animations
893
+ .map(({ name, value }) => {
894
+ if (name === undefined || keyframes[name] === undefined) {
895
+ return value
896
+ }
897
+ return value.replace(name, prefixName(name))
898
+ })
899
+ .join(', '),
900
+ },
901
+ ]
775
902
  },
776
903
  },
777
904
  { values: theme('animation') }
@@ -780,17 +907,53 @@ export default {
780
907
 
781
908
  cursor: createUtilityPlugin('cursor'),
782
909
 
783
- touchAction: ({ addUtilities }) => {
910
+ touchAction: ({ addDefaults, addUtilities }) => {
911
+ addDefaults('touch-action', {
912
+ '--tw-pan-x': ' ',
913
+ '--tw-pan-y': ' ',
914
+ '--tw-pinch-zoom': ' ',
915
+ })
916
+
917
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
918
+
784
919
  addUtilities({
785
920
  '.touch-auto': { 'touch-action': 'auto' },
786
921
  '.touch-none': { 'touch-action': 'none' },
787
- '.touch-pan-x': { 'touch-action': 'pan-x' },
788
- '.touch-pan-left': { 'touch-action': 'pan-left' },
789
- '.touch-pan-right': { 'touch-action': 'pan-right' },
790
- '.touch-pan-y': { 'touch-action': 'pan-y' },
791
- '.touch-pan-up': { 'touch-action': 'pan-up' },
792
- '.touch-pan-down': { 'touch-action': 'pan-down' },
793
- '.touch-pinch-zoom': { 'touch-action': 'pinch-zoom' },
922
+ '.touch-pan-x': {
923
+ '@defaults touch-action': {},
924
+ '--tw-pan-x': 'pan-x',
925
+ 'touch-action': cssTouchActionValue,
926
+ },
927
+ '.touch-pan-left': {
928
+ '@defaults touch-action': {},
929
+ '--tw-pan-x': 'pan-left',
930
+ 'touch-action': cssTouchActionValue,
931
+ },
932
+ '.touch-pan-right': {
933
+ '@defaults touch-action': {},
934
+ '--tw-pan-x': 'pan-right',
935
+ 'touch-action': cssTouchActionValue,
936
+ },
937
+ '.touch-pan-y': {
938
+ '@defaults touch-action': {},
939
+ '--tw-pan-y': 'pan-y',
940
+ 'touch-action': cssTouchActionValue,
941
+ },
942
+ '.touch-pan-up': {
943
+ '@defaults touch-action': {},
944
+ '--tw-pan-y': 'pan-up',
945
+ 'touch-action': cssTouchActionValue,
946
+ },
947
+ '.touch-pan-down': {
948
+ '@defaults touch-action': {},
949
+ '--tw-pan-y': 'pan-down',
950
+ 'touch-action': cssTouchActionValue,
951
+ },
952
+ '.touch-pinch-zoom': {
953
+ '@defaults touch-action': {},
954
+ '--tw-pinch-zoom': 'pinch-zoom',
955
+ 'touch-action': cssTouchActionValue,
956
+ },
794
957
  '.touch-manipulation': { 'touch-action': 'manipulation' },
795
958
  })
796
959
  },
@@ -813,11 +976,9 @@ export default {
813
976
  })
814
977
  },
815
978
 
816
- scrollSnapType: ({ addUtilities, addBase }) => {
817
- addBase({
818
- '@defaults scroll-snap-type': {
819
- '--tw-scroll-snap-strictness': 'proximity',
820
- },
979
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
980
+ addDefaults('scroll-snap-type', {
981
+ '--tw-scroll-snap-strictness': 'proximity',
821
982
  })
822
983
 
823
984
  addUtilities({
@@ -855,19 +1016,23 @@ export default {
855
1016
  })
856
1017
  },
857
1018
 
858
- scrollMargin: createUtilityPlugin('scrollMargin', [
859
- ['scroll-m', ['scroll-margin']],
860
- [
861
- ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
862
- ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
863
- ],
1019
+ scrollMargin: createUtilityPlugin(
1020
+ 'scrollMargin',
864
1021
  [
865
- ['scroll-mt', ['scroll-margin-top']],
866
- ['scroll-mr', ['scroll-margin-right']],
867
- ['scroll-mb', ['scroll-margin-bottom']],
868
- ['scroll-ml', ['scroll-margin-left']],
1022
+ ['scroll-m', ['scroll-margin']],
1023
+ [
1024
+ ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
1025
+ ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
1026
+ ],
1027
+ [
1028
+ ['scroll-mt', ['scroll-margin-top']],
1029
+ ['scroll-mr', ['scroll-margin-right']],
1030
+ ['scroll-mb', ['scroll-margin-bottom']],
1031
+ ['scroll-ml', ['scroll-margin-left']],
1032
+ ],
869
1033
  ],
870
- ]),
1034
+ { supportsNegativeValues: true }
1035
+ ),
871
1036
 
872
1037
  scrollPadding: createUtilityPlugin('scrollPadding', [
873
1038
  ['scroll-p', ['scroll-padding']],
@@ -941,6 +1106,7 @@ export default {
941
1106
  addUtilities({
942
1107
  '.grid-flow-row': { gridAutoFlow: 'row' },
943
1108
  '.grid-flow-col': { gridAutoFlow: 'column' },
1109
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
944
1110
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
945
1111
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
946
1112
  })
@@ -977,6 +1143,7 @@ export default {
977
1143
  '.place-content-between': { 'place-content': 'space-between' },
978
1144
  '.place-content-around': { 'place-content': 'space-around' },
979
1145
  '.place-content-evenly': { 'place-content': 'space-evenly' },
1146
+ '.place-content-baseline': { 'place-content': 'baseline' },
980
1147
  '.place-content-stretch': { 'place-content': 'stretch' },
981
1148
  })
982
1149
  },
@@ -986,6 +1153,7 @@ export default {
986
1153
  '.place-items-start': { 'place-items': 'start' },
987
1154
  '.place-items-end': { 'place-items': 'end' },
988
1155
  '.place-items-center': { 'place-items': 'center' },
1156
+ '.place-items-baseline': { 'place-items': 'baseline' },
989
1157
  '.place-items-stretch': { 'place-items': 'stretch' },
990
1158
  })
991
1159
  },
@@ -998,6 +1166,7 @@ export default {
998
1166
  '.content-between': { 'align-content': 'space-between' },
999
1167
  '.content-around': { 'align-content': 'space-around' },
1000
1168
  '.content-evenly': { 'align-content': 'space-evenly' },
1169
+ '.content-baseline': { 'align-content': 'baseline' },
1001
1170
  })
1002
1171
  },
1003
1172
 
@@ -1065,7 +1234,7 @@ export default {
1065
1234
  }
1066
1235
  },
1067
1236
  },
1068
- { values: theme('space') }
1237
+ { values: theme('space'), supportsNegativeValues: true }
1069
1238
  )
1070
1239
 
1071
1240
  addUtilities({
@@ -1102,7 +1271,7 @@ export default {
1102
1271
  }
1103
1272
  },
1104
1273
  },
1105
- { values: theme('divideWidth'), type: ['line-width', 'length'] }
1274
+ { values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
1106
1275
  )
1107
1276
 
1108
1277
  addUtilities({
@@ -1150,7 +1319,7 @@ export default {
1150
1319
  },
1151
1320
  {
1152
1321
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1153
- type: 'color',
1322
+ type: ['color', 'any'],
1154
1323
  }
1155
1324
  )
1156
1325
  },
@@ -1262,6 +1431,7 @@ export default {
1262
1431
  '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1263
1432
  '.break-words': { 'overflow-wrap': 'break-word' },
1264
1433
  '.break-all': { 'word-break': 'break-all' },
1434
+ '.break-keep': { 'word-break': 'keep-all' },
1265
1435
  })
1266
1436
  },
1267
1437
 
@@ -1310,24 +1480,7 @@ export default {
1310
1480
  })
1311
1481
  },
1312
1482
 
1313
- borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1314
- if (!corePlugins('borderOpacity')) {
1315
- let value = theme('borderColor.DEFAULT', 'currentColor')
1316
- addBase({
1317
- '@defaults border-width': {
1318
- 'border-color': toColorValue(value),
1319
- },
1320
- })
1321
- } else {
1322
- addBase({
1323
- '@defaults border-width': withAlphaVariable({
1324
- color: theme('borderColor.DEFAULT', 'currentColor'),
1325
- property: 'border-color',
1326
- variable: '--tw-border-opacity',
1327
- }),
1328
- })
1329
- }
1330
-
1483
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1331
1484
  matchUtilities(
1332
1485
  {
1333
1486
  border: (value) => {
@@ -1346,7 +1499,7 @@ export default {
1346
1499
  },
1347
1500
  {
1348
1501
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1349
- type: ['color'],
1502
+ type: ['color', 'any'],
1350
1503
  }
1351
1504
  )
1352
1505
 
@@ -1383,7 +1536,7 @@ export default {
1383
1536
  },
1384
1537
  {
1385
1538
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1386
- type: 'color',
1539
+ type: ['color', 'any'],
1387
1540
  }
1388
1541
  )
1389
1542
 
@@ -1444,7 +1597,7 @@ export default {
1444
1597
  },
1445
1598
  {
1446
1599
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1447
- type: 'color',
1600
+ type: ['color', 'any'],
1448
1601
  }
1449
1602
  )
1450
1603
  },
@@ -1470,7 +1623,7 @@ export default {
1470
1623
  })
1471
1624
  },
1472
1625
  },
1473
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1626
+ { values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
1474
1627
  )
1475
1628
  },
1476
1629
 
@@ -1498,7 +1651,8 @@ export default {
1498
1651
 
1499
1652
  return {
1500
1653
  '--tw-gradient-from': toColorValue(value, 'from'),
1501
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1654
+ '--tw-gradient-to': transparentToValue,
1655
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
1502
1656
  }
1503
1657
  },
1504
1658
  },
@@ -1510,10 +1664,11 @@ export default {
1510
1664
  let transparentToValue = transparentTo(value)
1511
1665
 
1512
1666
  return {
1667
+ '--tw-gradient-to': transparentToValue,
1513
1668
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1514
1669
  value,
1515
1670
  'via'
1516
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1671
+ )}, var(--tw-gradient-to)`,
1517
1672
  }
1518
1673
  },
1519
1674
  },
@@ -1528,13 +1683,15 @@ export default {
1528
1683
 
1529
1684
  boxDecorationBreak: ({ addUtilities }) => {
1530
1685
  addUtilities({
1531
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1532
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1686
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1687
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1688
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1689
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1533
1690
  })
1534
1691
  },
1535
1692
 
1536
1693
  backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1537
- type: ['lookup', 'length', 'percentage'],
1694
+ type: ['lookup', 'length', 'percentage', 'size'],
1538
1695
  }),
1539
1696
 
1540
1697
  backgroundAttachment: ({ addUtilities }) => {
@@ -1555,7 +1712,7 @@ export default {
1555
1712
  },
1556
1713
 
1557
1714
  backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1558
- type: ['lookup', 'position'],
1715
+ type: ['lookup', ['position', { preferOnConflict: true }]],
1559
1716
  }),
1560
1717
 
1561
1718
  backgroundRepeat: ({ addUtilities }) => {
@@ -1595,7 +1752,7 @@ export default {
1595
1752
  return { stroke: toColorValue(value) }
1596
1753
  },
1597
1754
  },
1598
- { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1755
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
1599
1756
  )
1600
1757
  },
1601
1758
 
@@ -1634,10 +1791,14 @@ export default {
1634
1791
  '.text-center': { 'text-align': 'center' },
1635
1792
  '.text-right': { 'text-align': 'right' },
1636
1793
  '.text-justify': { 'text-align': 'justify' },
1794
+ '.text-start': { 'text-align': 'start' },
1795
+ '.text-end': { 'text-align': 'end' },
1637
1796
  })
1638
1797
  },
1639
1798
 
1640
- textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]]),
1799
+ textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]], {
1800
+ supportsNegativeValues: true,
1801
+ }),
1641
1802
 
1642
1803
  verticalAlign: ({ addUtilities, matchUtilities }) => {
1643
1804
  addUtilities({
@@ -1654,16 +1815,35 @@ export default {
1654
1815
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1655
1816
  },
1656
1817
 
1657
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1658
- type: ['lookup', 'generic-name', 'family-name'],
1659
- }),
1818
+ fontFamily: ({ matchUtilities, theme }) => {
1819
+ matchUtilities(
1820
+ {
1821
+ font: (value) => {
1822
+ let [families, options = {}] =
1823
+ Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
1824
+ let { fontFeatureSettings } = options
1825
+
1826
+ return {
1827
+ 'font-family': Array.isArray(families) ? families.join(', ') : families,
1828
+ ...(fontFeatureSettings === undefined
1829
+ ? {}
1830
+ : { 'font-feature-settings': fontFeatureSettings }),
1831
+ }
1832
+ },
1833
+ },
1834
+ {
1835
+ values: theme('fontFamily'),
1836
+ type: ['lookup', 'generic-name', 'family-name'],
1837
+ }
1838
+ )
1839
+ },
1660
1840
 
1661
1841
  fontSize: ({ matchUtilities, theme }) => {
1662
1842
  matchUtilities(
1663
1843
  {
1664
1844
  text: (value) => {
1665
1845
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1666
- let { lineHeight, letterSpacing } = isPlainObject(options)
1846
+ let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1667
1847
  ? options
1668
1848
  : { lineHeight: options }
1669
1849
 
@@ -1671,6 +1851,7 @@ export default {
1671
1851
  'font-size': fontSize,
1672
1852
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1673
1853
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1854
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1674
1855
  }
1675
1856
  },
1676
1857
  },
@@ -1682,7 +1863,7 @@ export default {
1682
1863
  },
1683
1864
 
1684
1865
  fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1685
- type: ['lookup', 'number'],
1866
+ type: ['lookup', 'number', 'any'],
1686
1867
  }),
1687
1868
 
1688
1869
  textTransform: ({ addUtilities }) => {
@@ -1701,32 +1882,67 @@ export default {
1701
1882
  })
1702
1883
  },
1703
1884
 
1704
- fontVariantNumeric: ({ addUtilities }) => {
1885
+ fontVariantNumeric: ({ addDefaults, addUtilities }) => {
1886
+ let cssFontVariantNumericValue =
1887
+ 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
1888
+
1889
+ addDefaults('font-variant-numeric', {
1890
+ '--tw-ordinal': ' ',
1891
+ '--tw-slashed-zero': ' ',
1892
+ '--tw-numeric-figure': ' ',
1893
+ '--tw-numeric-spacing': ' ',
1894
+ '--tw-numeric-fraction': ' ',
1895
+ })
1896
+
1705
1897
  addUtilities({
1706
- '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions':
1707
- {
1708
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1709
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1710
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1711
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1712
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1713
- 'font-variant-numeric':
1714
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1715
- },
1716
1898
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1717
- '.ordinal': { '--tw-ordinal': 'ordinal' },
1718
- '.slashed-zero': { '--tw-slashed-zero': 'slashed-zero' },
1719
- '.lining-nums': { '--tw-numeric-figure': 'lining-nums' },
1720
- '.oldstyle-nums': { '--tw-numeric-figure': 'oldstyle-nums' },
1721
- '.proportional-nums': { '--tw-numeric-spacing': 'proportional-nums' },
1722
- '.tabular-nums': { '--tw-numeric-spacing': 'tabular-nums' },
1723
- '.diagonal-fractions': { '--tw-numeric-fraction': 'diagonal-fractions' },
1724
- '.stacked-fractions': { '--tw-numeric-fraction': 'stacked-fractions' },
1899
+ '.ordinal': {
1900
+ '@defaults font-variant-numeric': {},
1901
+ '--tw-ordinal': 'ordinal',
1902
+ 'font-variant-numeric': cssFontVariantNumericValue,
1903
+ },
1904
+ '.slashed-zero': {
1905
+ '@defaults font-variant-numeric': {},
1906
+ '--tw-slashed-zero': 'slashed-zero',
1907
+ 'font-variant-numeric': cssFontVariantNumericValue,
1908
+ },
1909
+ '.lining-nums': {
1910
+ '@defaults font-variant-numeric': {},
1911
+ '--tw-numeric-figure': 'lining-nums',
1912
+ 'font-variant-numeric': cssFontVariantNumericValue,
1913
+ },
1914
+ '.oldstyle-nums': {
1915
+ '@defaults font-variant-numeric': {},
1916
+ '--tw-numeric-figure': 'oldstyle-nums',
1917
+ 'font-variant-numeric': cssFontVariantNumericValue,
1918
+ },
1919
+ '.proportional-nums': {
1920
+ '@defaults font-variant-numeric': {},
1921
+ '--tw-numeric-spacing': 'proportional-nums',
1922
+ 'font-variant-numeric': cssFontVariantNumericValue,
1923
+ },
1924
+ '.tabular-nums': {
1925
+ '@defaults font-variant-numeric': {},
1926
+ '--tw-numeric-spacing': 'tabular-nums',
1927
+ 'font-variant-numeric': cssFontVariantNumericValue,
1928
+ },
1929
+ '.diagonal-fractions': {
1930
+ '@defaults font-variant-numeric': {},
1931
+ '--tw-numeric-fraction': 'diagonal-fractions',
1932
+ 'font-variant-numeric': cssFontVariantNumericValue,
1933
+ },
1934
+ '.stacked-fractions': {
1935
+ '@defaults font-variant-numeric': {},
1936
+ '--tw-numeric-fraction': 'stacked-fractions',
1937
+ 'font-variant-numeric': cssFontVariantNumericValue,
1938
+ },
1725
1939
  })
1726
1940
  },
1727
1941
 
1728
1942
  lineHeight: createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]]),
1729
- letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]]),
1943
+ letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]], {
1944
+ supportsNegativeValues: true,
1945
+ }),
1730
1946
 
1731
1947
  textColor: ({ matchUtilities, theme, corePlugins }) => {
1732
1948
  matchUtilities(
@@ -1743,7 +1959,7 @@ export default {
1743
1959
  })
1744
1960
  },
1745
1961
  },
1746
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
1962
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
1747
1963
  )
1748
1964
  },
1749
1965
 
@@ -1751,12 +1967,46 @@ export default {
1751
1967
 
1752
1968
  textDecoration: ({ addUtilities }) => {
1753
1969
  addUtilities({
1754
- '.underline': { 'text-decoration': 'underline' },
1755
- '.line-through': { 'text-decoration': 'line-through' },
1756
- '.no-underline': { 'text-decoration': 'none' },
1970
+ '.underline': { 'text-decoration-line': 'underline' },
1971
+ '.overline': { 'text-decoration-line': 'overline' },
1972
+ '.line-through': { 'text-decoration-line': 'line-through' },
1973
+ '.no-underline': { 'text-decoration-line': 'none' },
1757
1974
  })
1758
1975
  },
1759
1976
 
1977
+ textDecorationColor: ({ matchUtilities, theme }) => {
1978
+ matchUtilities(
1979
+ {
1980
+ decoration: (value) => {
1981
+ return { 'text-decoration-color': toColorValue(value) }
1982
+ },
1983
+ },
1984
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1985
+ )
1986
+ },
1987
+
1988
+ textDecorationStyle: ({ addUtilities }) => {
1989
+ addUtilities({
1990
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1991
+ '.decoration-double': { 'text-decoration-style': 'double' },
1992
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1993
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1994
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1995
+ })
1996
+ },
1997
+
1998
+ textDecorationThickness: createUtilityPlugin(
1999
+ 'textDecorationThickness',
2000
+ [['decoration', ['text-decoration-thickness']]],
2001
+ { type: ['length', 'percentage'] }
2002
+ ),
2003
+
2004
+ textUnderlineOffset: createUtilityPlugin(
2005
+ 'textUnderlineOffset',
2006
+ [['underline-offset', ['text-underline-offset']]],
2007
+ { type: ['length', 'percentage', 'any'] }
2008
+ ),
2009
+
1760
2010
  fontSmoothing: ({ addUtilities }) => {
1761
2011
  addUtilities({
1762
2012
  '.antialiased': {
@@ -1869,6 +2119,7 @@ export default {
1869
2119
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1870
2120
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1871
2121
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
2122
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1872
2123
  })
1873
2124
  },
1874
2125
 
@@ -1880,13 +2131,12 @@ export default {
1880
2131
  `var(--tw-shadow)`,
1881
2132
  ].join(', ')
1882
2133
 
1883
- return function ({ matchUtilities, addBase, theme }) {
1884
- addBase({
1885
- '@defaults box-shadow': {
1886
- '--tw-ring-offset-shadow': '0 0 #0000',
1887
- '--tw-ring-shadow': '0 0 #0000',
1888
- '--tw-shadow': '0 0 #0000',
1889
- },
2134
+ return function ({ matchUtilities, addDefaults, theme }) {
2135
+ addDefaults(' box-shadow', {
2136
+ '--tw-ring-offset-shadow': '0 0 #0000',
2137
+ '--tw-ring-shadow': '0 0 #0000',
2138
+ '--tw-shadow': '0 0 #0000',
2139
+ '--tw-shadow-colored': '0 0 #0000',
1890
2140
  })
1891
2141
 
1892
2142
  matchUtilities(
@@ -1894,50 +2144,104 @@ export default {
1894
2144
  shadow: (value) => {
1895
2145
  value = transformValue(value)
1896
2146
 
2147
+ let ast = parseBoxShadowValue(value)
2148
+ for (let shadow of ast) {
2149
+ // Don't override color if the whole shadow is a variable
2150
+ if (!shadow.valid) {
2151
+ continue
2152
+ }
2153
+
2154
+ shadow.color = 'var(--tw-shadow-color)'
2155
+ }
2156
+
1897
2157
  return {
1898
2158
  '@defaults box-shadow': {},
1899
2159
  '--tw-shadow': value === 'none' ? '0 0 #0000' : value,
2160
+ '--tw-shadow-colored': value === 'none' ? '0 0 #0000' : formatBoxShadowValue(ast),
1900
2161
  'box-shadow': defaultBoxShadow,
1901
2162
  }
1902
2163
  },
1903
2164
  },
1904
- { values: theme('boxShadow') }
2165
+ { values: theme('boxShadow'), type: ['shadow'] }
1905
2166
  )
1906
2167
  }
1907
2168
  })(),
1908
2169
 
1909
- outline: ({ matchUtilities, theme }) => {
2170
+ boxShadowColor: ({ matchUtilities, theme }) => {
1910
2171
  matchUtilities(
1911
2172
  {
1912
- outline: (value) => {
1913
- value = Array.isArray(value) ? value : value.split(',')
1914
- let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [value]
1915
-
1916
- return { outline, 'outline-offset': outlineOffset }
2173
+ shadow: (value) => {
2174
+ return {
2175
+ '--tw-shadow-color': toColorValue(value),
2176
+ '--tw-shadow': 'var(--tw-shadow-colored)',
2177
+ }
1917
2178
  },
1918
2179
  },
1919
- { values: theme('outline') }
2180
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
1920
2181
  )
1921
2182
  },
1922
2183
 
1923
- ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1924
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1925
- let ringColorDefault = withAlphaValue(
1926
- theme('ringColor.DEFAULT'),
1927
- ringOpacityDefault,
1928
- `rgb(147 197 253 / ${ringOpacityDefault})`
1929
- )
2184
+ outlineStyle: ({ addUtilities }) => {
2185
+ addUtilities({
2186
+ '.outline-none': {
2187
+ outline: '2px solid transparent',
2188
+ 'outline-offset': '2px',
2189
+ },
2190
+ '.outline': { 'outline-style': 'solid' },
2191
+ '.outline-dashed': { 'outline-style': 'dashed' },
2192
+ '.outline-dotted': { 'outline-style': 'dotted' },
2193
+ '.outline-double': { 'outline-style': 'double' },
2194
+ })
2195
+ },
1930
2196
 
1931
- addBase({
1932
- '@defaults ring-width': {
1933
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1934
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1935
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1936
- '--tw-ring-color': ringColorDefault,
1937
- '--tw-ring-offset-shadow': '0 0 #0000',
1938
- '--tw-ring-shadow': '0 0 #0000',
1939
- '--tw-shadow': '0 0 #0000',
2197
+ outlineWidth: createUtilityPlugin('outlineWidth', [['outline', ['outline-width']]], {
2198
+ type: ['length', 'number', 'percentage'],
2199
+ }),
2200
+
2201
+ outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
2202
+ type: ['length', 'number', 'percentage', 'any'],
2203
+ supportsNegativeValues: true,
2204
+ }),
2205
+
2206
+ outlineColor: ({ matchUtilities, theme }) => {
2207
+ matchUtilities(
2208
+ {
2209
+ outline: (value) => {
2210
+ return { 'outline-color': toColorValue(value) }
2211
+ },
1940
2212
  },
2213
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
2214
+ )
2215
+ },
2216
+
2217
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
2218
+ let ringColorDefault = (() => {
2219
+ if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
2220
+ return theme('ringColor.DEFAULT')
2221
+ }
2222
+
2223
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
2224
+
2225
+ if (!theme('ringColor')?.DEFAULT) {
2226
+ return `rgb(147 197 253 / ${ringOpacityDefault})`
2227
+ }
2228
+
2229
+ return withAlphaValue(
2230
+ theme('ringColor')?.DEFAULT,
2231
+ ringOpacityDefault,
2232
+ `rgb(147 197 253 / ${ringOpacityDefault})`
2233
+ )
2234
+ })()
2235
+
2236
+ addDefaults('ring-width', {
2237
+ '--tw-ring-inset': ' ',
2238
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
2239
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
2240
+ '--tw-ring-color': ringColorDefault,
2241
+ '--tw-ring-offset-shadow': '0 0 #0000',
2242
+ '--tw-ring-shadow': '0 0 #0000',
2243
+ '--tw-shadow': '0 0 #0000',
2244
+ '--tw-shadow-colored': '0 0 #0000',
1941
2245
  })
1942
2246
 
1943
2247
  matchUtilities(
@@ -1963,10 +2267,16 @@ export default {
1963
2267
  })
1964
2268
  },
1965
2269
 
1966
- ringColor: ({ matchUtilities, theme }) => {
2270
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1967
2271
  matchUtilities(
1968
2272
  {
1969
2273
  ring: (value) => {
2274
+ if (!corePlugins('ringOpacity')) {
2275
+ return {
2276
+ '--tw-ring-color': toColorValue(value),
2277
+ }
2278
+ }
2279
+
1970
2280
  return withAlphaVariable({
1971
2281
  color: value,
1972
2282
  property: '--tw-ring-color',
@@ -1980,14 +2290,18 @@ export default {
1980
2290
  ([modifier]) => modifier !== 'DEFAULT'
1981
2291
  )
1982
2292
  ),
1983
- type: 'color',
2293
+ type: ['color', 'any'],
1984
2294
  }
1985
2295
  )
1986
2296
  },
1987
2297
 
1988
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1989
- filterDefault: true,
1990
- }),
2298
+ ringOpacity: (helpers) => {
2299
+ let { config } = helpers
2300
+
2301
+ return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
2302
+ filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
2303
+ })(helpers)
2304
+ },
1991
2305
  ringOffsetWidth: createUtilityPlugin(
1992
2306
  'ringOffsetWidth',
1993
2307
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -2003,7 +2317,7 @@ export default {
2003
2317
  }
2004
2318
  },
2005
2319
  },
2006
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
2320
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
2007
2321
  )
2008
2322
  },
2009
2323
 
@@ -2014,7 +2328,7 @@ export default {
2014
2328
  return {
2015
2329
  '--tw-blur': `blur(${value})`,
2016
2330
  '@defaults filter': {},
2017
- filter: 'var(--tw-filter)',
2331
+ filter: cssFilterValue,
2018
2332
  }
2019
2333
  },
2020
2334
  },
@@ -2029,7 +2343,7 @@ export default {
2029
2343
  return {
2030
2344
  '--tw-brightness': `brightness(${value})`,
2031
2345
  '@defaults filter': {},
2032
- filter: 'var(--tw-filter)',
2346
+ filter: cssFilterValue,
2033
2347
  }
2034
2348
  },
2035
2349
  },
@@ -2044,7 +2358,7 @@ export default {
2044
2358
  return {
2045
2359
  '--tw-contrast': `contrast(${value})`,
2046
2360
  '@defaults filter': {},
2047
- filter: 'var(--tw-filter)',
2361
+ filter: cssFilterValue,
2048
2362
  }
2049
2363
  },
2050
2364
  },
@@ -2061,7 +2375,7 @@ export default {
2061
2375
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2062
2376
  : `drop-shadow(${value})`,
2063
2377
  '@defaults filter': {},
2064
- filter: 'var(--tw-filter)',
2378
+ filter: cssFilterValue,
2065
2379
  }
2066
2380
  },
2067
2381
  },
@@ -2076,7 +2390,7 @@ export default {
2076
2390
  return {
2077
2391
  '--tw-grayscale': `grayscale(${value})`,
2078
2392
  '@defaults filter': {},
2079
- filter: 'var(--tw-filter)',
2393
+ filter: cssFilterValue,
2080
2394
  }
2081
2395
  },
2082
2396
  },
@@ -2091,11 +2405,11 @@ export default {
2091
2405
  return {
2092
2406
  '--tw-hue-rotate': `hue-rotate(${value})`,
2093
2407
  '@defaults filter': {},
2094
- filter: 'var(--tw-filter)',
2408
+ filter: cssFilterValue,
2095
2409
  }
2096
2410
  },
2097
2411
  },
2098
- { values: theme('hueRotate') }
2412
+ { values: theme('hueRotate'), supportsNegativeValues: true }
2099
2413
  )
2100
2414
  },
2101
2415
 
@@ -2106,7 +2420,7 @@ export default {
2106
2420
  return {
2107
2421
  '--tw-invert': `invert(${value})`,
2108
2422
  '@defaults filter': {},
2109
- filter: 'var(--tw-filter)',
2423
+ filter: cssFilterValue,
2110
2424
  }
2111
2425
  },
2112
2426
  },
@@ -2121,7 +2435,7 @@ export default {
2121
2435
  return {
2122
2436
  '--tw-saturate': `saturate(${value})`,
2123
2437
  '@defaults filter': {},
2124
- filter: 'var(--tw-filter)',
2438
+ filter: cssFilterValue,
2125
2439
  }
2126
2440
  },
2127
2441
  },
@@ -2136,7 +2450,7 @@ export default {
2136
2450
  return {
2137
2451
  '--tw-sepia': `sepia(${value})`,
2138
2452
  '@defaults filter': {},
2139
- filter: 'var(--tw-filter)',
2453
+ filter: cssFilterValue,
2140
2454
  }
2141
2455
  },
2142
2456
  },
@@ -2144,33 +2458,20 @@ export default {
2144
2458
  )
2145
2459
  },
2146
2460
 
2147
- filter: ({ addBase, addUtilities }) => {
2148
- addBase({
2149
- '@defaults filter': {
2150
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2151
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2152
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2153
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2154
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2155
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2156
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2157
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2158
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2159
- '--tw-filter': [
2160
- 'var(--tw-blur)',
2161
- 'var(--tw-brightness)',
2162
- 'var(--tw-contrast)',
2163
- 'var(--tw-grayscale)',
2164
- 'var(--tw-hue-rotate)',
2165
- 'var(--tw-invert)',
2166
- 'var(--tw-saturate)',
2167
- 'var(--tw-sepia)',
2168
- 'var(--tw-drop-shadow)',
2169
- ].join(' '),
2170
- },
2171
- })
2172
- addUtilities({
2173
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2461
+ filter: ({ addDefaults, addUtilities }) => {
2462
+ addDefaults('filter', {
2463
+ '--tw-blur': ' ',
2464
+ '--tw-brightness': ' ',
2465
+ '--tw-contrast': ' ',
2466
+ '--tw-grayscale': ' ',
2467
+ '--tw-hue-rotate': ' ',
2468
+ '--tw-invert': ' ',
2469
+ '--tw-saturate': ' ',
2470
+ '--tw-sepia': ' ',
2471
+ '--tw-drop-shadow': ' ',
2472
+ })
2473
+ addUtilities({
2474
+ '.filter': { '@defaults filter': {}, filter: cssFilterValue },
2174
2475
  '.filter-none': { filter: 'none' },
2175
2476
  })
2176
2477
  },
@@ -2182,7 +2483,7 @@ export default {
2182
2483
  return {
2183
2484
  '--tw-backdrop-blur': `blur(${value})`,
2184
2485
  '@defaults backdrop-filter': {},
2185
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2486
+ 'backdrop-filter': cssBackdropFilterValue,
2186
2487
  }
2187
2488
  },
2188
2489
  },
@@ -2197,7 +2498,7 @@ export default {
2197
2498
  return {
2198
2499
  '--tw-backdrop-brightness': `brightness(${value})`,
2199
2500
  '@defaults backdrop-filter': {},
2200
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2501
+ 'backdrop-filter': cssBackdropFilterValue,
2201
2502
  }
2202
2503
  },
2203
2504
  },
@@ -2212,7 +2513,7 @@ export default {
2212
2513
  return {
2213
2514
  '--tw-backdrop-contrast': `contrast(${value})`,
2214
2515
  '@defaults backdrop-filter': {},
2215
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2516
+ 'backdrop-filter': cssBackdropFilterValue,
2216
2517
  }
2217
2518
  },
2218
2519
  },
@@ -2227,7 +2528,7 @@ export default {
2227
2528
  return {
2228
2529
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2229
2530
  '@defaults backdrop-filter': {},
2230
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2531
+ 'backdrop-filter': cssBackdropFilterValue,
2231
2532
  }
2232
2533
  },
2233
2534
  },
@@ -2242,11 +2543,11 @@ export default {
2242
2543
  return {
2243
2544
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2244
2545
  '@defaults backdrop-filter': {},
2245
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2546
+ 'backdrop-filter': cssBackdropFilterValue,
2246
2547
  }
2247
2548
  },
2248
2549
  },
2249
- { values: theme('backdropHueRotate') }
2550
+ { values: theme('backdropHueRotate'), supportsNegativeValues: true }
2250
2551
  )
2251
2552
  },
2252
2553
 
@@ -2257,7 +2558,7 @@ export default {
2257
2558
  return {
2258
2559
  '--tw-backdrop-invert': `invert(${value})`,
2259
2560
  '@defaults backdrop-filter': {},
2260
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2561
+ 'backdrop-filter': cssBackdropFilterValue,
2261
2562
  }
2262
2563
  },
2263
2564
  },
@@ -2272,7 +2573,7 @@ export default {
2272
2573
  return {
2273
2574
  '--tw-backdrop-opacity': `opacity(${value})`,
2274
2575
  '@defaults backdrop-filter': {},
2275
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2576
+ 'backdrop-filter': cssBackdropFilterValue,
2276
2577
  }
2277
2578
  },
2278
2579
  },
@@ -2287,7 +2588,7 @@ export default {
2287
2588
  return {
2288
2589
  '--tw-backdrop-saturate': `saturate(${value})`,
2289
2590
  '@defaults backdrop-filter': {},
2290
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2591
+ 'backdrop-filter': cssBackdropFilterValue,
2291
2592
  }
2292
2593
  },
2293
2594
  },
@@ -2302,7 +2603,7 @@ export default {
2302
2603
  return {
2303
2604
  '--tw-backdrop-sepia': `sepia(${value})`,
2304
2605
  '@defaults backdrop-filter': {},
2305
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2606
+ 'backdrop-filter': cssBackdropFilterValue,
2306
2607
  }
2307
2608
  },
2308
2609
  },
@@ -2310,35 +2611,22 @@ export default {
2310
2611
  )
2311
2612
  },
2312
2613
 
2313
- backdropFilter: ({ addBase, addUtilities }) => {
2314
- addBase({
2315
- '@defaults backdrop-filter': {
2316
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2317
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2318
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2319
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2320
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2321
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2322
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2323
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2324
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2325
- '--tw-backdrop-filter': [
2326
- 'var(--tw-backdrop-blur)',
2327
- 'var(--tw-backdrop-brightness)',
2328
- 'var(--tw-backdrop-contrast)',
2329
- 'var(--tw-backdrop-grayscale)',
2330
- 'var(--tw-backdrop-hue-rotate)',
2331
- 'var(--tw-backdrop-invert)',
2332
- 'var(--tw-backdrop-opacity)',
2333
- 'var(--tw-backdrop-saturate)',
2334
- 'var(--tw-backdrop-sepia)',
2335
- ].join(' '),
2336
- },
2614
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2615
+ addDefaults('backdrop-filter', {
2616
+ '--tw-backdrop-blur': ' ',
2617
+ '--tw-backdrop-brightness': ' ',
2618
+ '--tw-backdrop-contrast': ' ',
2619
+ '--tw-backdrop-grayscale': ' ',
2620
+ '--tw-backdrop-hue-rotate': ' ',
2621
+ '--tw-backdrop-invert': ' ',
2622
+ '--tw-backdrop-opacity': ' ',
2623
+ '--tw-backdrop-saturate': ' ',
2624
+ '--tw-backdrop-sepia': ' ',
2337
2625
  })
2338
2626
  addUtilities({
2339
2627
  '.backdrop-filter': {
2340
2628
  '@defaults backdrop-filter': {},
2341
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2629
+ 'backdrop-filter': cssBackdropFilterValue,
2342
2630
  },
2343
2631
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2344
2632
  })
@@ -2378,5 +2666,7 @@ export default {
2378
2666
  { filterDefault: true }
2379
2667
  ),
2380
2668
  willChange: createUtilityPlugin('willChange', [['will-change', ['will-change']]]),
2381
- content: createUtilityPlugin('content'),
2669
+ content: createUtilityPlugin('content', [
2670
+ ['content', ['--tw-content', ['content', 'var(--tw-content)']]],
2671
+ ]),
2382
2672
  }