tailwindcss 0.0.0-insiders.ca1dfd6 → 0.0.0-insiders.cab1fce

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 (148) hide show
  1. package/CHANGELOG.md +380 -1
  2. package/LICENSE +1 -2
  3. package/README.md +8 -4
  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 +3 -0
  9. package/defaultTheme.js +2 -1
  10. package/lib/cli-peer-dependencies.js +10 -5
  11. package/lib/cli.js +311 -213
  12. package/lib/constants.js +9 -9
  13. package/lib/corePluginList.js +11 -1
  14. package/lib/corePlugins.js +1895 -1773
  15. package/lib/css/preflight.css +19 -13
  16. package/lib/featureFlags.js +22 -16
  17. package/lib/index.js +17 -8
  18. package/lib/lib/cacheInvalidation.js +69 -0
  19. package/lib/lib/collapseAdjacentRules.js +30 -14
  20. package/lib/lib/collapseDuplicateDeclarations.js +80 -0
  21. package/lib/lib/defaultExtractor.js +187 -0
  22. package/lib/lib/detectNesting.js +17 -2
  23. package/lib/lib/evaluateTailwindFunctions.js +40 -24
  24. package/lib/lib/expandApplyAtRules.js +414 -157
  25. package/lib/lib/expandTailwindAtRules.js +156 -151
  26. package/lib/lib/generateRules.js +402 -68
  27. package/lib/lib/getModuleDependencies.js +14 -14
  28. package/lib/lib/normalizeTailwindDirectives.js +45 -36
  29. package/lib/lib/partitionApplyAtRules.js +53 -0
  30. package/lib/lib/regex.js +53 -0
  31. package/lib/lib/resolveDefaultsAtRules.js +105 -90
  32. package/lib/lib/setupContextUtils.js +416 -291
  33. package/lib/lib/setupTrackingContext.js +60 -56
  34. package/lib/lib/sharedState.js +38 -15
  35. package/lib/lib/substituteScreenAtRules.js +9 -6
  36. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  37. package/lib/postcss-plugins/nesting/index.js +17 -0
  38. package/lib/postcss-plugins/nesting/plugin.js +85 -0
  39. package/lib/processTailwindFeatures.js +21 -9
  40. package/lib/public/colors.js +244 -248
  41. package/lib/public/resolve-config.js +5 -5
  42. package/lib/util/buildMediaQuery.js +13 -24
  43. package/lib/util/cloneDeep.js +1 -1
  44. package/lib/util/cloneNodes.js +12 -1
  45. package/lib/util/color.js +43 -32
  46. package/lib/util/createPlugin.js +1 -2
  47. package/lib/util/createUtilityPlugin.js +13 -17
  48. package/lib/util/dataTypes.js +114 -74
  49. package/lib/util/defaults.js +6 -0
  50. package/lib/util/escapeClassName.js +5 -5
  51. package/lib/util/escapeCommas.js +1 -1
  52. package/lib/util/flattenColorPalette.js +2 -4
  53. package/lib/util/formatVariantSelector.js +194 -0
  54. package/lib/util/getAllConfigs.js +13 -5
  55. package/lib/util/hashConfig.js +5 -5
  56. package/lib/util/isKeyframeRule.js +1 -1
  57. package/lib/util/isPlainObject.js +1 -1
  58. package/lib/util/isValidArbitraryValue.js +64 -0
  59. package/lib/util/log.js +35 -19
  60. package/lib/util/nameClass.js +7 -6
  61. package/lib/util/negateValue.js +5 -3
  62. package/lib/util/normalizeConfig.js +233 -0
  63. package/lib/util/normalizeScreens.js +59 -0
  64. package/lib/util/parseAnimationValue.js +56 -56
  65. package/lib/util/parseBoxShadowValue.js +76 -0
  66. package/lib/util/parseDependency.js +32 -32
  67. package/lib/util/parseObjectStyles.js +6 -6
  68. package/lib/util/pluginUtils.js +67 -170
  69. package/lib/util/prefixSelector.js +4 -7
  70. package/lib/util/resolveConfig.js +123 -133
  71. package/lib/util/resolveConfigPath.js +17 -18
  72. package/lib/util/responsive.js +6 -6
  73. package/lib/util/splitAtTopLevelOnly.js +72 -0
  74. package/lib/util/toColorValue.js +1 -2
  75. package/lib/util/toPath.js +6 -1
  76. package/lib/util/transformThemeValue.js +42 -34
  77. package/lib/util/validateConfig.js +21 -0
  78. package/lib/util/withAlphaVariable.js +19 -19
  79. package/nesting/index.js +2 -12
  80. package/package.json +41 -42
  81. package/peers/index.js +11539 -10859
  82. package/plugin.d.ts +11 -0
  83. package/plugin.js +2 -1
  84. package/resolveConfig.js +2 -1
  85. package/scripts/create-plugin-list.js +2 -2
  86. package/scripts/generate-types.js +52 -0
  87. package/src/cli-peer-dependencies.js +7 -1
  88. package/src/cli.js +174 -41
  89. package/src/corePluginList.js +1 -1
  90. package/src/corePlugins.js +641 -596
  91. package/src/css/preflight.css +19 -13
  92. package/src/featureFlags.js +16 -10
  93. package/src/index.js +14 -6
  94. package/src/lib/cacheInvalidation.js +52 -0
  95. package/src/lib/collapseAdjacentRules.js +21 -2
  96. package/src/lib/collapseDuplicateDeclarations.js +93 -0
  97. package/src/lib/defaultExtractor.js +192 -0
  98. package/src/lib/detectNesting.js +22 -3
  99. package/src/lib/evaluateTailwindFunctions.js +24 -7
  100. package/src/lib/expandApplyAtRules.js +442 -154
  101. package/src/lib/expandTailwindAtRules.js +91 -65
  102. package/src/lib/generateRules.js +409 -43
  103. package/src/lib/normalizeTailwindDirectives.js +10 -3
  104. package/src/lib/partitionApplyAtRules.js +52 -0
  105. package/src/lib/regex.js +74 -0
  106. package/src/lib/resolveDefaultsAtRules.js +74 -53
  107. package/src/lib/setupContextUtils.js +388 -208
  108. package/src/lib/setupTrackingContext.js +15 -12
  109. package/src/lib/sharedState.js +42 -7
  110. package/src/lib/substituteScreenAtRules.js +6 -3
  111. package/src/postcss-plugins/nesting/README.md +42 -0
  112. package/src/postcss-plugins/nesting/index.js +13 -0
  113. package/src/postcss-plugins/nesting/plugin.js +80 -0
  114. package/src/processTailwindFeatures.js +17 -2
  115. package/src/public/colors.js +4 -9
  116. package/src/util/buildMediaQuery.js +14 -18
  117. package/src/util/cloneNodes.js +14 -1
  118. package/src/util/color.js +31 -14
  119. package/src/util/createUtilityPlugin.js +2 -2
  120. package/src/util/dataTypes.js +56 -16
  121. package/src/util/defaults.js +6 -0
  122. package/src/util/formatVariantSelector.js +213 -0
  123. package/src/util/getAllConfigs.js +7 -0
  124. package/src/util/isValidArbitraryValue.js +61 -0
  125. package/src/util/log.js +23 -22
  126. package/src/util/nameClass.js +2 -2
  127. package/src/util/negateValue.js +4 -2
  128. package/src/util/normalizeConfig.js +262 -0
  129. package/src/util/normalizeScreens.js +45 -0
  130. package/src/util/parseBoxShadowValue.js +72 -0
  131. package/src/util/pluginUtils.js +51 -147
  132. package/src/util/prefixSelector.js +7 -8
  133. package/src/util/resolveConfig.js +108 -79
  134. package/src/util/splitAtTopLevelOnly.js +71 -0
  135. package/src/util/toPath.js +23 -1
  136. package/src/util/transformThemeValue.js +24 -7
  137. package/src/util/validateConfig.js +13 -0
  138. package/stubs/defaultConfig.stub.js +157 -94
  139. package/stubs/simpleConfig.stub.js +0 -1
  140. package/types/config.d.ts +325 -0
  141. package/types/generated/.gitkeep +0 -0
  142. package/types/generated/colors.d.ts +276 -0
  143. package/types/generated/corePluginList.d.ts +1 -0
  144. package/types/index.d.ts +1 -0
  145. package/types.d.ts +1 -0
  146. package/lib/lib/setupWatchingContext.js +0 -284
  147. package/nesting/plugin.js +0 -41
  148. package/src/lib/setupWatchingContext.js +0 -306
