tailwindcss 0.0.0-insiders.7b94fea → 0.0.0-insiders.7d8eb21

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 +588 -3
  2. package/LICENSE +1 -2
  3. package/README.md +15 -7
  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 +48 -0
  12. package/lib/cli/build/plugin.js +362 -0
  13. package/lib/cli/build/utils.js +78 -0
  14. package/lib/cli/build/watching.js +178 -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 +108 -571
  21. package/lib/constants.js +27 -20
  22. package/lib/corePluginList.js +15 -4
  23. package/lib/corePlugins.js +2229 -1868
  24. package/lib/css/preflight.css +22 -9
  25. package/lib/featureFlags.js +39 -25
  26. package/lib/index.js +28 -12
  27. package/lib/lib/cacheInvalidation.js +90 -0
  28. package/lib/lib/collapseAdjacentRules.js +28 -10
  29. package/lib/lib/collapseDuplicateDeclarations.js +83 -0
  30. package/lib/lib/content.js +177 -0
  31. package/lib/lib/defaultExtractor.js +241 -0
  32. package/lib/lib/detectNesting.js +27 -3
  33. package/lib/lib/evaluateTailwindFunctions.js +117 -50
  34. package/lib/lib/expandApplyAtRules.js +457 -159
  35. package/lib/lib/expandTailwindAtRules.js +130 -127
  36. package/lib/lib/findAtConfigPath.js +44 -0
  37. package/lib/lib/generateRules.js +610 -141
  38. package/lib/lib/getModuleDependencies.js +11 -8
  39. package/lib/lib/normalizeTailwindDirectives.js +43 -32
  40. package/lib/lib/offsets.js +285 -0
  41. package/lib/lib/partitionApplyAtRules.js +56 -0
  42. package/lib/lib/regex.js +60 -0
  43. package/lib/lib/remap-bitfield.js +87 -0
  44. package/lib/lib/resolveDefaultsAtRules.js +114 -81
  45. package/lib/lib/setupContextUtils.js +718 -323
  46. package/lib/lib/setupTrackingContext.js +43 -71
  47. package/lib/lib/sharedState.js +50 -9
  48. package/lib/lib/substituteScreenAtRules.js +13 -8
  49. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  50. package/lib/postcss-plugins/nesting/index.js +19 -0
  51. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  52. package/lib/processTailwindFeatures.js +36 -21
  53. package/lib/public/colors.js +247 -245
  54. package/lib/public/create-plugin.js +6 -4
  55. package/lib/public/default-config.js +7 -5
  56. package/lib/public/default-theme.js +7 -5
  57. package/lib/public/resolve-config.js +8 -5
  58. package/lib/util/bigSign.js +4 -1
  59. package/lib/util/buildMediaQuery.js +18 -24
  60. package/lib/util/cloneDeep.js +7 -6
  61. package/lib/util/cloneNodes.js +21 -3
  62. package/lib/util/color.js +54 -40
  63. package/lib/util/configurePlugins.js +5 -2
  64. package/lib/util/createPlugin.js +6 -6
  65. package/lib/util/createUtilityPlugin.js +12 -14
  66. package/lib/util/dataTypes.js +164 -100
  67. package/lib/util/defaults.js +12 -3
  68. package/lib/util/escapeClassName.js +9 -6
  69. package/lib/util/escapeCommas.js +5 -2
  70. package/lib/util/flattenColorPalette.js +9 -12
  71. package/lib/util/formatVariantSelector.js +353 -0
  72. package/lib/util/getAllConfigs.js +29 -10
  73. package/lib/util/hashConfig.js +6 -3
  74. package/lib/util/isKeyframeRule.js +5 -2
  75. package/lib/util/isPlainObject.js +5 -2
  76. package/lib/util/isSyntacticallyValidPropertyValue.js +72 -0
  77. package/lib/util/log.js +22 -12
  78. package/lib/util/nameClass.js +20 -8
  79. package/lib/util/negateValue.js +23 -6
  80. package/lib/util/normalizeConfig.js +147 -60
  81. package/lib/util/normalizeScreens.js +170 -0
  82. package/lib/util/parseAnimationValue.js +42 -40
  83. package/lib/util/parseBoxShadowValue.js +84 -0
  84. package/lib/util/parseDependency.js +38 -56
  85. package/lib/util/parseGlob.js +34 -0
  86. package/lib/util/parseObjectStyles.js +11 -8
  87. package/lib/util/pluginUtils.js +182 -181
  88. package/lib/util/prefixSelector.js +27 -13
  89. package/lib/util/removeAlphaVariables.js +29 -0
  90. package/lib/util/resolveConfig.js +97 -73
  91. package/lib/util/resolveConfigPath.js +11 -9
  92. package/lib/util/responsive.js +8 -5
  93. package/lib/util/splitAtTopLevelOnly.js +43 -0
  94. package/lib/util/tap.js +4 -1
  95. package/lib/util/toColorValue.js +5 -3
  96. package/lib/util/toPath.js +24 -3
  97. package/lib/util/transformThemeValue.js +49 -31
  98. package/lib/util/validateConfig.js +24 -0
  99. package/lib/util/validateFormalSyntax.js +24 -0
  100. package/lib/util/withAlphaVariable.js +23 -15
  101. package/nesting/index.js +2 -12
  102. package/package.json +51 -50
  103. package/peers/index.js +15019 -12583
  104. package/plugin.d.ts +11 -0
  105. package/plugin.js +2 -1
  106. package/resolveConfig.d.ts +12 -0
  107. package/resolveConfig.js +2 -1
  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 +49 -0
  114. package/src/cli/build/plugin.js +434 -0
  115. package/src/cli/build/utils.js +76 -0
  116. package/src/cli/build/watching.js +227 -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 +50 -577
  123. package/src/corePluginList.js +1 -1
  124. package/src/corePlugins.js +886 -598
  125. package/src/css/preflight.css +22 -9
  126. package/src/featureFlags.js +24 -8
  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 +213 -0
  132. package/src/lib/defaultExtractor.js +217 -0
  133. package/src/lib/detectNesting.js +30 -3
  134. package/src/lib/evaluateTailwindFunctions.js +84 -10
  135. package/src/lib/expandApplyAtRules.js +508 -153
  136. package/src/lib/expandTailwindAtRules.js +82 -79
  137. package/src/lib/findAtConfigPath.js +48 -0
  138. package/src/lib/generateRules.js +625 -111
  139. package/src/lib/normalizeTailwindDirectives.js +7 -1
  140. package/src/lib/offsets.js +351 -0
  141. package/src/lib/partitionApplyAtRules.js +52 -0
  142. package/src/lib/regex.js +74 -0
  143. package/src/lib/remap-bitfield.js +82 -0
  144. package/src/lib/resolveDefaultsAtRules.js +98 -60
  145. package/src/lib/setupContextUtils.js +666 -168
  146. package/src/lib/setupTrackingContext.js +16 -52
  147. package/src/lib/sharedState.js +44 -4
  148. package/src/lib/substituteScreenAtRules.js +6 -3
  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 +17 -2
  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 +86 -21
  158. package/src/util/defaults.js +6 -0
  159. package/src/util/formatVariantSelector.js +412 -0
  160. package/src/util/getAllConfigs.js +19 -0
  161. package/src/util/isSyntacticallyValidPropertyValue.js +61 -0
  162. package/src/util/log.js +11 -7
  163. package/src/util/nameClass.js +6 -2
  164. package/src/util/negateValue.js +14 -4
  165. package/src/util/normalizeConfig.js +72 -5
  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 +169 -143
  171. package/src/util/prefixSelector.js +30 -13
  172. package/src/util/removeAlphaVariables.js +24 -0
  173. package/src/util/resolveConfig.js +81 -27
  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 +246 -213
  181. package/stubs/simpleConfig.stub.js +1 -0
  182. package/types/config.d.ts +363 -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 -304
@@ -1,145 +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'
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'
22
25
 