@@ -1,146 +1,103 @@
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 { normalizeScreens } from './util/normalizeScreens'
16
+ import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
17
+ import { flagEnabled } from './featureFlags'
22
18
 
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
- )
19
+ export let variantPlugins = {
20
+ pseudoElementVariants: ({ addVariant }) => {
21
+ addVariant('first-letter', '&::first-letter')
22
+ addVariant('first-line', '&::first-line')
34
23
 
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
- )
24
+ addVariant('marker', ['& *::marker', '&::marker'])
25
+ addVariant('selection', ['& *::selection', '&::selection'])
43
26
 
44
- addVariant('marker', [
45
- transformAllSelectors((selector) => {
46
- let variantSelector = updateAllClasses(selector, (className) => {
47
- return `marker${config('separator')}${className}`
48
- })
27
+ addVariant('file', '&::file-selector-button')
49
28
 
50
- return `${variantSelector} *::marker`
51
- }),
52
- transformAllSelectors((selector) => {
53
- return updateAllClasses(selector, (className, { withPseudo }) => {
54
- return withPseudo(`marker${config('separator')}${className}`, '::marker')
55
- })
56
- }),
57
- ])
29
+ addVariant('placeholder', '&::placeholder')
58
30
 
59
- addVariant('selection', [
60
- transformAllSelectors((selector) => {
61
- let variantSelector = updateAllClasses(selector, (className) => {
62
- return `selection${config('separator')}${className}`
63
- })
31
+ addVariant('backdrop', '&::backdrop')
64
32
 
65
- return `${variantSelector} *::selection`
66
- }),
67
- transformAllSelectors((selector) => {
68
- return updateAllClasses(selector, (className, { withPseudo }) => {
69
- return withPseudo(`selection${config('separator')}${className}`, '::selection')
33
+ addVariant('before', ({ container }) => {
34
+ container.walkRules((rule) => {
35
+ let foundContent = false
36
+ rule.walkDecls('content', () => {
37
+ foundContent = true
70
38
  })
71
- }),
72
- ])
73
39
 
74
- addVariant(
75
- 'file',
76
- transformAllSelectors((selector) => {
77
- return updateAllClasses(selector, (className, { withPseudo }) => {
78
- return withPseudo(`file${config('separator')}${className}`, '::file-selector-button')
79
- })
40
+ if (!foundContent) {
41
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
42
+ }
80
43
  })
81
- )
82
44
 
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
- },
101
- }
102
- )
103
- )
45
+ return '&::before'
46
+ })
104
47
 
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
- },
48
+ addVariant('after', ({ container }) => {
49
+ container.walkRules((rule) => {
50
+ let foundContent = false
51
+ rule.walkDecls('content', () => {
52
+ foundContent = true
53
+ })
54
+
55
+ if (!foundContent) {
56
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
123
57
  }
124
- )
125
- )
58
+ })
59
+
60
+ return '&::after'
61
+ })
126
62
  },
127
63
 
128
- pseudoClassVariants: ({ config, addVariant }) => {
64
+ pseudoClassVariants: ({ addVariant, config }) => {
129
65
  let pseudoVariants = [
130
66
  // Positional
131
- ['first', ':first-child'],
132
- ['last', ':last-child'],
133
- ['only', ':only-child'],
134
- ['odd', ':nth-child(odd)'],
135
- ['even', ':nth-child(even)'],
67
+ ['first', '&:first-child'],
68
+ ['last', '&:last-child'],
69
+ ['only', '&:only-child'],
70
+ ['odd', '&:nth-child(odd)'],
71
+ ['even', '&:nth-child(even)'],
136
72
  'first-of-type',
137
73
  'last-of-type',
138
74
  'only-of-type',
139
75
 
140
76
  // State
141
- 'visited',
77
+ [
78
+ 'visited',
79
+ ({ container }) => {
80
+ let toRemove = ['--tw-text-opacity', '--tw-border-opacity', '--tw-bg-opacity']
81
+
82
+ container.walkDecls((decl) => {
83
+ if (toRemove.includes(decl.prop)) {
84
+ decl.remove()
85
+
86
+ return
87
+ }
88
+
89
+ for (const varName of toRemove) {
90
+ if (decl.value.includes(`/ var(${varName})`)) {
91
+ decl.value = decl.value.replace(`/ var(${varName})`, '')
92
+ }
93
+ }
94
+ })
95
+
96
+ return '&:visited'
97
+ },
98
+ ],
142
99
  'target',
143
- ['open', '[open]'],
100
+ ['open', '&[open]'],
144
101
 
145
102
  // Forms
146
103
  'default',
@@ -160,204 +117,149 @@ export default {
160
117
 
161
118
  // Interactive
162
119
  'focus-within',
163
- 'hover',
120
+ [
121
+ 'hover',
122
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
123
+ ? '&:hover'
124
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
125
+ ],
164
126
  'focus',
165
127
  'focus-visible',
166
128
  'active',
129
+ 'enabled',
167
130
  '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
- }
131
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
184
132
 
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
- })
133
+ for (let [variantName, state] of pseudoVariants) {
134
+ addVariant(variantName, (ctx) => {
135
+ let result = typeof state === 'function' ? state(ctx) : state
197
136
 
198
- if (variantSelector === selector) {
199
- return null
200
- }
201
-
202
- return applyStateToMarker(
203
- variantSelector,
204
- groupMarker,
205
- state,
206
- (marker, selector) => `${marker} ${selector}`
207
- )
208
- })
209
- )
137
+ return result
138
+ })
210
139
  }
211
140
 
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
- })
141
+ for (let [variantName, state] of pseudoVariants) {
142
+ addVariant(`group-${variantName}`, (ctx) => {
143
+ let result = typeof state === 'function' ? state(ctx) : state
224
144
 
225
- if (variantSelector === selector) {
226
- return null
227
- }
145
+ return result.replace(/&(\S+)/, ':merge(.group)$1 &')
146
+ })
147
+ }
228
148
 
229
- return applyStateToMarker(variantSelector, peerMarker, state, (marker, selector) =>
230
- selector.trim().startsWith('~') ? `${marker}${selector}` : `${marker} ~ ${selector}`
231
- )
232
- })
233
- )
149
+ for (let [variantName, state] of pseudoVariants) {
150
+ addVariant(`peer-${variantName}`, (ctx) => {
151
+ let result = typeof state === 'function' ? state(ctx) : state
152
+
153
+ return result.replace(/&(\S+)/, ':merge(.peer)$1 ~ &')
154
+ })
234
155
  }
235
156
  },
236
157
 
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
- )
158
+ directionVariants: ({ addVariant }) => {
159
+ addVariant('ltr', () => {
160
+ log.warn('rtl-experimental', [
161
+ 'The RTL features in Tailwind CSS are currently in preview.',
162
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
163
+ ])
248
164
 
249
- addVariant(
250
- 'rtl',
251
- transformAllSelectors(
252
- (selector) =>
253
- `[dir="rtl"] ${updateAllClasses(
254
- selector,
255
- (className) => `rtl${config('separator')}${className}`
256
- )}`
257
- )
258
- )
259
- },
165
+ return '[dir="ltr"] &'
166
+ })
260
167
 
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
- )
168
+ addVariant('rtl', () => {
169
+ log.warn('rtl-experimental', [
170
+ 'The RTL features in Tailwind CSS are currently in preview.',
171
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
172
+ ])
277
173
 
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
- )
174
+ return '[dir="rtl"] &'
175
+ })
176
+ },
177
+
178
+ reducedMotionVariants: ({ addVariant }) => {
179
+ addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)')
180
+ addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)')
293
181
  },
294
182
 
295
183
  darkVariants: ({ config, addVariant }) => {
296
- let mode = config('darkMode', 'media')
184
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
185
+
297
186
  if (mode === false) {
298
187
  mode = 'media'
299
- log.warn([
300
- '`darkMode` is set to `false` in your config.',
301
- 'This will behave just like the `media` value.',
188
+ log.warn('darkmode-false', [
189
+ 'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
190
+ 'Change `darkMode` to `media` or remove it entirely.',
191
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
302
192
  ])
303
193
  }
304
194
 
305
195
  if (mode === 'class') {
306
- addVariant(
307
- 'dark',
308
- transformAllSelectors((selector) => {
309
- let variantSelector = updateLastClasses(selector, (className) => {
310
- return `dark${config('separator')}${className}`
311
- })
196
+ addVariant('dark', `${className} &`)
197
+ } else if (mode === 'media') {
198
+ addVariant('dark', '@media (prefers-color-scheme: dark)')
199
+ }
200
+ },
312
201
 
313
- if (variantSelector === selector) {
314
- return null
315
- }
202
+ printVariant: ({ addVariant }) => {
203
+ addVariant('print', '@media print')
204
+ },
316
205
 
317
- let darkSelector = prefixSelector(config('prefix'), `.dark`)
206
+ screenVariants: ({ theme, addVariant }) => {
207
+ for (let screen of normalizeScreens(theme('screens'))) {
208
+ let query = buildMediaQuery(screen)
318
209
 
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
- )
210
+ addVariant(screen.name, `@media ${query}`)
338
211
  }
339
212
  },
340
213
 
341
- screenVariants: ({ config, theme, addVariant }) => {
342
- for (let screen in theme('screens')) {
343
- let size = theme('screens')[screen]
344
- let query = buildMediaQuery(size)
214
+ orientationVariants: ({ addVariant }) => {
215
+ addVariant('portrait', '@media (orientation: portrait)')
216
+ addVariant('landscape', '@media (orientation: landscape)')
217
+ },
345
218
 
346
- addVariant(
347
- screen,
348
- transformLastClasses(
349
- (className) => {
350
- return `${screen}${config('separator')}${className}`
351
- },
352
- { wrap: () => postcss.atRule({ name: 'media', params: query }) }
353
- )
354
- )
355
- }
219
+ prefersContrastVariants: ({ addVariant }) => {
220
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
221
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
356
222
  },
223
+ }
357
224
 
358
- // Actual plugins
225
+ let cssTransformValue = [
226
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
227
+ 'rotate(var(--tw-rotate))',
228
+ 'skewX(var(--tw-skew-x))',
229
+ 'skewY(var(--tw-skew-y))',
230
+ 'scaleX(var(--tw-scale-x))',
231
+ 'scaleY(var(--tw-scale-y))',
232
+ ].join(' ')
233
+
234
+ let cssFilterValue = [
235
+ 'var(--tw-blur)',
236
+ 'var(--tw-brightness)',
237
+ 'var(--tw-contrast)',
238
+ 'var(--tw-grayscale)',
239
+ 'var(--tw-hue-rotate)',
240
+ 'var(--tw-invert)',
241
+ 'var(--tw-saturate)',
242
+ 'var(--tw-sepia)',
243
+ 'var(--tw-drop-shadow)',
244
+ ].join(' ')
245
+
246
+ let cssBackdropFilterValue = [
247
+ 'var(--tw-backdrop-blur)',
248
+ 'var(--tw-backdrop-brightness)',
249
+ 'var(--tw-backdrop-contrast)',
250
+ 'var(--tw-backdrop-grayscale)',
251
+ 'var(--tw-backdrop-hue-rotate)',
252
+ 'var(--tw-backdrop-invert)',
253
+ 'var(--tw-backdrop-opacity)',
254
+ 'var(--tw-backdrop-saturate)',
255
+ 'var(--tw-backdrop-sepia)',
256
+ ].join(' ')
257
+
258
+ export let corePlugins = {
359
259
  preflight: ({ addBase }) => {
360
- let preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8'))
260
+ let preflightStyles = postcss.parse(
261
+ fs.readFileSync(path.join(__dirname, './css/preflight.css'), 'utf8')
262
+ )
361
263
 
362
264
  addBase([
363
265
  postcss.comment({
@@ -368,24 +270,10 @@ export default {
368
270
  },
369
271
 
370
272
  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
- })
273
+ function extractMinWidths(breakpoints = []) {
274
+ return breakpoints
275
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
276
+ .filter((v) => v !== undefined)
389
277
  }
390
278
 
391
279
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
@@ -414,16 +302,11 @@ export default {
414
302
  }
415
303
 
416
304
  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
- })
305
+ for (let screen of screens) {
306
+ for (let { min } of screen.values) {
307
+ if (min === minWidth) {
308
+ mapping.push({ minWidth, padding: paddings[screen.name] })
309
+ }
427
310
  }
428
311
  }
429
312
  }
@@ -432,12 +315,12 @@ export default {
432
315
  }
433
316
 
434
317
  return function ({ addComponents, theme }) {
435
- let screens = theme('container.screens', theme('screens'))
318
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
436
319
  let minWidths = extractMinWidths(screens)
437
320
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
438
321
 
439
322
  let generatePaddingFor = (minWidth) => {
440
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
323
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
441
324
 
442
325
  if (!paddingConfig) {
443
326
  return {}
@@ -523,19 +406,23 @@ export default {
523
406
  })
524
407
  },
525
408
 
526
- inset: createUtilityPlugin('inset', [
527
- ['inset', ['top', 'right', 'bottom', 'left']],
528
- [
529
- ['inset-x', ['left', 'right']],
530
- ['inset-y', ['top', 'bottom']],
531
- ],
409
+ inset: createUtilityPlugin(
410
+ 'inset',
532
411
  [
533
- ['top', ['top']],
534
- ['right', ['right']],
535
- ['bottom', ['bottom']],
536
- ['left', ['left']],
412
+ ['inset', ['top', 'right', 'bottom', 'left']],
413
+ [
414
+ ['inset-x', ['left', 'right']],
415
+ ['inset-y', ['top', 'bottom']],
416
+ ],
417
+ [
418
+ ['top', ['top']],
419
+ ['right', ['right']],
420
+ ['bottom', ['bottom']],
421
+ ['left', ['left']],
422
+ ],
537
423
  ],
538
- ]),
424
+ { supportsNegativeValues: true }
425
+ ),
539
426
 
540
427
  isolation: ({ addUtilities }) => {
541
428
  addUtilities({
@@ -544,8 +431,8 @@ export default {
544
431
  })
545
432
  },
546
433
 
547
- zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]]),
548
- order: createUtilityPlugin('order'),
434
+ zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]], { supportsNegativeValues: true }),
435
+ order: createUtilityPlugin('order', undefined, { supportsNegativeValues: true }),
549
436
  gridColumn: createUtilityPlugin('gridColumn', [['col', ['gridColumn']]]),
550
437
  gridColumnStart: createUtilityPlugin('gridColumnStart', [['col-start', ['gridColumnStart']]]),
551
438
  gridColumnEnd: createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]]),