23
26
  export let variantPlugins = {
24
- pseudoElementVariants: ({ config, addVariant }) => {
25
- addVariant(
26
- 'first-letter',
27
- transformAllSelectors((selector) => {
28
- return updateAllClasses(selector, (className, { withPseudo }) => {
29
- return withPseudo(`first-letter${config('separator')}${className}`, '::first-letter')
30
- })
31
- })
32
- )
33
-
34
- addVariant(
35
- 'first-line',
36
- transformAllSelectors((selector) => {
37
- return updateAllClasses(selector, (className, { withPseudo }) => {
38
- return withPseudo(`first-line${config('separator')}${className}`, '::first-line')
39
- })
40
- })
41
- )
27
+ pseudoElementVariants: ({ addVariant }) => {
28
+ addVariant('first-letter', '&::first-letter')
29
+ addVariant('first-line', '&::first-line')
42
30
 
43
31
  addVariant('marker', [
44
- transformAllSelectors((selector) => {
45
- let variantSelector = updateAllClasses(selector, (className) => {
46
- return `marker${config('separator')}${className}`
47
- })
32
+ ({ container }) => {
33
+ removeAlphaVariables(container, ['--tw-text-opacity'])
48
34
 
49
- return `${variantSelector} *::marker`
50
- }),
51
- transformAllSelectors((selector) => {
52
- return updateAllClasses(selector, (className, { withPseudo }) => {
53
- return withPseudo(`marker${config('separator')}${className}`, '::marker')
54
- })
55
- }),
35
+ return '& *::marker'
36
+ },
37
+ ({ container }) => {
38
+ removeAlphaVariables(container, ['--tw-text-opacity'])
39
+
40
+ return '&::marker'
41
+ },
56
42
  ])
57
43
 
58
- addVariant('selection', [
59
- transformAllSelectors((selector) => {
60
- let variantSelector = updateAllClasses(selector, (className) => {
61
- return `selection${config('separator')}${className}`
62
- })
44
+ addVariant('selection', ['& *::selection', '&::selection'])
63
45
 
64
- return `${variantSelector} *::selection`
65
- }),
66
- transformAllSelectors((selector) => {
67
- return updateAllClasses(selector, (className, { withPseudo }) => {
68
- return withPseudo(`selection${config('separator')}${className}`, '::selection')
69
- })
70
- }),
71
- ])
46
+ addVariant('file', '&::file-selector-button')
47
+
48
+ addVariant('placeholder', '&::placeholder')
72
49
 
73
- addVariant(
74
- 'file',
75
- transformAllSelectors((selector) => {
76
- return updateAllClasses(selector, (className, { withPseudo }) => {
77
- return withPseudo(`file${config('separator')}${className}`, '::file-selector-button')
50
+ addVariant('backdrop', '&::backdrop')
51
+
52
+ addVariant('before', ({ container }) => {
53
+ container.walkRules((rule) => {
54
+ let foundContent = false
55
+ rule.walkDecls('content', () => {
56
+ foundContent = true
78
57
  })
79
- })
80
- )
81
58
 
82
- addVariant(
83
- 'before',
84
- transformAllSelectors(
85
- (selector) => {
86
- return updateAllClasses(selector, (className, { withPseudo }) => {
87
- return withPseudo(`before${config('separator')}${className}`, '::before')
88
- })
89
- },
90
- {
91
- withRule: (rule) => {
92
- let foundContent = false
93
- rule.walkDecls('content', () => {
94
- foundContent = true
95
- })
96
- if (!foundContent) {
97
- rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
98
- }
99
- },
59
+ if (!foundContent) {
60
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
100
61
  }
101
- )
102
- )
62
+ })
103
63
 
104
- addVariant(
105
- 'after',
106
- transformAllSelectors(
107
- (selector) => {
108
- return updateAllClasses(selector, (className, { withPseudo }) => {
109
- return withPseudo(`after${config('separator')}${className}`, '::after')
110
- })
111
- },
112
- {
113
- withRule: (rule) => {
114
- let foundContent = false
115
- rule.walkDecls('content', () => {
116
- foundContent = true
117
- })
118
- if (!foundContent) {
119
- rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
120
- }
121
- },
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)' }))
122
76
  }
123
- )
124
- )
77
+ })
78
+
79
+ return '&::after'
80
+ })
125
81
  },
126
82
 
127
- pseudoClassVariants: ({ config, addVariant }) => {
83
+ pseudoClassVariants: ({ addVariant, matchVariant, config }) => {
128
84
  let pseudoVariants = [
129
85
  // Positional
130
- ['first', ':first-child'],
131
- ['last', ':last-child'],
132
- ['only', ':only-child'],
133
- ['odd', ':nth-child(odd)'],
134
- ['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)'],
135
91
  'first-of-type',
136
92
  'last-of-type',
137
93
  'only-of-type',
138
94
 
139
95
  // State
140
- '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
+ ],
141
108
  'target',
142
- ['open', '[open]'],
109
+ ['open', '&[open]'],
143
110
 
144
111
  // Forms
145
112
  'default',
@@ -147,6 +114,7 @@ export let variantPlugins = {
147
114
  'indeterminate',
148
115
  'placeholder-shown',
149
116
  'autofill',
117
+ 'optional',
150
118
  'required',
151
119
  'valid',
152
120
  'invalid',
@@ -159,211 +127,342 @@ export let variantPlugins = {
159
127
 
160
128
  // Interactive
161
129
  'focus-within',
162
- 'hover',
130
+ [
131
+ 'hover',
132
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
133
+ ? '&:hover'
134
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
135
+ ],
163
136
  'focus',
164
137
  'focus-visible',
165
138
  'active',
139
+ 'enabled',
166
140
  'disabled',
167
- ]
168
-
169
- for (let variant of pseudoVariants) {
170
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
171
-
172
- addVariant(
173
- variantName,
174
- transformAllClasses((className, { withAttr, withPseudo }) => {
175
- if (state.startsWith(':')) {
176
- return withPseudo(`${variantName}${config('separator')}${className}`, state)
177
- } else if (state.startsWith('[')) {
178
- return withAttr(`${variantName}${config('separator')}${className}`, state)
179
- }
180
- })
181
- )
182
- }
183
-
184
- let groupMarker = prefixSelector(config('prefix'), '.group')
185
- for (let variant of pseudoVariants) {
186
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
187
- let groupVariantName = `group-${variantName}`
188
-
189
- addVariant(
190
- groupVariantName,
191
- transformAllSelectors((selector) => {
192
- let variantSelector = updateAllClasses(selector, (className) => {
193
- if (`.${className}` === groupMarker) return className
194
- return `${groupVariantName}${config('separator')}${className}`
195
- })
141
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
196
142
 
197
- if (variantSelector === selector) {
198
- return null
199
- }
143
+ for (let [variantName, state] of pseudoVariants) {
144
+ addVariant(variantName, (ctx) => {
145
+ let result = typeof state === 'function' ? state(ctx) : state
200
146
 
201
- return applyStateToMarker(
202
- variantSelector,
203
- groupMarker,
204
- state,
205
- (marker, selector) => `${marker} ${selector}`
206
- )
207
- })
208
- )
147
+ return result
148
+ })
209
149
  }
210
150
 
211
- let peerMarker = prefixSelector(config('prefix'), '.peer')
212
- for (let variant of pseudoVariants) {
213
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
214
- let peerVariantName = `peer-${variantName}`
215
-
216
- addVariant(
217
- peerVariantName,
218
- transformAllSelectors((selector) => {
219
- let variantSelector = updateAllClasses(selector, (className) => {
220
- if (`.${className}` === peerMarker) return className
221
- return `${peerVariantName}${config('separator')}${className}`
222
- })
151
+ let variants = {
152
+ group: (_, { modifier }) =>
153
+ modifier ? [`:merge(.group\\/${modifier})`, ' &'] : [`:merge(.group)`, ' &'],
154
+ peer: (_, { modifier }) =>
155
+ modifier ? [`:merge(.peer\\/${modifier})`, ' ~ &'] : [`:merge(.peer)`, ' ~ &'],
156
+ }
223
157
 
224
- if (variantSelector === selector) {
225
- return null
226
- }
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
227
164
 
228
- return applyStateToMarker(variantSelector, peerMarker, state, (marker, selector) =>
229
- selector.trim().startsWith('~') ? `${marker}${selector}` : `${marker} ~ ${selector}`
230
- )
231
- })
165
+ let [a, b] = fn('', extra)
166
+ return result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
167
+ },
168
+ { values: Object.fromEntries(pseudoVariants) }
232
169
  )
233
170
  }
234
171
  },
235
172
 
236
- directionVariants: ({ config, addVariant }) => {
237
- addVariant(
238
- 'ltr',
239
- transformAllSelectors((selector) => {
240
- log.warn('rtl-experimental', [
241
- 'The RTL features in Tailwind CSS are currently in preview.',
242
- 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
243
- ])
244
- return `[dir="ltr"] ${updateAllClasses(
245
- selector,
246
- (className) => `ltr${config('separator')}${className}`
247
- )}`
248
- })
249
- )
173
+ directionVariants: ({ addVariant }) => {
174
+ addVariant('ltr', () => {
175
+ log.warn('rtl-experimental', [
176
+ 'The RTL features in Tailwind CSS are currently in preview.',
177
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
178
+ ])
250
179
 
251
- addVariant(
252
- 'rtl',
253
- transformAllSelectors((selector) => {
254
- log.warn('rtl-experimental', [
255
- 'The RTL features in Tailwind CSS are currently in preview.',
256
- 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
257
- ])
258
- return `[dir="rtl"] ${updateAllClasses(
259
- selector,
260
- (className) => `rtl${config('separator')}${className}`
261
- )}`
262
- })
263
- )
264
- },
180
+ return '[dir="ltr"] &'
181
+ })
265
182
 
266
- reducedMotionVariants: ({ config, addVariant }) => {
267
- addVariant(
268
- 'motion-safe',
269
- transformLastClasses(
270
- (className) => {
271
- return `motion-safe${config('separator')}${className}`
272
- },
273
- {
274
- wrap: () =>
275
- postcss.atRule({
276
- name: 'media',
277
- params: '(prefers-reduced-motion: no-preference)',
278
- }),
279
- }
280
- )
281
- )
183
+ addVariant('rtl', () => {
184
+ log.warn('rtl-experimental', [
185
+ 'The RTL features in Tailwind CSS are currently in preview.',
186
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
187
+ ])
282
188
 
283
- addVariant(
284
- 'motion-reduce',
285
- transformLastClasses(
286
- (className) => {
287
- return `motion-reduce${config('separator')}${className}`
288
- },
289
- {
290
- wrap: () =>
291
- postcss.atRule({
292
- name: 'media',
293
- params: '(prefers-reduced-motion: reduce)',
294
- }),
295
- }
296
- )
297
- )
189
+ return '[dir="rtl"] &'
190
+ })
191
+ },
192
+
193
+ reducedMotionVariants: ({ addVariant }) => {
194
+ addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)')
195
+ addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)')
298
196
  },
299
197
 
300
198
  darkVariants: ({ config, addVariant }) => {
301
- let mode = config('darkMode', 'media')
199
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
200
+
302
201
  if (mode === false) {
303
202
  mode = 'media'
304
203
  log.warn('darkmode-false', [
305
204
  'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
306
205
  'Change `darkMode` to `media` or remove it entirely.',
206
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
307
207
  ])
308
208
  }
309
209
 
310
210
  if (mode === 'class') {
311
- addVariant(
312
- 'dark',
313
- transformAllSelectors((selector) => {
314
- let variantSelector = updateLastClasses(selector, (className) => {
315
- return `dark${config('separator')}${className}`
316
- })
211
+ addVariant('dark', `${className} &`)
212
+ } else if (mode === 'media') {
213
+ addVariant('dark', '@media (prefers-color-scheme: dark)')
214
+ }
215
+ },
317
216
 
318
- if (variantSelector === selector) {
319
- return null
320
- }
217
+ printVariant: ({ addVariant }) => {
218
+ addVariant('print', '@media print')
219
+ },
321
220
 
322
- let darkSelector = prefixSelector(config('prefix'), `.dark`)
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'))
323
225
 
324
- return `${darkSelector} ${variantSelector}`
325
- })
326
- )
327
- } else if (mode === 'media') {
328
- addVariant(
329
- 'dark',
330
- transformLastClasses(
331
- (className) => {
332
- return `dark${config('separator')}${className}`
333
- },
334
- {
335
- wrap: () =>
336
- postcss.atRule({
337
- name: 'media',
338
- params: '(prefers-color-scheme: dark)',
339
- }),
340
- }
341
- )
342
- )
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
+ }
343
239
  }
344
- },
345
240
 