@@ -570,19 +457,23 @@ export default {
570
457
  })
571
458
  },
572
459
 
573
- margin: createUtilityPlugin('margin', [
574
- ['m', ['margin']],
575
- [
576
- ['mx', ['margin-left', 'margin-right']],
577
- ['my', ['margin-top', 'margin-bottom']],
578
- ],
460
+ margin: createUtilityPlugin(
461
+ 'margin',
579
462
  [
580
- ['mt', ['margin-top']],
581
- ['mr', ['margin-right']],
582
- ['mb', ['margin-bottom']],
583
- ['ml', ['margin-left']],
463
+ ['m', ['margin']],
464
+ [
465
+ ['mx', ['margin-left', 'margin-right']],
466
+ ['my', ['margin-top', 'margin-bottom']],
467
+ ],
468
+ [
469
+ ['mt', ['margin-top']],
470
+ ['mr', ['margin-right']],
471
+ ['mb', ['margin-bottom']],
472
+ ['ml', ['margin-left']],
473
+ ],
584
474
  ],
585
- ]),
475
+ { supportsNegativeValues: true }
476
+ ),
586
477
 
587
478
  boxSizing: ({ addUtilities }) => {
588
479
  addUtilities({
@@ -628,8 +519,15 @@ export default {
628
519
  maxWidth: createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]]),
629
520
 
630
521
  flex: createUtilityPlugin('flex'),
631
- flexShrink: createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]]),
632
- flexGrow: createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]]),
522
+ flexShrink: createUtilityPlugin('flexShrink', [
523
+ ['flex-shrink', ['flex-shrink']], // Deprecated
524
+ ['shrink', ['flex-shrink']],
525
+ ]),
526
+ flexGrow: createUtilityPlugin('flexGrow', [
527
+ ['flex-grow', ['flex-grow']], // Deprecated
528
+ ['grow', ['flex-grow']],
529
+ ]),
530
+ flexBasis: createUtilityPlugin('flexBasis', [['basis', ['flex-basis']]]),
633
531
 
634
532
  tableLayout: ({ addUtilities }) => {
635
533
  addUtilities({
@@ -645,133 +543,151 @@ export default {
645
543
  })
646
544
  },
647
545
 
546
+ borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
547
+ addDefaults('border-spacing', {
548
+ '--tw-border-spacing-x': 0,
549
+ '--tw-border-spacing-y': 0,
550
+ })
551
+
552
+ matchUtilities(
553
+ {
554
+ 'border-spacing': (value) => {
555
+ return {
556
+ '--tw-border-spacing-x': value,
557
+ '--tw-border-spacing-y': value,
558
+ '@defaults border-spacing': {},
559
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
560
+ }
561
+ },
562
+ 'border-spacing-x': (value) => {
563
+ return {
564
+ '--tw-border-spacing-x': value,
565
+ '@defaults border-spacing': {},
566
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
567
+ }
568
+ },
569
+ 'border-spacing-y': (value) => {
570
+ return {
571
+ '--tw-border-spacing-y': value,
572
+ '@defaults border-spacing': {},
573
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
574
+ }
575
+ },
576
+ },
577
+ { values: theme('borderSpacing') }
578
+ )
579
+ },
580
+
648
581
  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', [
582
+ translate: createUtilityPlugin(
583
+ 'translate',
665
584
  [
666
585
  [
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)']],
586
+ [
587
+ 'translate-x',
588
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
589
+ ],
590
+ [
591
+ 'translate-y',
592
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
593
+ ],
673
594
  ],
674
595
  ],
675
- ]),
676
- scale: createUtilityPlugin('scale', [
596
+ { supportsNegativeValues: true }
597
+ ),
598
+ rotate: createUtilityPlugin(
599
+ 'rotate',
600
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
601
+ { supportsNegativeValues: true }
602
+ ),
603
+ skew: createUtilityPlugin(
604
+ 'skew',
677
605
  [
678
- 'scale',
679
606
  [
680
- ['@defaults transform', {}],
681
- '--tw-scale-x',
682
- '--tw-scale-y',
683
- ['transform', 'var(--tw-transform)'],
607
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
608
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
684
609
  ],
685
610
  ],
611
+ { supportsNegativeValues: true }
612
+ ),
613
+ scale: createUtilityPlugin(
614
+ 'scale',
686
615
  [
687
616
  [
688
- 'scale-x',
689
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
617
+ 'scale',
618
+ [
619
+ ['@defaults transform', {}],
620
+ '--tw-scale-x',
621
+ '--tw-scale-y',
622
+ ['transform', cssTransformValue],
623
+ ],
690
624
  ],
691
625
  [
692
- 'scale-y',
693
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
626
+ [
627
+ 'scale-x',
628
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
629
+ ],
630
+ [
631
+ 'scale-y',
632
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
633
+ ],
694
634
  ],
695
635
  ],
696
- ]),
636
+ { supportsNegativeValues: true }
637
+ ),
697
638
 
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)' },
639
+ transform: ({ addDefaults, addUtilities }) => {
640
+ addDefaults('transform', {
641
+ '--tw-translate-x': '0',
642
+ '--tw-translate-y': '0',
643
+ '--tw-rotate': '0',
644
+ '--tw-skew-x': '0',
645
+ '--tw-skew-y': '0',
646
+ '--tw-scale-x': '1',
647
+ '--tw-scale-y': '1',
648
+ })
649
+
650
+ addUtilities({
651
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
721
652
  '.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(' '),
653
+ transform: cssTransformValue,
731
654
  },
732
655
  '.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(' '),
656
+ transform: cssTransformValue.replace(
657
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
658
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
659
+ ),
741
660
  },
742
661
  '.transform-none': { transform: 'none' },
743
662
  })
744
663
  },
745
664
 
746
- animation: ({ matchUtilities, theme, prefix }) => {
747
- let prefixName = (name) => prefix(`.${name}`).slice(1)
665
+ animation: ({ matchUtilities, theme, config }) => {
666
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
748
667
  let keyframes = Object.fromEntries(
749
668
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
750
- return [key, [{ [`@keyframes ${prefixName(key)}`]: value }]]
669
+ return [key, { [`@keyframes ${prefixName(key)}`]: value }]
751
670
  })
752
671
  )
753
672
 
754
673
  matchUtilities(
755
674
  {
756
- animate: (value, { includeRules }) => {
675
+ animate: (value) => {
757
676
  let animations = parseAnimationValue(value)
758
677
 
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
- }
678
+ return [
679
+ ...animations.flatMap((animation) => keyframes[animation.name]),
680
+ {
681
+ animation: animations
682
+ .map(({ name, value }) => {
683
+ if (name === undefined || keyframes[name] === undefined) {
684
+ return value
685
+ }
686
+ return value.replace(name, prefixName(name))
687
+ })
688
+ .join(', '),
689
+ },
690
+ ]
775
691
  },
776
692
  },
777
693
  { values: theme('animation') }
@@ -780,17 +696,53 @@ export default {
780
696
 
781
697
  cursor: createUtilityPlugin('cursor'),
782
698
 
783
- touchAction: ({ addUtilities }) => {
699
+ touchAction: ({ addDefaults, addUtilities }) => {
700
+ addDefaults('touch-action', {
701
+ '--tw-pan-x': ' ',
702
+ '--tw-pan-y': ' ',
703
+ '--tw-pinch-zoom': ' ',
704
+ })
705
+
706
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
707
+
784
708
  addUtilities({
785
709
  '.touch-auto': { 'touch-action': 'auto' },
786
710
  '.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' },
711
+ '.touch-pan-x': {
712
+ '@defaults touch-action': {},
713
+ '--tw-pan-x': 'pan-x',
714
+ 'touch-action': cssTouchActionValue,
715
+ },
716
+ '.touch-pan-left': {
717
+ '@defaults touch-action': {},
718
+ '--tw-pan-x': 'pan-left',
719
+ 'touch-action': cssTouchActionValue,
720
+ },
721
+ '.touch-pan-right': {
722
+ '@defaults touch-action': {},
723
+ '--tw-pan-x': 'pan-right',
724
+ 'touch-action': cssTouchActionValue,
725
+ },
726
+ '.touch-pan-y': {
727
+ '@defaults touch-action': {},
728
+ '--tw-pan-y': 'pan-y',
729
+ 'touch-action': cssTouchActionValue,
730
+ },
731
+ '.touch-pan-up': {
732
+ '@defaults touch-action': {},
733
+ '--tw-pan-y': 'pan-up',
734
+ 'touch-action': cssTouchActionValue,
735
+ },
736
+ '.touch-pan-down': {
737
+ '@defaults touch-action': {},
738
+ '--tw-pan-y': 'pan-down',
739
+ 'touch-action': cssTouchActionValue,
740
+ },
741
+ '.touch-pinch-zoom': {
742
+ '@defaults touch-action': {},
743
+ '--tw-pinch-zoom': 'pinch-zoom',
744
+ 'touch-action': cssTouchActionValue,
745
+ },
794
746
  '.touch-manipulation': { 'touch-action': 'manipulation' },
795
747
  })
796
748
  },
@@ -813,11 +765,9 @@ export default {
813
765
  })
814
766
  },
815
767
 
816
- scrollSnapType: ({ addUtilities, addBase }) => {
817
- addBase({
818
- '@defaults scroll-snap-type': {
819
- '--tw-scroll-snap-strictness': 'proximity',
820
- },
768
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
769
+ addDefaults('scroll-snap-type', {
770
+ '--tw-scroll-snap-strictness': 'proximity',
821
771
  })
822
772
 
823
773
  addUtilities({
@@ -855,19 +805,23 @@ export default {
855
805
  })
856
806
  },
857
807
 
858
- scrollMargin: createUtilityPlugin('scrollMargin', [
859
- ['scroll-m', ['scroll-margin']],
808
+ scrollMargin: createUtilityPlugin(
809
+ 'scrollMargin',
860
810
  [
861
- ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
862
- ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
863
- ],
864
- [
865
- ['scroll-mt', ['scroll-margin-top']],
866
- ['scroll-mr', ['scroll-margin-right']],
867
- ['scroll-mb', ['scroll-margin-bottom']],
868
- ['scroll-ml', ['scroll-margin-left']],
811
+ ['scroll-m', ['scroll-margin']],
812
+ [
813
+ ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
814
+ ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
815
+ ],
816
+ [
817
+ ['scroll-mt', ['scroll-margin-top']],
818
+ ['scroll-mr', ['scroll-margin-right']],
819
+ ['scroll-mb', ['scroll-margin-bottom']],
820
+ ['scroll-ml', ['scroll-margin-left']],
821
+ ],
869
822
  ],
870
- ]),
823
+ { supportsNegativeValues: true }
824
+ ),
871
825
 
872
826
  scrollPadding: createUtilityPlugin('scrollPadding', [
873
827
  ['scroll-p', ['scroll-padding']],
@@ -941,6 +895,7 @@ export default {
941
895
  addUtilities({
942
896
  '.grid-flow-row': { gridAutoFlow: 'row' },
943
897
  '.grid-flow-col': { gridAutoFlow: 'column' },
898
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
944
899
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
945
900
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
946
901
  })
@@ -1065,7 +1020,7 @@ export default {
1065
1020
  }
1066
1021
  },
1067
1022
  },
1068
- { values: theme('space') }
1023
+ { values: theme('space'), supportsNegativeValues: true }
1069
1024
  )
1070
1025
 
1071
1026
  addUtilities({
@@ -1310,24 +1265,7 @@ export default {
1310
1265
  })
1311
1266
  },
1312
1267
 
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
-
1268
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1331
1269
  matchUtilities(
1332
1270
  {
1333
1271
  border: (value) => {
@@ -1528,8 +1466,10 @@ export default {
1528
1466
 
1529
1467
  boxDecorationBreak: ({ addUtilities }) => {
1530
1468
  addUtilities({
1531
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1532
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1469
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1470
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1471
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1472
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1533
1473
  })
1534
1474
  },
1535
1475
 
@@ -1634,10 +1574,14 @@ export default {
1634
1574
  '.text-center': { 'text-align': 'center' },
1635
1575
  '.text-right': { 'text-align': 'right' },
1636
1576
  '.text-justify': { 'text-align': 'justify' },
1577
+ '.text-start': { 'text-align': 'start' },
1578
+ '.text-end': { 'text-align': 'end' },
1637
1579
  })
1638
1580
  },
1639
1581
 
1640
- textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]]),
1582
+ textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]], {
1583
+ supportsNegativeValues: true,
1584
+ }),
1641
1585
 