346
- screenVariants: ({ config, theme, addVariant }) => {
347
- for (let screen in theme('screens')) {
348
- let size = theme('screens')[screen]
349
- let query = buildMediaQuery(size)
241
+ /** @param {string} value */
242
+ function canUseUnits(value) {
243
+ recordUnits(value)
350
244
 
351
- addVariant(
352
- screen,
353
- transformLastClasses(
354
- (className) => {
355
- return `${screen}${config('separator')}${className}`
356
- },
357
- { wrap: () => postcss.atRule({ name: 'media', params: query }) }
358
- )
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
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])
359
286
  )
360
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
+ )
415
+ },
416
+
417
+ orientationVariants: ({ addVariant }) => {
418
+ addVariant('portrait', '@media (orientation: portrait)')
419
+ addVariant('landscape', '@media (orientation: landscape)')
420
+ },
421
+
422
+ prefersContrastVariants: ({ addVariant }) => {
423
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
424
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
361
425
  },
362
426
  }
363
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
+
364
461
  export let corePlugins = {
365
462
  preflight: ({ addBase }) => {
366
- let preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8'))
463
+ let preflightStyles = postcss.parse(
464
+ fs.readFileSync(path.join(__dirname, './css/preflight.css'), 'utf8')
465
+ )
367
466
 
368
467
  addBase([
369
468
  postcss.comment({
@@ -374,24 +473,10 @@ export let corePlugins = {
374
473
  },
375
474
 
376
475
  container: (() => {
377
- function extractMinWidths(breakpoints) {
378
- return Object.values(breakpoints ?? {}).flatMap((breakpoints) => {
379
- if (typeof breakpoints === 'string') {
380
- breakpoints = { min: breakpoints }
381
- }
382
-
383
- if (!Array.isArray(breakpoints)) {
384
- breakpoints = [breakpoints]
385
- }
386
-
387
- return breakpoints
388
- .filter((breakpoint) => {
389
- return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
390
- })
391
- .map((breakpoint) => {
392
- return breakpoint['min-width'] ?? breakpoint.min
393
- })
394
- })
476
+ function extractMinWidths(breakpoints = []) {
477
+ return breakpoints
478
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
479
+ .filter((v) => v !== undefined)
395
480
  }
396
481
 
397
482
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
@@ -420,16 +505,11 @@ export let corePlugins = {
420
505
  }
421
506
 
422
507
  for (let minWidth of minWidths) {
423
- for (let [screen, value] of Object.entries(screens)) {
424
- let screenMinWidth =
425
- typeof value === 'object' && value !== null ? value.min || value['min-width'] : value
426
-
427
- if (`${screenMinWidth}` === `${minWidth}`) {
428
- mapping.push({
429
- screen,
430
- minWidth,
431
- padding: paddings[screen],
432
- })
508
+ for (let screen of screens) {
509
+ for (let { min } of screen.values) {
510
+ if (min === minWidth) {
511
+ mapping.push({ minWidth, padding: paddings[screen.name] })
512
+ }
433
513
  }
434
514
  }
435
515
  }
@@ -438,12 +518,12 @@ export let corePlugins = {
438
518
  }
439
519
 
440
520
  return function ({ addComponents, theme }) {
441
- let screens = theme('container.screens', theme('screens'))
521
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
442
522
  let minWidths = extractMinWidths(screens)
443
523
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
444
524
 
445
525
  let generatePaddingFor = (minWidth) => {
446
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
526
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
447
527
 
448
528
  if (!paddingConfig) {
449
529
  return {}
@@ -516,6 +596,7 @@ export let corePlugins = {
516
596
  addUtilities({
517
597
  '.visible': { visibility: 'visible' },
518
598
  '.invisible': { visibility: 'hidden' },
599
+ '.collapse': { visibility: 'collapse' },
519
600
  })
520
601
  },
521
602
 
@@ -529,19 +610,23 @@ export let corePlugins = {
529
610
  })
530
611
  },
531
612
 
532
- inset: createUtilityPlugin('inset', [
533
- ['inset', ['top', 'right', 'bottom', 'left']],
613
+ inset: createUtilityPlugin(
614
+ 'inset',
534
615
  [
535
- ['inset-x', ['left', 'right']],
536
- ['inset-y', ['top', 'bottom']],
537
- ],
538
- [
539
- ['top', ['top']],
540
- ['right', ['right']],
541
- ['bottom', ['bottom']],
542
- ['left', ['left']],
616
+ ['inset', ['top', 'right', 'bottom', 'left']],
617
+ [
618
+ ['inset-x', ['left', 'right']],
619
+ ['inset-y', ['top', 'bottom']],
620
+ ],
621
+ [
622
+ ['top', ['top']],
623
+ ['right', ['right']],
624
+ ['bottom', ['bottom']],
625
+ ['left', ['left']],
626
+ ],
543
627
  ],
544
- ]),
628
+ { supportsNegativeValues: true }
629
+ ),
545
630
 
546
631
  isolation: ({ addUtilities }) => {
547
632
  addUtilities({
@@ -550,8 +635,8 @@ export let corePlugins = {
550
635
  })
551
636
  },
552
637
 
553
- zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]]),
554
- order: createUtilityPlugin('order'),
638
+ zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]], { supportsNegativeValues: true }),
639
+ order: createUtilityPlugin('order', undefined, { supportsNegativeValues: true }),
555
640
  gridColumn: createUtilityPlugin('gridColumn', [['col', ['gridColumn']]]),
556
641
  gridColumnStart: createUtilityPlugin('gridColumnStart', [['col-start', ['gridColumnStart']]]),
557
642
  gridColumnEnd: createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]]),
@@ -576,19 +661,23 @@ export let corePlugins = {
576
661
  })
577
662
  },
578
663
 
579
- margin: createUtilityPlugin('margin', [
580
- ['m', ['margin']],
664
+ margin: createUtilityPlugin(
665
+ 'margin',
581
666
  [
582
- ['mx', ['margin-left', 'margin-right']],
583
- ['my', ['margin-top', 'margin-bottom']],
584
- ],
585
- [
586
- ['mt', ['margin-top']],
587
- ['mr', ['margin-right']],
588
- ['mb', ['margin-bottom']],
589
- ['ml', ['margin-left']],
667
+ ['m', ['margin']],
668
+ [
669
+ ['mx', ['margin-left', 'margin-right']],
670
+ ['my', ['margin-top', 'margin-bottom']],
671
+ ],
672
+ [
673
+ ['mt', ['margin-top']],
674
+ ['mr', ['margin-right']],
675
+ ['mb', ['margin-bottom']],
676
+ ['ml', ['margin-left']],
677
+ ],
590
678
  ],
591
- ]),
679
+ { supportsNegativeValues: true }
680
+ ),
592
681
 
593
682
  boxSizing: ({ addUtilities }) => {
594
683
  addUtilities({
@@ -634,8 +723,14 @@ export let corePlugins = {
634
723
  maxWidth: createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]]),
635
724
 
636
725
  flex: createUtilityPlugin('flex'),
637
- flexShrink: createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]]),
638
- flexGrow: createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]]),
726
+ flexShrink: createUtilityPlugin('flexShrink', [
727
+ ['flex-shrink', ['flex-shrink']], // Deprecated
728
+ ['shrink', ['flex-shrink']],
729
+ ]),
730
+ flexGrow: createUtilityPlugin('flexGrow', [
731
+ ['flex-grow', ['flex-grow']], // Deprecated
732
+ ['grow', ['flex-grow']],
733
+ ]),
639
734
  flexBasis: createUtilityPlugin('flexBasis', [['basis', ['flex-basis']]]),