1642
1586
  verticalAlign: ({ addUtilities, matchUtilities }) => {
1643
1587
  addUtilities({
@@ -1701,32 +1645,67 @@ export default {
1701
1645
  })
1702
1646
  },
1703
1647
 
1704
- fontVariantNumeric: ({ addUtilities }) => {
1648
+ fontVariantNumeric: ({ addDefaults, addUtilities }) => {
1649
+ let cssFontVariantNumericValue =
1650
+ 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
1651
+
1652
+ addDefaults('font-variant-numeric', {
1653
+ '--tw-ordinal': ' ',
1654
+ '--tw-slashed-zero': ' ',
1655
+ '--tw-numeric-figure': ' ',
1656
+ '--tw-numeric-spacing': ' ',
1657
+ '--tw-numeric-fraction': ' ',
1658
+ })
1659
+
1705
1660
  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
1661
  '.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' },
1662
+ '.ordinal': {
1663
+ '@defaults font-variant-numeric': {},
1664
+ '--tw-ordinal': 'ordinal',
1665
+ 'font-variant-numeric': cssFontVariantNumericValue,
1666
+ },
1667
+ '.slashed-zero': {
1668
+ '@defaults font-variant-numeric': {},
1669
+ '--tw-slashed-zero': 'slashed-zero',
1670
+ 'font-variant-numeric': cssFontVariantNumericValue,
1671
+ },
1672
+ '.lining-nums': {
1673
+ '@defaults font-variant-numeric': {},
1674
+ '--tw-numeric-figure': 'lining-nums',
1675
+ 'font-variant-numeric': cssFontVariantNumericValue,
1676
+ },
1677
+ '.oldstyle-nums': {
1678
+ '@defaults font-variant-numeric': {},
1679
+ '--tw-numeric-figure': 'oldstyle-nums',
1680
+ 'font-variant-numeric': cssFontVariantNumericValue,
1681
+ },
1682
+ '.proportional-nums': {
1683
+ '@defaults font-variant-numeric': {},
1684
+ '--tw-numeric-spacing': 'proportional-nums',
1685
+ 'font-variant-numeric': cssFontVariantNumericValue,
1686
+ },
1687
+ '.tabular-nums': {
1688
+ '@defaults font-variant-numeric': {},
1689
+ '--tw-numeric-spacing': 'tabular-nums',
1690
+ 'font-variant-numeric': cssFontVariantNumericValue,
1691
+ },
1692
+ '.diagonal-fractions': {
1693
+ '@defaults font-variant-numeric': {},
1694
+ '--tw-numeric-fraction': 'diagonal-fractions',
1695
+ 'font-variant-numeric': cssFontVariantNumericValue,
1696
+ },
1697
+ '.stacked-fractions': {
1698
+ '@defaults font-variant-numeric': {},
1699
+ '--tw-numeric-fraction': 'stacked-fractions',
1700
+ 'font-variant-numeric': cssFontVariantNumericValue,
1701
+ },
1725
1702
  })
1726
1703
  },
1727
1704
 
1728
1705
  lineHeight: createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]]),
1729
- letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]]),
1706
+ letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]], {
1707
+ supportsNegativeValues: true,
1708
+ }),
1730
1709
 
1731
1710
  textColor: ({ matchUtilities, theme, corePlugins }) => {
1732
1711
  matchUtilities(
@@ -1751,12 +1730,46 @@ export default {
1751
1730
 
1752
1731
  textDecoration: ({ addUtilities }) => {
1753
1732
  addUtilities({
1754
- '.underline': { 'text-decoration': 'underline' },
1755
- '.line-through': { 'text-decoration': 'line-through' },
1756
- '.no-underline': { 'text-decoration': 'none' },
1733
+ '.underline': { 'text-decoration-line': 'underline' },
1734
+ '.overline': { 'text-decoration-line': 'overline' },
1735
+ '.line-through': { 'text-decoration-line': 'line-through' },
1736
+ '.no-underline': { 'text-decoration-line': 'none' },
1757
1737
  })
1758
1738
  },
1759
1739
 
1740
+ textDecorationColor: ({ matchUtilities, theme }) => {
1741
+ matchUtilities(
1742
+ {
1743
+ decoration: (value) => {
1744
+ return { 'text-decoration-color': toColorValue(value) }
1745
+ },
1746
+ },
1747
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
1748
+ )
1749
+ },
1750
+
1751
+ textDecorationStyle: ({ addUtilities }) => {
1752
+ addUtilities({
1753
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1754
+ '.decoration-double': { 'text-decoration-style': 'double' },
1755
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1756
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1757
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1758
+ })
1759
+ },
1760
+
1761
+ textDecorationThickness: createUtilityPlugin(
1762
+ 'textDecorationThickness',
1763
+ [['decoration', ['text-decoration-thickness']]],
1764
+ { type: ['length', 'percentage'] }
1765
+ ),
1766
+
1767
+ textUnderlineOffset: createUtilityPlugin(
1768
+ 'textUnderlineOffset',
1769
+ [['underline-offset', ['text-underline-offset']]],
1770
+ { type: ['length', 'percentage'] }
1771
+ ),
1772
+
1760
1773
  fontSmoothing: ({ addUtilities }) => {
1761
1774
  addUtilities({
1762
1775
  '.antialiased': {
@@ -1869,6 +1882,7 @@ export default {
1869
1882
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1870
1883
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1871
1884
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
1885
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1872
1886
  })
1873
1887
  },
1874
1888
 
@@ -1880,13 +1894,12 @@ export default {
1880
1894
  `var(--tw-shadow)`,
1881
1895
  ].join(', ')
1882
1896
 
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
- },
1897
+ return function ({ matchUtilities, addDefaults, theme }) {
1898
+ addDefaults(' box-shadow', {
1899
+ '--tw-ring-offset-shadow': '0 0 #0000',
1900
+ '--tw-ring-shadow': '0 0 #0000',
1901
+ '--tw-shadow': '0 0 #0000',
1902
+ '--tw-shadow-colored': '0 0 #0000',
1890
1903
  })
1891
1904
 
1892
1905
  matchUtilities(
@@ -1894,50 +1907,100 @@ export default {
1894
1907
  shadow: (value) => {
1895
1908
  value = transformValue(value)
1896
1909
 
1910
+ let ast = parseBoxShadowValue(value)
1911
+ for (let shadow of ast) {
1912
+ // Don't override color if the whole shadow is a variable
1913
+ if (!shadow.valid) {
1914
+ continue
1915
+ }
1916
+
1917
+ shadow.color = 'var(--tw-shadow-color)'
1918
+ }
1919
+
1897
1920
  return {
1898
1921
  '@defaults box-shadow': {},
1899
1922
  '--tw-shadow': value === 'none' ? '0 0 #0000' : value,
1923
+ '--tw-shadow-colored': value === 'none' ? '0 0 #0000' : formatBoxShadowValue(ast),
1900
1924
  'box-shadow': defaultBoxShadow,
1901
1925
  }
1902
1926
  },
1903
1927
  },
1904
- { values: theme('boxShadow') }
1928
+ { values: theme('boxShadow'), type: ['shadow'] }
1905
1929
  )
1906
1930
  }
1907
1931
  })(),
1908
1932
 
1909
- outline: ({ matchUtilities, theme }) => {
1933
+ boxShadowColor: ({ matchUtilities, theme }) => {
1910
1934
  matchUtilities(
1911
1935
  {
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 }
1936
+ shadow: (value) => {
1937
+ return {
1938
+ '--tw-shadow-color': toColorValue(value),
1939
+ '--tw-shadow': 'var(--tw-shadow-colored)',
1940
+ }
1917
1941
  },
1918
1942
  },
1919
- { values: theme('outline') }
1943
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
1920
1944
  )
1921
1945
  },
1922
1946
 
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
- )
1947
+ outlineStyle: ({ addUtilities }) => {
1948
+ addUtilities({
1949
+ '.outline-none': {
1950
+ outline: '2px solid transparent',
1951
+ 'outline-offset': '2px',
1952
+ },
1953
+ '.outline': { 'outline-style': 'solid' },
1954
+ '.outline-dashed': { 'outline-style': 'dashed' },
1955
+ '.outline-dotted': { 'outline-style': 'dotted' },
1956
+ '.outline-double': { 'outline-style': 'double' },
1957
+ '.outline-hidden': { 'outline-style': 'hidden' },
1958
+ })
1959
+ },
1930
1960
 
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',
1961
+ outlineWidth: createUtilityPlugin('outlineWidth', [['outline', ['outline-width']]], {
1962
+ type: ['length', 'number', 'percentage'],
1963
+ }),
1964
+
1965
+ outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1966
+ type: ['length', 'number', 'percentage'],
1967
+ }),
1968
+
1969
+ outlineColor: ({ matchUtilities, theme }) => {
1970
+ matchUtilities(
1971
+ {
1972
+ outline: (value) => {
1973
+ return { 'outline-color': toColorValue(value) }
1974
+ },
1940
1975
  },
1976
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
1977
+ )
1978
+ },
1979
+
1980
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
1981
+ let ringColorDefault = (() => {
1982
+ if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
1983
+ return theme('ringColor.DEFAULT')
1984
+ }
1985
+
1986
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1987
+
1988
+ return withAlphaValue(
1989
+ theme('ringColor')?.DEFAULT,
1990
+ ringOpacityDefault,
1991
+ `rgb(147 197 253 / ${ringOpacityDefault})`
1992
+ )
1993
+ })()
1994
+
1995
+ addDefaults('ring-width', {
1996
+ '--tw-ring-inset': ' ',
1997
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1998
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1999
+ '--tw-ring-color': ringColorDefault,
2000
+ '--tw-ring-offset-shadow': '0 0 #0000',
2001
+ '--tw-ring-shadow': '0 0 #0000',
2002
+ '--tw-shadow': '0 0 #0000',
2003
+ '--tw-shadow-colored': '0 0 #0000',
1941
2004
  })
1942
2005
 
1943
2006
  matchUtilities(
@@ -1963,10 +2026,16 @@ export default {
1963
2026
  })
1964
2027
  },
1965
2028
 
1966
- ringColor: ({ matchUtilities, theme }) => {
2029
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1967
2030
  matchUtilities(
1968
2031
  {
1969
2032
  ring: (value) => {
2033
+ if (!corePlugins('ringOpacity')) {
2034
+ return {
2035
+ '--tw-ring-color': toColorValue(value),
2036
+ }
2037
+ }
2038
+
1970
2039
  return withAlphaVariable({
1971
2040
  color: value,
1972
2041
  property: '--tw-ring-color',
@@ -2014,7 +2083,7 @@ export default {
2014
2083
  return {
2015
2084
  '--tw-blur': `blur(${value})`,
2016
2085
  '@defaults filter': {},
2017
- filter: 'var(--tw-filter)',
2086
+ filter: cssFilterValue,
2018
2087
  }
2019
2088
  },
2020
2089
  },
@@ -2029,7 +2098,7 @@ export default {
2029
2098
  return {
2030
2099
  '--tw-brightness': `brightness(${value})`,
2031
2100
  '@defaults filter': {},
2032
- filter: 'var(--tw-filter)',
2101
+ filter: cssFilterValue,
2033
2102
  }
2034
2103
  },
2035
2104
  },
@@ -2044,7 +2113,7 @@ export default {
2044
2113
  return {
2045
2114
  '--tw-contrast': `contrast(${value})`,
2046
2115
  '@defaults filter': {},
2047
- filter: 'var(--tw-filter)',
2116
+ filter: cssFilterValue,
2048
2117
  }
2049
2118
  },
2050
2119
  },
@@ -2061,7 +2130,7 @@ export default {
2061
2130
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2062
2131
  : `drop-shadow(${value})`,
2063
2132
  '@defaults filter': {},
2064
- filter: 'var(--tw-filter)',
2133
+ filter: cssFilterValue,
2065
2134
  }
2066
2135
  },
2067
2136
  },
@@ -2076,7 +2145,7 @@ export default {
2076
2145
  return {
2077
2146
  '--tw-grayscale': `grayscale(${value})`,
2078
2147
  '@defaults filter': {},
2079
- filter: 'var(--tw-filter)',
2148
+ filter: cssFilterValue,
2080
2149
  }
2081
2150
  },
2082
2151
  },
@@ -2091,11 +2160,11 @@ export default {
2091
2160
  return {
2092
2161
  '--tw-hue-rotate': `hue-rotate(${value})`,
2093
2162
  '@defaults filter': {},
2094
- filter: 'var(--tw-filter)',
2163
+ filter: cssFilterValue,
2095
2164
  }
2096
2165
  },
2097
2166
  },