640
735
 
641
736
  tableLayout: ({ addUtilities }) => {
@@ -652,106 +747,127 @@ export let corePlugins = {
652
747
  })
653
748
  },
654
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
+
655
785
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
656
- translate: createUtilityPlugin('translate', [
657
- [
658
- [
659
- 'translate-x',
660
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
661
- ],
662
- [
663
- 'translate-y',
664
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
665
- ],
666
- ],
667
- ]),
668
- rotate: createUtilityPlugin('rotate', [
669
- ['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']]],
670
- ]),
671
- skew: createUtilityPlugin('skew', [
786
+ translate: createUtilityPlugin(
787
+ 'translate',
672
788
  [
673
789
  [
674
- 'skew-x',
675
- [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
676
- ],
677
- [
678
- 'skew-y',
679
- [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
790
+ [
791
+ 'translate-x',
792
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
793
+ ],
794
+ [
795
+ 'translate-y',
796
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
797
+ ],
680
798
  ],
681
799
  ],
682
- ]),
683
- scale: createUtilityPlugin('scale', [
800
+ { supportsNegativeValues: true }
801
+ ),
802
+ rotate: createUtilityPlugin(
803
+ 'rotate',
804
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
805
+ { supportsNegativeValues: true }
806
+ ),
807
+ skew: createUtilityPlugin(
808
+ 'skew',
684
809
  [
685
- 'scale',
686
810
  [
687
- ['@defaults transform', {}],
688
- '--tw-scale-x',
689
- '--tw-scale-y',
690
- ['transform', 'var(--tw-transform)'],
811
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
812
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
691
813
  ],
692
814
  ],
815
+ { supportsNegativeValues: true }
816
+ ),
817
+ scale: createUtilityPlugin(
818
+ 'scale',
693
819
  [
694
820
  [
695
- 'scale-x',
696
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
821
+ 'scale',
822
+ [
823
+ ['@defaults transform', {}],
824
+ '--tw-scale-x',
825
+ '--tw-scale-y',
826
+ ['transform', cssTransformValue],
827
+ ],
697
828
  ],
698
829
  [
699
- 'scale-y',
700
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
830
+ [
831
+ 'scale-x',
832
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
833
+ ],
834
+ [
835
+ 'scale-y',
836
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
837
+ ],
701
838
  ],
702
839
  ],
703
- ]),
840
+ { supportsNegativeValues: true }
841
+ ),
704
842
 
705
- transform: ({ addBase, addUtilities }) => {
706
- addBase({
707
- '@defaults transform': {
708
- '--tw-translate-x': '0',
709
- '--tw-translate-y': '0',
710
- '--tw-rotate': '0',
711
- '--tw-skew-x': '0',
712
- '--tw-skew-y': '0',
713
- '--tw-scale-x': '1',
714
- '--tw-scale-y': '1',
715
- '--tw-transform': [
716
- 'translateX(var(--tw-translate-x))',
717
- 'translateY(var(--tw-translate-y))',
718
- 'rotate(var(--tw-rotate))',
719
- 'skewX(var(--tw-skew-x))',
720
- 'skewY(var(--tw-skew-y))',
721
- 'scaleX(var(--tw-scale-x))',
722
- 'scaleY(var(--tw-scale-y))',
723
- ].join(' '),
724
- },
725
- })
726
- addUtilities({
727
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
843
+ transform: ({ addDefaults, addUtilities }) => {
844
+ addDefaults('transform', {
845
+ '--tw-translate-x': '0',
846
+ '--tw-translate-y': '0',
847
+ '--tw-rotate': '0',
848
+ '--tw-skew-x': '0',
849
+ '--tw-skew-y': '0',
850
+ '--tw-scale-x': '1',
851
+ '--tw-scale-y': '1',
852
+ })
853
+
854
+ addUtilities({
855
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
728
856
  '.transform-cpu': {
729
- '--tw-transform': [
730
- 'translateX(var(--tw-translate-x))',
731
- 'translateY(var(--tw-translate-y))',
732
- 'rotate(var(--tw-rotate))',
733
- 'skewX(var(--tw-skew-x))',
734
- 'skewY(var(--tw-skew-y))',
735
- 'scaleX(var(--tw-scale-x))',
736
- 'scaleY(var(--tw-scale-y))',
737
- ].join(' '),
857
+ transform: cssTransformValue,
738
858
  },
739
859
  '.transform-gpu': {
740
- '--tw-transform': [
741
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
742
- 'rotate(var(--tw-rotate))',
743
- 'skewX(var(--tw-skew-x))',
744
- 'skewY(var(--tw-skew-y))',
745
- 'scaleX(var(--tw-scale-x))',
746
- 'scaleY(var(--tw-scale-y))',
747
- ].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
+ ),
748
864
  },
749
865
  '.transform-none': { transform: 'none' },
750
866
  })
751
867
  },
752
868
 
753
- animation: ({ matchUtilities, theme, prefix }) => {
754
- let prefixName = (name) => prefix(`.${name}`).slice(1)
869
+ animation: ({ matchUtilities, theme, config }) => {
870
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
755
871
  let keyframes = Object.fromEntries(
756
872
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
757
873
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -784,17 +900,53 @@ export let corePlugins = {
784
900
 
785
901
  cursor: createUtilityPlugin('cursor'),
786
902
 
787
- touchAction: ({ addUtilities }) => {
903
+ touchAction: ({ addDefaults, addUtilities }) => {
904
+ addDefaults('touch-action', {
905
+ '--tw-pan-x': ' ',
906
+ '--tw-pan-y': ' ',
907
+ '--tw-pinch-zoom': ' ',
908
+ })
909
+
910
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
911
+
788
912
  addUtilities({
789
913
  '.touch-auto': { 'touch-action': 'auto' },
790
914
  '.touch-none': { 'touch-action': 'none' },
791
- '.touch-pan-x': { 'touch-action': 'pan-x' },
792
- '.touch-pan-left': { 'touch-action': 'pan-left' },
793
- '.touch-pan-right': { 'touch-action': 'pan-right' },
794
- '.touch-pan-y': { 'touch-action': 'pan-y' },
795
- '.touch-pan-up': { 'touch-action': 'pan-up' },
796
- '.touch-pan-down': { 'touch-action': 'pan-down' },
797
- '.touch-pinch-zoom': { 'touch-action': 'pinch-zoom' },
915
+ '.touch-pan-x': {
916
+ '@defaults touch-action': {},
917
+ '--tw-pan-x': 'pan-x',
918
+ 'touch-action': cssTouchActionValue,
919
+ },
920
+ '.touch-pan-left': {
921
+ '@defaults touch-action': {},
922
+ '--tw-pan-x': 'pan-left',
923
+ 'touch-action': cssTouchActionValue,
924
+ },
925
+ '.touch-pan-right': {
926
+ '@defaults touch-action': {},
927
+ '--tw-pan-x': 'pan-right',
928
+ 'touch-action': cssTouchActionValue,
929
+ },
930
+ '.touch-pan-y': {
931
+ '@defaults touch-action': {},
932
+ '--tw-pan-y': 'pan-y',
933
+ 'touch-action': cssTouchActionValue,
934
+ },
935
+ '.touch-pan-up': {
936
+ '@defaults touch-action': {},
937
+ '--tw-pan-y': 'pan-up',
938
+ 'touch-action': cssTouchActionValue,
939
+ },
940
+ '.touch-pan-down': {
941
+ '@defaults touch-action': {},
942
+ '--tw-pan-y': 'pan-down',
943
+ 'touch-action': cssTouchActionValue,
944
+ },
945
+ '.touch-pinch-zoom': {
946
+ '@defaults touch-action': {},
947
+ '--tw-pinch-zoom': 'pinch-zoom',
948
+ 'touch-action': cssTouchActionValue,
949
+ },
798
950
  '.touch-manipulation': { 'touch-action': 'manipulation' },
799
951
  })
800
952
  },
@@ -817,11 +969,9 @@ export let corePlugins = {
817
969
  })
818
970
  },
819
971
 
820
- scrollSnapType: ({ addUtilities, addBase }) => {
821
- addBase({
822
- '@defaults scroll-snap-type': {
823
- '--tw-scroll-snap-strictness': 'proximity',
824
- },
972
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
973
+ addDefaults('scroll-snap-type', {
974
+ '--tw-scroll-snap-strictness': 'proximity',
825
975
  })
826
976
 
827
977
  addUtilities({
@@ -859,19 +1009,23 @@ export let corePlugins = {
859
1009
  })
860
1010
  },
861
1011
 
862
- scrollMargin: createUtilityPlugin('scrollMargin', [
863
- ['scroll-m', ['scroll-margin']],
1012
+ scrollMargin: createUtilityPlugin(
1013
+ 'scrollMargin',
864
1014
  [
865
- ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
866
- ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
867
- ],
868
- [
869
- ['scroll-mt', ['scroll-margin-top']],
870
- ['scroll-mr', ['scroll-margin-right']],
871
- ['scroll-mb', ['scroll-margin-bottom']],
872
- ['scroll-ml', ['scroll-margin-left']],
1015
+ ['scroll-m', ['scroll-margin']],
1016
+ [
1017
+ ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
1018
+ ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
1019
+ ],
1020
+ [
1021
+ ['scroll-mt', ['scroll-margin-top']],
1022
+ ['scroll-mr', ['scroll-margin-right']],
1023
+ ['scroll-mb', ['scroll-margin-bottom']],
1024
+ ['scroll-ml', ['scroll-margin-left']],
1025
+ ],
873
1026
  ],
874
- ]),
1027
+ { supportsNegativeValues: true }
1028
+ ),
875
1029
 
876
1030
  scrollPadding: createUtilityPlugin('scrollPadding', [
877
1031
  ['scroll-p', ['scroll-padding']],
@@ -945,6 +1099,7 @@ export let corePlugins = {
945
1099
  addUtilities({
946
1100
  '.grid-flow-row': { gridAutoFlow: 'row' },
947
1101
  '.grid-flow-col': { gridAutoFlow: 'column' },
1102
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
948
1103
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
949
1104
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
950
1105
  })
@@ -981,6 +1136,7 @@ export let corePlugins = {
981
1136
  '.place-content-between': { 'place-content': 'space-between' },
982
1137
  '.place-content-around': { 'place-content': 'space-around' },
983
1138
  '.place-content-evenly': { 'place-content': 'space-evenly' },
1139
+ '.place-content-baseline': { 'place-content': 'baseline' },
984
1140
  '.place-content-stretch': { 'place-content': 'stretch' },
985
1141
  })
986
1142
  },
@@ -990,6 +1146,7 @@ export let corePlugins = {
990
1146
  '.place-items-start': { 'place-items': 'start' },
991
1147
  '.place-items-end': { 'place-items': 'end' },
992
1148
  '.place-items-center': { 'place-items': 'center' },
1149
+ '.place-items-baseline': { 'place-items': 'baseline' },
993
1150
  '.place-items-stretch': { 'place-items': 'stretch' },
994
1151
  })
995
1152
  },
@@ -1002,6 +1159,7 @@ export let corePlugins = {
1002
1159
  '.content-between': { 'align-content': 'space-between' },
1003
1160
  '.content-around': { 'align-content': 'space-around' },
1004
1161
  '.content-evenly': { 'align-content': 'space-evenly' },
1162
+ '.content-baseline': { 'align-content': 'baseline' },
1005
1163
  })
1006
1164
  },
1007
1165
 
@@ -1069,7 +1227,7 @@ export let corePlugins = {
1069
1227
  }
1070
1228
  },
1071
1229
  },
1072
- { values: theme('space') }
1230
+ { values: theme('space'), supportsNegativeValues: true }
1073
1231
  )
1074
1232
 
1075
1233
  addUtilities({
@@ -1106,7 +1264,7 @@ export let corePlugins = {
1106
1264
  }
1107
1265
  },
1108
1266
  },
1109
- { values: theme('divideWidth'), type: ['line-width', 'length'] }
1267
+ { values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
1110
1268
  )
1111
1269
 
1112
1270
  addUtilities({
@@ -1154,7 +1312,7 @@ export let corePlugins = {
1154
1312
  },
1155
1313
  {
1156
1314
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1157
- type: 'color',
1315
+ type: ['color', 'any'],
1158
1316
  }
1159
1317
  )
1160
1318
  },
@@ -1266,6 +1424,7 @@ export let corePlugins = {
1266
1424
  '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1267
1425
  '.break-words': { 'overflow-wrap': 'break-word' },
1268
1426
  '.break-all': { 'word-break': 'break-all' },
1427
+ '.break-keep': { 'word-break': 'keep-all' },
1269
1428
  })
1270
1429
  },
1271
1430
 
@@ -1314,24 +1473,7 @@ export let corePlugins = {
1314
1473
  })
1315
1474
  },