2098
- { values: theme('hueRotate') }
2167
+ { values: theme('hueRotate'), supportsNegativeValues: true }
2099
2168
  )
2100
2169
  },
2101
2170
 
@@ -2106,7 +2175,7 @@ export default {
2106
2175
  return {
2107
2176
  '--tw-invert': `invert(${value})`,
2108
2177
  '@defaults filter': {},
2109
- filter: 'var(--tw-filter)',
2178
+ filter: cssFilterValue,
2110
2179
  }
2111
2180
  },
2112
2181
  },
@@ -2121,7 +2190,7 @@ export default {
2121
2190
  return {
2122
2191
  '--tw-saturate': `saturate(${value})`,
2123
2192
  '@defaults filter': {},
2124
- filter: 'var(--tw-filter)',
2193
+ filter: cssFilterValue,
2125
2194
  }
2126
2195
  },
2127
2196
  },
@@ -2136,7 +2205,7 @@ export default {
2136
2205
  return {
2137
2206
  '--tw-sepia': `sepia(${value})`,
2138
2207
  '@defaults filter': {},
2139
- filter: 'var(--tw-filter)',
2208
+ filter: cssFilterValue,
2140
2209
  }
2141
2210
  },
2142
2211
  },
@@ -2144,33 +2213,20 @@ export default {
2144
2213
  )
2145
2214
  },
2146
2215
 
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)' },
2216
+ filter: ({ addDefaults, addUtilities }) => {
2217
+ addDefaults('filter', {
2218
+ '--tw-blur': ' ',
2219
+ '--tw-brightness': ' ',
2220
+ '--tw-contrast': ' ',
2221
+ '--tw-grayscale': ' ',
2222
+ '--tw-hue-rotate': ' ',
2223
+ '--tw-invert': ' ',
2224
+ '--tw-saturate': ' ',
2225
+ '--tw-sepia': ' ',
2226
+ '--tw-drop-shadow': ' ',
2227
+ })
2228
+ addUtilities({
2229
+ '.filter': { '@defaults filter': {}, filter: cssFilterValue },
2174
2230
  '.filter-none': { filter: 'none' },
2175
2231
  })
2176
2232
  },
@@ -2182,7 +2238,7 @@ export default {
2182
2238
  return {
2183
2239
  '--tw-backdrop-blur': `blur(${value})`,
2184
2240
  '@defaults backdrop-filter': {},
2185
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2241
+ 'backdrop-filter': cssBackdropFilterValue,
2186
2242
  }
2187
2243
  },
2188
2244
  },
@@ -2197,7 +2253,7 @@ export default {
2197
2253
  return {
2198
2254
  '--tw-backdrop-brightness': `brightness(${value})`,
2199
2255
  '@defaults backdrop-filter': {},
2200
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2256
+ 'backdrop-filter': cssBackdropFilterValue,
2201
2257
  }
2202
2258
  },
2203
2259
  },
@@ -2212,7 +2268,7 @@ export default {
2212
2268
  return {
2213
2269
  '--tw-backdrop-contrast': `contrast(${value})`,
2214
2270
  '@defaults backdrop-filter': {},
2215
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2271
+ 'backdrop-filter': cssBackdropFilterValue,
2216
2272
  }
2217
2273
  },
2218
2274
  },
@@ -2227,7 +2283,7 @@ export default {
2227
2283
  return {
2228
2284
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2229
2285
  '@defaults backdrop-filter': {},
2230
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2286
+ 'backdrop-filter': cssBackdropFilterValue,
2231
2287
  }
2232
2288
  },
2233
2289
  },
@@ -2242,11 +2298,11 @@ export default {
2242
2298
  return {
2243
2299
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2244
2300
  '@defaults backdrop-filter': {},
2245
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2301
+ 'backdrop-filter': cssBackdropFilterValue,
2246
2302
  }
2247
2303
  },
2248
2304
  },
2249
- { values: theme('backdropHueRotate') }
2305
+ { values: theme('backdropHueRotate'), supportsNegativeValues: true }
2250
2306
  )
2251
2307
  },
2252
2308
 
@@ -2257,7 +2313,7 @@ export default {
2257
2313
  return {
2258
2314
  '--tw-backdrop-invert': `invert(${value})`,
2259
2315
  '@defaults backdrop-filter': {},
2260
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2316
+ 'backdrop-filter': cssBackdropFilterValue,
2261
2317
  }
2262
2318
  },
2263
2319
  },
@@ -2272,7 +2328,7 @@ export default {
2272
2328
  return {
2273
2329
  '--tw-backdrop-opacity': `opacity(${value})`,
2274
2330
  '@defaults backdrop-filter': {},
2275
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2331
+ 'backdrop-filter': cssBackdropFilterValue,
2276
2332
  }
2277
2333
  },
2278
2334
  },
@@ -2287,7 +2343,7 @@ export default {
2287
2343
  return {
2288
2344
  '--tw-backdrop-saturate': `saturate(${value})`,
2289
2345
  '@defaults backdrop-filter': {},
2290
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2346
+ 'backdrop-filter': cssBackdropFilterValue,
2291
2347
  }
2292
2348
  },
2293
2349
  },
@@ -2302,7 +2358,7 @@ export default {
2302
2358
  return {
2303
2359
  '--tw-backdrop-sepia': `sepia(${value})`,
2304
2360
  '@defaults backdrop-filter': {},
2305
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2361
+ 'backdrop-filter': cssBackdropFilterValue,
2306
2362
  }
2307
2363
  },
2308
2364
  },
@@ -2310,35 +2366,22 @@ export default {
2310
2366
  )
2311
2367
  },
2312
2368
 
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
- },
2369
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2370
+ addDefaults('backdrop-filter', {
2371
+ '--tw-backdrop-blur': ' ',
2372
+ '--tw-backdrop-brightness': ' ',
2373
+ '--tw-backdrop-contrast': ' ',
2374
+ '--tw-backdrop-grayscale': ' ',
2375
+ '--tw-backdrop-hue-rotate': ' ',
2376
+ '--tw-backdrop-invert': ' ',
2377
+ '--tw-backdrop-opacity': ' ',
2378
+ '--tw-backdrop-saturate': ' ',
2379
+ '--tw-backdrop-sepia': ' ',
2337
2380
  })
2338
2381
  addUtilities({
2339
2382
  '.backdrop-filter': {
2340
2383
  '@defaults backdrop-filter': {},
2341
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2384
+ 'backdrop-filter': cssBackdropFilterValue,
2342
2385
  },
2343
2386
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2344
2387
  })
@@ -2378,5 +2421,7 @@ export default {
2378
2421
  { filterDefault: true }
2379
2422
  ),
2380
2423
  willChange: createUtilityPlugin('willChange', [['will-change', ['will-change']]]),
2381
- content: createUtilityPlugin('content'),
2424
+ content: createUtilityPlugin('content', [
2425
+ ['content', ['--tw-content', ['content', 'var(--tw-content)']]],
2426
+ ]),
2382
2427
  }