1316
1475
 
1317
- borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1318
- if (!corePlugins('borderOpacity')) {
1319
- let value = theme('borderColor.DEFAULT', 'currentColor')
1320
- addBase({
1321
- '@defaults border-width': {
1322
- 'border-color': toColorValue(value),
1323
- },
1324
- })
1325
- } else {
1326
- addBase({
1327
- '@defaults border-width': withAlphaVariable({
1328
- color: theme('borderColor.DEFAULT', 'currentColor'),
1329
- property: 'border-color',
1330
- variable: '--tw-border-opacity',
1331
- }),
1332
- })
1333
- }
1334
-
1476
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1335
1477
  matchUtilities(
1336
1478
  {
1337
1479
  border: (value) => {
@@ -1350,7 +1492,7 @@ export let corePlugins = {
1350
1492
  },
1351
1493
  {
1352
1494
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1353
- type: ['color'],
1495
+ type: ['color', 'any'],
1354
1496
  }
1355
1497
  )
1356
1498
 
@@ -1387,7 +1529,7 @@ export let corePlugins = {
1387
1529
  },
1388
1530
  {
1389
1531
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1390
- type: 'color',
1532
+ type: ['color', 'any'],
1391
1533
  }
1392
1534
  )
1393
1535
 
@@ -1448,7 +1590,7 @@ export let corePlugins = {
1448
1590
  },
1449
1591
  {
1450
1592
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1451
- type: 'color',
1593
+ type: ['color', 'any'],
1452
1594
  }
1453
1595
  )
1454
1596
  },
@@ -1474,7 +1616,7 @@ export let corePlugins = {
1474
1616
  })
1475
1617
  },
1476
1618
  },
1477
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1619
+ { values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
1478
1620
  )
1479
1621
  },
1480
1622
 
@@ -1502,7 +1644,8 @@ export let corePlugins = {
1502
1644
 
1503
1645
  return {
1504
1646
  '--tw-gradient-from': toColorValue(value, 'from'),
1505
- '--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)`,
1506
1649
  }
1507
1650
  },
1508
1651
  },
@@ -1514,10 +1657,11 @@ export let corePlugins = {
1514
1657
  let transparentToValue = transparentTo(value)
1515
1658
 
1516
1659
  return {
1660
+ '--tw-gradient-to': transparentToValue,
1517
1661
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1518
1662
  value,
1519
1663
  'via'
1520
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1664
+ )}, var(--tw-gradient-to)`,
1521
1665
  }
1522
1666
  },
1523
1667
  },
@@ -1532,13 +1676,15 @@ export let corePlugins = {
1532
1676
 
1533
1677
  boxDecorationBreak: ({ addUtilities }) => {
1534
1678
  addUtilities({
1535
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1536
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1679
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1680
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1681
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1682
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1537
1683
  })
1538
1684
  },
1539
1685
 
1540
1686
  backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1541
- type: ['lookup', 'length', 'percentage'],
1687
+ type: ['lookup', 'length', 'percentage', 'size'],
1542
1688
  }),
1543
1689
 
1544
1690
  backgroundAttachment: ({ addUtilities }) => {
@@ -1559,7 +1705,7 @@ export let corePlugins = {
1559
1705
  },
1560
1706
 
1561
1707
  backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1562
- type: ['lookup', 'position'],
1708
+ type: ['lookup', ['position', { preferOnConflict: true }]],
1563
1709
  }),
1564
1710
 
1565
1711
  backgroundRepeat: ({ addUtilities }) => {
@@ -1599,7 +1745,7 @@ export let corePlugins = {
1599
1745
  return { stroke: toColorValue(value) }
1600
1746
  },
1601
1747
  },
1602
- { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1748
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
1603
1749
  )
1604
1750
  },
1605
1751
 
@@ -1638,10 +1784,14 @@ export let corePlugins = {
1638
1784
  '.text-center': { 'text-align': 'center' },
1639
1785
  '.text-right': { 'text-align': 'right' },
1640
1786
  '.text-justify': { 'text-align': 'justify' },
1787
+ '.text-start': { 'text-align': 'start' },
1788
+ '.text-end': { 'text-align': 'end' },
1641
1789
  })
1642
1790
  },
1643
1791
 
1644
- textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]]),
1792
+ textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]], {
1793
+ supportsNegativeValues: true,
1794
+ }),
1645
1795
 
1646
1796
  verticalAlign: ({ addUtilities, matchUtilities }) => {
1647
1797
  addUtilities({
@@ -1658,16 +1808,43 @@ export let corePlugins = {
1658
1808
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1659
1809
  },
1660
1810
 
1661
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1662
- type: ['lookup', 'generic-name', 'family-name'],
1663
- }),
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
+ },
1664
1833
 
1665
1834
  fontSize: ({ matchUtilities, theme }) => {
1666
1835
  matchUtilities(
1667
1836
  {
1668
- text: (value) => {
1837
+ text: (value, { modifier }) => {
1669
1838
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1670
- 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)
1671
1848
  ? options
1672
1849
  : { lineHeight: options }
1673
1850
 
@@ -1675,18 +1852,20 @@ export let corePlugins = {
1675
1852
  'font-size': fontSize,
1676
1853
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1677
1854
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1855
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1678
1856
  }
1679
1857
  },
1680
1858
  },
1681
1859
  {
1682
1860
  values: theme('fontSize'),
1861
+ modifiers: theme('lineHeight'),
1683
1862
  type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1684
1863
  }
1685
1864
  )
1686
1865
  },
1687
1866
 
1688
1867
  fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1689
- type: ['lookup', 'number'],
1868
+ type: ['lookup', 'number', 'any'],
1690
1869
  }),
1691
1870
 
1692
1871
  textTransform: ({ addUtilities }) => {
@@ -1705,32 +1884,67 @@ export let corePlugins = {
1705
1884
  })
1706
1885
  },
1707
1886
 
1708
- 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
+
1709
1899
  addUtilities({
1710
- '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions':
1711
- {
1712
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1713
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1714
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1715
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1716
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1717
- 'font-variant-numeric':
1718
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1719
- },
1720
1900
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1721
- '.ordinal': { '--tw-ordinal': 'ordinal' },
1722
- '.slashed-zero': { '--tw-slashed-zero': 'slashed-zero' },
1723
- '.lining-nums': { '--tw-numeric-figure': 'lining-nums' },
1724
- '.oldstyle-nums': { '--tw-numeric-figure': 'oldstyle-nums' },
1725
- '.proportional-nums': { '--tw-numeric-spacing': 'proportional-nums' },
1726
- '.tabular-nums': { '--tw-numeric-spacing': 'tabular-nums' },
1727
- '.diagonal-fractions': { '--tw-numeric-fraction': 'diagonal-fractions' },
1728
- '.stacked-fractions': { '--tw-numeric-fraction': 'stacked-fractions' },
1901
+ '.ordinal': {
1902
+ '@defaults font-variant-numeric': {},
1903
+ '--tw-ordinal': 'ordinal',
1904
+ 'font-variant-numeric': cssFontVariantNumericValue,
1905
+ },
1906
+ '.slashed-zero': {
1907
+ '@defaults font-variant-numeric': {},
1908
+ '--tw-slashed-zero': 'slashed-zero',
1909
+ 'font-variant-numeric': cssFontVariantNumericValue,
1910
+ },
1911
+ '.lining-nums': {
1912
+ '@defaults font-variant-numeric': {},
1913
+ '--tw-numeric-figure': 'lining-nums',
1914
+ 'font-variant-numeric': cssFontVariantNumericValue,
1915
+ },
1916
+ '.oldstyle-nums': {
1917
+ '@defaults font-variant-numeric': {},
1918
+ '--tw-numeric-figure': 'oldstyle-nums',
1919
+ 'font-variant-numeric': cssFontVariantNumericValue,
1920
+ },
1921
+ '.proportional-nums': {
1922
+ '@defaults font-variant-numeric': {},
1923
+ '--tw-numeric-spacing': 'proportional-nums',
1924
+ 'font-variant-numeric': cssFontVariantNumericValue,
1925
+ },
1926
+ '.tabular-nums': {
1927
+ '@defaults font-variant-numeric': {},
1928
+ '--tw-numeric-spacing': 'tabular-nums',
1929
+ 'font-variant-numeric': cssFontVariantNumericValue,
1930
+ },
1931
+ '.diagonal-fractions': {
1932
+ '@defaults font-variant-numeric': {},
1933
+ '--tw-numeric-fraction': 'diagonal-fractions',
1934
+ 'font-variant-numeric': cssFontVariantNumericValue,
1935
+ },
1936
+ '.stacked-fractions': {
1937
+ '@defaults font-variant-numeric': {},
1938
+ '--tw-numeric-fraction': 'stacked-fractions',
1939
+ 'font-variant-numeric': cssFontVariantNumericValue,
1940
+ },
1729
1941
  })
1730
1942
  },
1731
1943
 
1732
1944
  lineHeight: createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]]),
1733
- letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]]),
1945
+ letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]], {
1946
+ supportsNegativeValues: true,
1947
+ }),
1734
1948
 
1735
1949
  textColor: ({ matchUtilities, theme, corePlugins }) => {
1736
1950
  matchUtilities(
@@ -1747,7 +1961,7 @@ export let corePlugins = {
1747
1961
  })
1748
1962
  },
1749
1963
  },
1750
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
1964
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
1751
1965
  )
1752
1966
  },
1753
1967
 
@@ -1755,12 +1969,46 @@ export let corePlugins = {
1755
1969
 
1756
1970
  textDecoration: ({ addUtilities }) => {
1757
1971
  addUtilities({
1758
- '.underline': { 'text-decoration': 'underline' },
1759
- '.line-through': { 'text-decoration': 'line-through' },
1760
- '.no-underline': { 'text-decoration': 'none' },
1972
+ '.underline': { 'text-decoration-line': 'underline' },
1973
+ '.overline': { 'text-decoration-line': 'overline' },
1974
+ '.line-through': { 'text-decoration-line': 'line-through' },
1975
+ '.no-underline': { 'text-decoration-line': 'none' },
1761
1976
  })
1762
1977
  },
1763
1978
 
1979
+ textDecorationColor: ({ matchUtilities, theme }) => {
1980
+ matchUtilities(
1981
+ {
1982
+ decoration: (value) => {
1983
+ return { 'text-decoration-color': toColorValue(value) }
1984
+ },
1985
+ },
1986
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1987
+ )
1988
+ },
1989
+
1990
+ textDecorationStyle: ({ addUtilities }) => {
1991
+ addUtilities({
1992
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1993
+ '.decoration-double': { 'text-decoration-style': 'double' },
1994
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1995
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1996
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1997
+ })
1998
+ },
1999
+
2000
+ textDecorationThickness: createUtilityPlugin(
2001
+ 'textDecorationThickness',
2002
+ [['decoration', ['text-decoration-thickness']]],
2003
+ { type: ['length', 'percentage'] }
2004
+ ),
2005
+
2006
+ textUnderlineOffset: createUtilityPlugin(
2007
+ 'textUnderlineOffset',
2008
+ [['underline-offset', ['text-underline-offset']]],
2009
+ { type: ['length', 'percentage', 'any'] }
2010
+ ),
2011
+
1764
2012
  fontSmoothing: ({ addUtilities }) => {
1765
2013
  addUtilities({
1766
2014
  '.antialiased': {
@@ -1873,6 +2121,7 @@ export let corePlugins = {
1873
2121
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1874
2122
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1875
2123
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
2124
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1876
2125
  })
1877
2126
  },
1878
2127
 
@@ -1884,13 +2133,12 @@ export let corePlugins = {
1884
2133
  `var(--tw-shadow)`,
1885
2134
  ].join(', ')
1886
2135
 
1887
- return function ({ matchUtilities, addBase, theme }) {
1888
- addBase({
1889
- '@defaults box-shadow': {
1890
- '--tw-ring-offset-shadow': '0 0 #0000',
1891
- '--tw-ring-shadow': '0 0 #0000',
1892
- '--tw-shadow': '0 0 #0000',
1893
- },
2136
+ return function ({ matchUtilities, addDefaults, theme }) {
2137
+ addDefaults(' box-shadow', {
2138
+ '--tw-ring-offset-shadow': '0 0 #0000',
2139
+ '--tw-ring-shadow': '0 0 #0000',
2140
+ '--tw-shadow': '0 0 #0000',
2141
+ '--tw-shadow-colored': '0 0 #0000',
1894
2142
  })
1895
2143
 
1896
2144
  matchUtilities(
@@ -1898,50 +2146,104 @@ export let corePlugins = {
1898
2146
  shadow: (value) => {
1899
2147
  value = transformValue(value)
1900
2148
 
2149
+ let ast = parseBoxShadowValue(value)
2150
+ for (let shadow of ast) {
2151
+ // Don't override color if the whole shadow is a variable
2152
+ if (!shadow.valid) {
2153
+ continue
2154
+ }
2155
+
2156
+ shadow.color = 'var(--tw-shadow-color)'
2157
+ }
2158
+
1901
2159
  return {
1902
2160
  '@defaults box-shadow': {},
1903
2161
  '--tw-shadow': value === 'none' ? '0 0 #0000' : value,
2162
+ '--tw-shadow-colored': value === 'none' ? '0 0 #0000' : formatBoxShadowValue(ast),
1904
2163
  'box-shadow': defaultBoxShadow,
1905
2164
  }
1906
2165
  },
1907
2166
  },
1908
- { values: theme('boxShadow') }
2167
+ { values: theme('boxShadow'), type: ['shadow'] }
1909
2168
  )
1910
2169
  }
1911
2170
  })(),
1912
2171
 
1913
- outline: ({ matchUtilities, theme }) => {
2172
+ boxShadowColor: ({ matchUtilities, theme }) => {
1914
2173
  matchUtilities(
1915
2174
  {
1916
- outline: (value) => {
1917
- value = Array.isArray(value) ? value : value.split(',')
1918
- let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [value]
1919
-
1920
- return { outline, 'outline-offset': outlineOffset }
2175
+ shadow: (value) => {
2176
+ return {
2177
+ '--tw-shadow-color': toColorValue(value),
2178
+ '--tw-shadow': 'var(--tw-shadow-colored)',
2179
+ }
1921
2180
  },
1922
2181
  },
1923
- { values: theme('outline') }
2182
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
1924
2183
  )
1925
2184
  },
1926
2185
 
1927
- ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1928
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1929
- let ringColorDefault = withAlphaValue(
1930
- theme('ringColor.DEFAULT'),
1931
- ringOpacityDefault,
1932
- `rgb(147 197 253 / ${ringOpacityDefault})`
1933
- )
2186
+ outlineStyle: ({ addUtilities }) => {
2187
+ addUtilities({
2188
+ '.outline-none': {
2189
+ outline: '2px solid transparent',
2190
+ 'outline-offset': '2px',
2191
+ },
2192
+ '.outline': { 'outline-style': 'solid' },
2193
+ '.outline-dashed': { 'outline-style': 'dashed' },
2194
+ '.outline-dotted': { 'outline-style': 'dotted' },
2195
+ '.outline-double': { 'outline-style': 'double' },
2196
+ })
2197
+ },
1934
2198
 
1935
- addBase({
1936
- '@defaults ring-width': {
1937
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1938
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1939
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1940
- '--tw-ring-color': ringColorDefault,
1941
- '--tw-ring-offset-shadow': '0 0 #0000',
1942
- '--tw-ring-shadow': '0 0 #0000',
1943
- '--tw-shadow': '0 0 #0000',
2199
+ outlineWidth: createUtilityPlugin('outlineWidth', [['outline', ['outline-width']]], {
2200
+ type: ['length', 'number', 'percentage'],
2201
+ }),
2202
+
2203
+ outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
2204
+ type: ['length', 'number', 'percentage', 'any'],
2205
+ supportsNegativeValues: true,
2206
+ }),
2207
+
2208
+ outlineColor: ({ matchUtilities, theme }) => {
2209
+ matchUtilities(
2210
+ {
2211
+ outline: (value) => {
2212
+ return { 'outline-color': toColorValue(value) }
2213
+ },
1944
2214
  },
2215
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
2216
+ )
2217
+ },
2218
+
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
+ })()
2237
+
2238
+ addDefaults('ring-width', {
2239
+ '--tw-ring-inset': ' ',
2240
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
2241
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
2242
+ '--tw-ring-color': ringColorDefault,
2243
+ '--tw-ring-offset-shadow': '0 0 #0000',
2244
+ '--tw-ring-shadow': '0 0 #0000',
2245
+ '--tw-shadow': '0 0 #0000',
2246
+ '--tw-shadow-colored': '0 0 #0000',
1945
2247
  })
1946
2248
 
1947
2249
  matchUtilities(
@@ -1967,10 +2269,16 @@ export let corePlugins = {
1967
2269
  })
1968
2270
  },
1969
2271
 
1970
- ringColor: ({ matchUtilities, theme }) => {
2272
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1971
2273
  matchUtilities(
1972
2274
  {
1973
2275
  ring: (value) => {
2276
+ if (!corePlugins('ringOpacity')) {
2277
+ return {
2278
+ '--tw-ring-color': toColorValue(value),
2279
+ }
2280
+ }
2281
+
1974
2282
  return withAlphaVariable({
1975
2283
  color: value,
1976
2284
  property: '--tw-ring-color',
@@ -1984,14 +2292,18 @@ export let corePlugins = {
1984
2292
  ([modifier]) => modifier !== 'DEFAULT'
1985
2293
  )
1986
2294
  ),
1987
- type: 'color',
2295
+ type: ['color', 'any'],
1988
2296
  }
1989
2297
  )
1990
2298
  },
1991
2299
 
1992
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1993
- filterDefault: true,
1994
- }),
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
+ },
1995
2307
  ringOffsetWidth: createUtilityPlugin(
1996
2308
  'ringOffsetWidth',
1997
2309
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -2007,7 +2319,7 @@ export let corePlugins = {
2007
2319
  }
2008
2320
  },
2009
2321
  },
2010
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
2322
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
2011
2323
  )
2012
2324
  },
2013
2325
 
@@ -2018,7 +2330,7 @@ export let corePlugins = {
2018
2330
  return {
2019
2331
  '--tw-blur': `blur(${value})`,
2020
2332
  '@defaults filter': {},
2021
- filter: 'var(--tw-filter)',
2333
+ filter: cssFilterValue,
2022
2334
  }
2023
2335
  },
2024
2336
  },
@@ -2033,7 +2345,7 @@ export let corePlugins = {
2033
2345
  return {
2034
2346
  '--tw-brightness': `brightness(${value})`,
2035
2347
  '@defaults filter': {},
2036
- filter: 'var(--tw-filter)',
2348
+ filter: cssFilterValue,
2037
2349
  }
2038
2350
  },
2039
2351
  },
@@ -2048,7 +2360,7 @@ export let corePlugins = {
2048
2360
  return {
2049
2361
  '--tw-contrast': `contrast(${value})`,
2050
2362
  '@defaults filter': {},
2051
- filter: 'var(--tw-filter)',
2363
+ filter: cssFilterValue,
2052
2364
  }
2053
2365
  },
2054
2366
  },
@@ -2065,7 +2377,7 @@ export let corePlugins = {
2065
2377
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2066
2378
  : `drop-shadow(${value})`,
2067
2379
  '@defaults filter': {},
2068
- filter: 'var(--tw-filter)',
2380
+ filter: cssFilterValue,
2069
2381
  }
2070
2382
  },
2071
2383
  },
@@ -2080,7 +2392,7 @@ export let corePlugins = {
2080
2392
  return {
2081
2393
  '--tw-grayscale': `grayscale(${value})`,
2082
2394
  '@defaults filter': {},
2083
- filter: 'var(--tw-filter)',
2395
+ filter: cssFilterValue,
2084
2396
  }
2085
2397
  },
2086
2398
  },
@@ -2095,11 +2407,11 @@ export let corePlugins = {
2095
2407
  return {
2096
2408
  '--tw-hue-rotate': `hue-rotate(${value})`,
2097
2409
  '@defaults filter': {},
2098
- filter: 'var(--tw-filter)',
2410
+ filter: cssFilterValue,
2099
2411
  }
2100
2412
  },
2101
2413
  },
2102
- { values: theme('hueRotate') }
2414
+ { values: theme('hueRotate'), supportsNegativeValues: true }
2103
2415
  )
2104
2416
  },
2105
2417
 
@@ -2110,7 +2422,7 @@ export let corePlugins = {
2110
2422
  return {
2111
2423
  '--tw-invert': `invert(${value})`,
2112
2424
  '@defaults filter': {},
2113
- filter: 'var(--tw-filter)',
2425
+ filter: cssFilterValue,
2114
2426
  }
2115
2427
  },
2116
2428
  },
@@ -2125,7 +2437,7 @@ export let corePlugins = {
2125
2437
  return {
2126
2438
  '--tw-saturate': `saturate(${value})`,
2127
2439
  '@defaults filter': {},
2128
- filter: 'var(--tw-filter)',
2440
+ filter: cssFilterValue,
2129
2441
  }
2130
2442
  },
2131
2443
  },
@@ -2140,7 +2452,7 @@ export let corePlugins = {
2140
2452
  return {
2141
2453
  '--tw-sepia': `sepia(${value})`,
2142
2454
  '@defaults filter': {},
2143
- filter: 'var(--tw-filter)',
2455
+ filter: cssFilterValue,
2144
2456
  }
2145
2457
  },
2146
2458
  },
@@ -2148,33 +2460,20 @@ export let corePlugins = {
2148
2460
  )
2149
2461
  },
2150
2462
 
2151
- filter: ({ addBase, addUtilities }) => {
2152
- addBase({
2153
- '@defaults filter': {
2154
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2155
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2156
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2157
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2158
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2159
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2160
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2161
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2162
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2163
- '--tw-filter': [
2164
- 'var(--tw-blur)',
2165
- 'var(--tw-brightness)',
2166
- 'var(--tw-contrast)',
2167
- 'var(--tw-grayscale)',
2168
- 'var(--tw-hue-rotate)',
2169
- 'var(--tw-invert)',
2170
- 'var(--tw-saturate)',
2171
- 'var(--tw-sepia)',
2172
- 'var(--tw-drop-shadow)',
2173
- ].join(' '),
2174
- },
2175
- })
2176
- addUtilities({
2177
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2463
+ filter: ({ addDefaults, addUtilities }) => {
2464
+ addDefaults('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 },
2178
2477
  '.filter-none': { filter: 'none' },
2179
2478
  })
2180
2479
  },
@@ -2186,7 +2485,7 @@ export let corePlugins = {
2186
2485
  return {
2187
2486
  '--tw-backdrop-blur': `blur(${value})`,
2188
2487
  '@defaults backdrop-filter': {},
2189
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2488
+ 'backdrop-filter': cssBackdropFilterValue,
2190
2489
  }
2191
2490
  },
2192
2491
  },
@@ -2201,7 +2500,7 @@ export let corePlugins = {
2201
2500
  return {
2202
2501
  '--tw-backdrop-brightness': `brightness(${value})`,
2203
2502
  '@defaults backdrop-filter': {},
2204
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2503
+ 'backdrop-filter': cssBackdropFilterValue,
2205
2504
  }
2206
2505
  },
2207
2506
  },
@@ -2216,7 +2515,7 @@ export let corePlugins = {
2216
2515
  return {
2217
2516
  '--tw-backdrop-contrast': `contrast(${value})`,
2218
2517
  '@defaults backdrop-filter': {},
2219
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2518
+ 'backdrop-filter': cssBackdropFilterValue,
2220
2519
  }
2221
2520
  },
2222
2521
  },
@@ -2231,7 +2530,7 @@ export let corePlugins = {
2231
2530
  return {
2232
2531
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2233
2532
  '@defaults backdrop-filter': {},
2234
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2533
+ 'backdrop-filter': cssBackdropFilterValue,
2235
2534
  }
2236
2535
  },
2237
2536
  },
@@ -2246,11 +2545,11 @@ export let corePlugins = {
2246
2545
  return {
2247
2546
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2248
2547
  '@defaults backdrop-filter': {},
2249
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2548
+ 'backdrop-filter': cssBackdropFilterValue,
2250
2549
  }
2251
2550
  },
2252
2551
  },
2253
- { values: theme('backdropHueRotate') }
2552
+ { values: theme('backdropHueRotate'), supportsNegativeValues: true }
2254
2553
  )
2255
2554
  },
2256
2555
 
@@ -2261,7 +2560,7 @@ export let corePlugins = {
2261
2560
  return {
2262
2561
  '--tw-backdrop-invert': `invert(${value})`,
2263
2562
  '@defaults backdrop-filter': {},
2264
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2563
+ 'backdrop-filter': cssBackdropFilterValue,
2265
2564
  }
2266
2565
  },
2267
2566
  },
@@ -2276,7 +2575,7 @@ export let corePlugins = {
2276
2575
  return {
2277
2576
  '--tw-backdrop-opacity': `opacity(${value})`,
2278
2577
  '@defaults backdrop-filter': {},
2279
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2578
+ 'backdrop-filter': cssBackdropFilterValue,
2280
2579
  }
2281
2580
  },
2282
2581
  },
@@ -2291,7 +2590,7 @@ export let corePlugins = {
2291
2590
  return {
2292
2591
  '--tw-backdrop-saturate': `saturate(${value})`,
2293
2592
  '@defaults backdrop-filter': {},
2294
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2593
+ 'backdrop-filter': cssBackdropFilterValue,
2295
2594
  }
2296
2595
  },
2297
2596
  },
@@ -2306,7 +2605,7 @@ export let corePlugins = {
2306
2605
  return {
2307
2606
  '--tw-backdrop-sepia': `sepia(${value})`,
2308
2607
  '@defaults backdrop-filter': {},
2309
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2608
+ 'backdrop-filter': cssBackdropFilterValue,
2310
2609
  }
2311
2610
  },
2312
2611
  },
@@ -2314,35 +2613,22 @@ export let corePlugins = {
2314
2613
  )
2315
2614
  },
2316
2615
 
2317
- backdropFilter: ({ addBase, addUtilities }) => {
2318
- addBase({
2319
- '@defaults backdrop-filter': {
2320
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2321
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2322
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2323
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2324
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2325
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2326
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2327
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2328
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2329
- '--tw-backdrop-filter': [
2330
- 'var(--tw-backdrop-blur)',
2331
- 'var(--tw-backdrop-brightness)',
2332
- 'var(--tw-backdrop-contrast)',
2333
- 'var(--tw-backdrop-grayscale)',
2334
- 'var(--tw-backdrop-hue-rotate)',
2335
- 'var(--tw-backdrop-invert)',
2336
- 'var(--tw-backdrop-opacity)',
2337
- 'var(--tw-backdrop-saturate)',
2338
- 'var(--tw-backdrop-sepia)',
2339
- ].join(' '),
2340
- },
2616
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2617
+ addDefaults('backdrop-filter', {
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': ' ',
2341
2627
  })
2342
2628
  addUtilities({
2343
2629
  '.backdrop-filter': {
2344
2630
  '@defaults backdrop-filter': {},
2345
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2631
+ 'backdrop-filter': cssBackdropFilterValue,
2346
2632
  },
2347
2633
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2348
2634
  })
@@ -2382,5 +2668,7 @@ export let corePlugins = {
2382
2668
  { filterDefault: true }
2383
2669
  ),
2384
2670
  willChange: createUtilityPlugin('willChange', [['will-change', ['will-change']]]),
2385
- content: createUtilityPlugin('content'),
2671
+ content: createUtilityPlugin('content', [
2672
+ ['content', ['--tw-content', ['content', 'var(--tw-content)']]],
2673
+ ]),
2386
2674
  }