tailwindcss 0.0.0-insiders.df011dc → 0.0.0-insiders.e2d5f21

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 (120) hide show
  1. package/CHANGELOG.md +106 -1
  2. package/README.md +1 -1
  3. package/colors.js +1 -304
  4. package/defaultConfig.js +1 -4
  5. package/defaultTheme.js +1 -4
  6. package/lib/cli-peer-dependencies.js +4 -9
  7. package/lib/cli.js +646 -705
  8. package/lib/constants.js +15 -15
  9. package/lib/corePluginList.js +174 -4
  10. package/lib/corePlugins.js +3637 -2934
  11. package/lib/css/preflight.css +14 -1
  12. package/lib/featureFlags.js +44 -44
  13. package/lib/index.js +25 -24
  14. package/lib/lib/collapseAdjacentRules.js +33 -35
  15. package/lib/lib/collapseDuplicateDeclarations.js +29 -0
  16. package/lib/lib/detectNesting.js +34 -0
  17. package/lib/lib/evaluateTailwindFunctions.js +134 -155
  18. package/lib/lib/expandApplyAtRules.js +183 -200
  19. package/lib/lib/expandTailwindAtRules.js +219 -232
  20. package/lib/lib/generateRules.js +478 -311
  21. package/lib/lib/getModuleDependencies.js +36 -41
  22. package/lib/lib/normalizeTailwindDirectives.js +66 -58
  23. package/lib/lib/resolveDefaultsAtRules.js +110 -90
  24. package/lib/lib/setupContextUtils.js +740 -580
  25. package/lib/lib/setupTrackingContext.js +142 -162
  26. package/lib/lib/setupWatchingContext.js +235 -278
  27. package/lib/lib/sharedState.js +7 -17
  28. package/lib/lib/substituteScreenAtRules.js +22 -26
  29. package/lib/processTailwindFeatures.js +38 -44
  30. package/lib/public/colors.js +329 -0
  31. package/lib/public/create-plugin.js +13 -0
  32. package/lib/public/default-config.js +14 -0
  33. package/lib/public/default-theme.js +14 -0
  34. package/lib/public/resolve-config.js +19 -0
  35. package/lib/util/bigSign.js +3 -5
  36. package/lib/util/buildMediaQuery.js +15 -31
  37. package/lib/util/cloneDeep.js +14 -13
  38. package/lib/util/cloneNodes.js +9 -13
  39. package/lib/util/color.js +69 -59
  40. package/lib/util/configurePlugins.js +13 -14
  41. package/lib/util/createPlugin.js +21 -24
  42. package/lib/util/createUtilityPlugin.js +47 -45
  43. package/lib/util/dataTypes.js +231 -0
  44. package/lib/util/defaults.js +10 -14
  45. package/lib/util/escapeClassName.js +12 -14
  46. package/lib/util/escapeCommas.js +3 -5
  47. package/lib/util/flattenColorPalette.js +14 -10
  48. package/lib/util/formatVariantSelector.js +186 -0
  49. package/lib/util/getAllConfigs.js +23 -16
  50. package/lib/util/hashConfig.js +10 -10
  51. package/lib/util/isKeyframeRule.js +3 -5
  52. package/lib/util/isPlainObject.js +7 -10
  53. package/lib/util/isValidArbitraryValue.js +64 -0
  54. package/lib/util/log.js +39 -30
  55. package/lib/util/nameClass.js +23 -23
  56. package/lib/util/negateValue.js +14 -15
  57. package/lib/util/normalizeConfig.js +208 -0
  58. package/lib/util/normalizeScreens.js +58 -0
  59. package/lib/util/parseAnimationValue.js +82 -53
  60. package/lib/util/parseBoxShadowValue.js +77 -0
  61. package/lib/util/parseDependency.js +49 -60
  62. package/lib/util/parseObjectStyles.js +23 -20
  63. package/lib/util/pluginUtils.js +153 -285
  64. package/lib/util/prefixSelector.js +14 -16
  65. package/lib/util/resolveConfig.js +194 -249
  66. package/lib/util/resolveConfigPath.js +38 -45
  67. package/lib/util/responsive.js +12 -11
  68. package/lib/util/tap.js +4 -6
  69. package/lib/util/toColorValue.js +4 -5
  70. package/lib/util/toPath.js +4 -6
  71. package/lib/util/transformThemeValue.js +57 -26
  72. package/lib/util/withAlphaVariable.js +56 -54
  73. package/package.json +27 -37
  74. package/peers/index.js +73099 -84294
  75. package/plugin.js +1 -3
  76. package/resolveConfig.js +1 -7
  77. package/scripts/create-plugin-list.js +2 -2
  78. package/src/cli.js +27 -18
  79. package/src/corePluginList.js +1 -1
  80. package/src/corePlugins.js +2124 -1968
  81. package/src/css/preflight.css +14 -1
  82. package/src/featureFlags.js +12 -6
  83. package/src/lib/collapseDuplicateDeclarations.js +28 -0
  84. package/src/lib/detectNesting.js +39 -0
  85. package/src/lib/evaluateTailwindFunctions.js +5 -2
  86. package/src/lib/expandTailwindAtRules.js +24 -32
  87. package/src/lib/generateRules.js +230 -20
  88. package/src/lib/normalizeTailwindDirectives.js +3 -2
  89. package/src/lib/resolveDefaultsAtRules.js +46 -30
  90. package/src/lib/setupContextUtils.js +275 -113
  91. package/src/lib/setupTrackingContext.js +9 -8
  92. package/src/lib/setupWatchingContext.js +12 -7
  93. package/src/lib/sharedState.js +1 -4
  94. package/src/lib/substituteScreenAtRules.js +6 -3
  95. package/src/processTailwindFeatures.js +8 -1
  96. package/src/public/colors.js +300 -0
  97. package/src/public/create-plugin.js +2 -0
  98. package/src/public/default-config.js +4 -0
  99. package/src/public/default-theme.js +4 -0
  100. package/src/public/resolve-config.js +7 -0
  101. package/src/util/buildMediaQuery.js +14 -18
  102. package/src/util/createUtilityPlugin.js +2 -11
  103. package/src/util/dataTypes.js +246 -0
  104. package/src/util/formatVariantSelector.js +196 -0
  105. package/src/util/isValidArbitraryValue.js +61 -0
  106. package/src/util/log.js +18 -21
  107. package/src/util/nameClass.js +10 -6
  108. package/src/util/negateValue.js +4 -2
  109. package/src/util/normalizeConfig.js +249 -0
  110. package/src/util/normalizeScreens.js +42 -0
  111. package/src/util/parseAnimationValue.js +7 -1
  112. package/src/util/parseBoxShadowValue.js +71 -0
  113. package/src/util/parseDependency.js +4 -0
  114. package/src/util/pluginUtils.js +101 -204
  115. package/src/util/prefixSelector.js +1 -4
  116. package/src/util/resolveConfig.js +12 -65
  117. package/src/util/transformThemeValue.js +22 -7
  118. package/src/util/withAlphaVariable.js +13 -8
  119. package/stubs/defaultConfig.stub.js +163 -97
  120. package/stubs/simpleConfig.stub.js +0 -1
@@ -1,2217 +1,2373 @@
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
6
  import parseAnimationValue from './util/parseAnimationValue'
7
7
  import flattenColorPalette from './util/flattenColorPalette'
8
8
  import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
9
9
  import toColorValue from './util/toColorValue'
10
10
  import isPlainObject from './util/isPlainObject'
11
11
  import transformThemeValue from './util/transformThemeValue'
12
- import {
13
- applyPseudoToMarker,
14
- updateLastClasses,
15
- updateAllClasses,
16
- transformAllSelectors,
17
- transformAllClasses,
18
- transformLastClasses,
19
- asLength,
20
- asLookupValue,
21
- } from './util/pluginUtils'
22
- import packageJson from '../package.json'
12
+ import { version as tailwindVersion } from '../package.json'
23
13
  import log from './util/log'
14
+ import { normalizeScreens } from './util/normalizeScreens'
15
+ import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
24
16
 
25
- // Variant plugins
26
- export let pseudoElementVariants = ({ config, addVariant }) => {
27
- addVariant(
28
- 'first-letter',
29
- transformAllSelectors((selector) => {
30
- return updateAllClasses(selector, (className, { withPseudo }) => {
31
- return withPseudo(`first-letter${config('separator')}${className}`, '::first-letter')
32
- })
33
- })
34
- )
35
-
36
- addVariant(
37
- 'first-line',
38
- transformAllSelectors((selector) => {
39
- return updateAllClasses(selector, (className, { withPseudo }) => {
40
- return withPseudo(`first-line${config('separator')}${className}`, '::first-line')
41
- })
42
- })
43
- )
17
+ export let variantPlugins = {
18
+ pseudoElementVariants: ({ addVariant }) => {
19
+ addVariant('first-letter', '&::first-letter')
20
+ addVariant('first-line', '&::first-line')
44
21
 
45
- addVariant('marker', [
46
- transformAllSelectors((selector) => {
47
- let variantSelector = updateAllClasses(selector, (className) => {
48
- return `marker${config('separator')}${className}`
49
- })
22
+ addVariant('marker', ['& *::marker', '&::marker'])
23
+ addVariant('selection', ['& *::selection', '&::selection'])
50
24
 
51
- return `${variantSelector} *::marker`
52
- }),
53
- transformAllSelectors((selector) => {
54
- return updateAllClasses(selector, (className, { withPseudo }) => {
55
- return withPseudo(`marker${config('separator')}${className}`, '::marker')
56
- })
57
- }),
58
- ])
25
+ addVariant('file', '&::file-selector-button')
59
26
 
60
- addVariant('selection', [
61
- transformAllSelectors((selector) => {
62
- let variantSelector = updateAllClasses(selector, (className) => {
63
- return `selection${config('separator')}${className}`
64
- })
27
+ addVariant('placeholder', '&::placeholder')
65
28
 
66
- return `${variantSelector} *::selection`
67
- }),
68
- transformAllSelectors((selector) => {
69
- return updateAllClasses(selector, (className, { withPseudo }) => {
70
- return withPseudo(`selection${config('separator')}${className}`, '::selection')
71
- })
72
- }),
73
- ])
74
-
75
- addVariant(
76
- 'before',
77
- transformAllSelectors(
78
- (selector) => {
79
- return updateAllClasses(selector, (className, { withPseudo }) => {
80
- return withPseudo(`before${config('separator')}${className}`, '::before')
81
- })
82
- },
83
- {
84
- withRule: (rule) => {
85
- let foundContent = false
86
- rule.walkDecls('content', () => {
87
- foundContent = true
88
- })
89
- if (!foundContent) {
90
- rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
91
- }
92
- },
93
- }
94
- )
95
- )
96
-
97
- addVariant(
98
- 'after',
99
- transformAllSelectors(
100
- (selector) => {
101
- return updateAllClasses(selector, (className, { withPseudo }) => {
102
- return withPseudo(`after${config('separator')}${className}`, '::after')
29
+ addVariant('before', ({ container }) => {
30
+ container.walkRules((rule) => {
31
+ let foundContent = false
32
+ rule.walkDecls('content', () => {
33
+ foundContent = true
103
34
  })
104
- },
105
- {
106
- withRule: (rule) => {
107
- let foundContent = false
108
- rule.walkDecls('content', () => {
109
- foundContent = true
110
- })
111
- if (!foundContent) {
112
- rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
113
- }
114
- },
115
- }
116
- )
117
- )
118
- }
119
35
 
120
- export let pseudoClassVariants = ({ config, addVariant }) => {
121
- let pseudoVariants = [
122
- // Positional
123
- ['first', 'first-child'],
124
- ['last', 'last-child'],
125
- ['only', 'only-child'],
126
- ['odd', 'nth-child(odd)'],
127
- ['even', 'nth-child(even)'],
128
- 'first-of-type',
129
- 'last-of-type',
130
- 'only-of-type',
131
-
132
- // State
133
- 'visited',
134
- 'target',
135
-
136
- // Forms
137
- 'default',
138
- 'checked',
139
- 'indeterminate',
140
- 'placeholder-shown',
141
- 'autofill',
142
- 'required',
143
- 'valid',
144
- 'invalid',
145
- 'in-range',
146
- 'out-of-range',
147
- 'read-only',
148
-
149
- // Content
150
- 'empty',
151
-
152
- // Interactive
153
- 'focus-within',
154
- 'hover',
155
- 'focus',
156
- 'focus-visible',
157
- 'active',
158
- 'disabled',
159
- ]
160
-
161
- for (let variant of pseudoVariants) {
162
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant]
163
-
164
- addVariant(
165
- variantName,
166
- transformAllClasses((className, { withPseudo }) => {
167
- return withPseudo(`${variantName}${config('separator')}${className}`, `:${state}`)
36
+ if (!foundContent) {
37
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
38
+ }
168
39
  })
169
- )
170
- }
171
-
172
- let groupMarker = prefixSelector(config('prefix'), '.group')
173
- for (let variant of pseudoVariants) {
174
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant]
175
- let groupVariantName = `group-${variantName}`
176
-
177
- addVariant(
178
- groupVariantName,
179
- transformAllSelectors((selector) => {
180
- let variantSelector = updateAllClasses(selector, (className) => {
181
- if (`.${className}` === groupMarker) return className
182
- return `${groupVariantName}${config('separator')}${className}`
183
- })
184
40
 
185
- if (variantSelector === selector) {
186
- return null
187
- }
41
+ return '&::before'
42
+ })
188
43
 
189
- return applyPseudoToMarker(
190
- variantSelector,
191
- groupMarker,
192
- state,
193
- (marker, selector) => `${marker} ${selector}`
194
- )
195
- })
196
- )
197
- }
198
-
199
- let peerMarker = prefixSelector(config('prefix'), '.peer')
200
- for (let variant of pseudoVariants) {
201
- let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant]
202
- let peerVariantName = `peer-${variantName}`
203
-
204
- addVariant(
205
- peerVariantName,
206
- transformAllSelectors((selector) => {
207
- let variantSelector = updateAllClasses(selector, (className) => {
208
- if (`.${className}` === peerMarker) return className
209
- return `${peerVariantName}${config('separator')}${className}`
44
+ addVariant('after', ({ container }) => {
45
+ container.walkRules((rule) => {
46
+ let foundContent = false
47
+ rule.walkDecls('content', () => {
48
+ foundContent = true
210
49
  })
211
50
 
212
- if (variantSelector === selector) {
213
- return null
51
+ if (!foundContent) {
52
+ rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
214
53
  }
215
-
216
- return applyPseudoToMarker(variantSelector, peerMarker, state, (marker, selector) =>
217
- selector.trim().startsWith('~') ? `${marker}${selector}` : `${marker} ~ ${selector}`
218
- )
219
54
  })
220
- )
221
- }
222
- }
223
55
 
224
- export let directionVariants = ({ config, addVariant }) => {
225
- addVariant(
226
- 'ltr',
227
- transformAllSelectors(
228
- (selector) =>
229
- `[dir="ltr"] ${updateAllClasses(
230
- selector,
231
- (className) => `ltr${config('separator')}${className}`
232
- )}`
233
- )
234
- )
235
-
236
- addVariant(
237
- 'rtl',
238
- transformAllSelectors(
239
- (selector) =>
240
- `[dir="rtl"] ${updateAllClasses(
241
- selector,
242
- (className) => `rtl${config('separator')}${className}`
243
- )}`
244
- )
245
- )
246
- }
56
+ return '&::after'
57
+ })
58
+ },
59
+
60
+ pseudoClassVariants: ({ addVariant }) => {
61
+ let pseudoVariants = [
62
+ // Positional
63
+ ['first', ':first-child'],
64
+ ['last', ':last-child'],
65
+ ['only', ':only-child'],
66
+ ['odd', ':nth-child(odd)'],
67
+ ['even', ':nth-child(even)'],
68
+ 'first-of-type',
69
+ 'last-of-type',
70
+ 'only-of-type',
71
+
72
+ // State
73
+ 'visited',
74
+ 'target',
75
+ ['open', '[open]'],
76
+
77
+ // Forms
78
+ 'default',
79
+ 'checked',
80
+ 'indeterminate',
81
+ 'placeholder-shown',
82
+ 'autofill',
83
+ 'required',
84
+ 'valid',
85
+ 'invalid',
86
+ 'in-range',
87
+ 'out-of-range',
88
+ 'read-only',
89
+
90
+ // Content
91
+ 'empty',
92
+
93
+ // Interactive
94
+ 'focus-within',
95
+ 'hover',
96
+ 'focus',
97
+ 'focus-visible',
98
+ 'active',
99
+ 'disabled',
100
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
101
+
102
+ for (let [variantName, state] of pseudoVariants) {
103
+ addVariant(variantName, `&${state}`)
104
+ }
247
105
 
248
- export let reducedMotionVariants = ({ config, addVariant }) => {
249
- addVariant(
250
- 'motion-safe',
251
- transformLastClasses(
252
- (className) => {
253
- return `motion-safe${config('separator')}${className}`
254
- },
255
- {
256
- wrap: () =>
257
- postcss.atRule({
258
- name: 'media',
259
- params: '(prefers-reduced-motion: no-preference)',
260
- }),
261
- }
262
- )
263
- )
106
+ for (let [variantName, state] of pseudoVariants) {
107
+ addVariant(`group-${variantName}`, `:merge(.group)${state} &`)
108
+ }
264
109
 
265
- addVariant(
266
- 'motion-reduce',
267
- transformLastClasses(
268
- (className) => {
269
- return `motion-reduce${config('separator')}${className}`
270
- },
271
- {
272
- wrap: () =>
273
- postcss.atRule({
274
- name: 'media',
275
- params: '(prefers-reduced-motion: reduce)',
276
- }),
277
- }
278
- )
279
- )
280
- }
110
+ for (let [variantName, state] of pseudoVariants) {
111
+ addVariant(`peer-${variantName}`, `:merge(.peer)${state} ~ &`)
112
+ }
113
+ },
281
114
 
282
- export let darkVariants = ({ config, addVariant }) => {
283
- let mode = config('darkMode', 'media')
284
- if (mode === false) {
285
- mode = 'media'
286
- log.warn([
287
- '`darkMode` is set to `false` in your config.',
288
- 'This will behave just like the `media` value.',
289
- ])
290
- }
291
-
292
- if (mode === 'class') {
293
- addVariant(
294
- 'dark',
295
- transformAllSelectors((selector) => {
296
- let variantSelector = updateLastClasses(selector, (className) => {
297
- return `dark${config('separator')}${className}`
298
- })
115
+ directionVariants: ({ addVariant }) => {
116
+ addVariant('ltr', () => {
117
+ log.warn('rtl-experimental', [
118
+ 'The RTL features in Tailwind CSS are currently in preview.',
119
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
120
+ ])
299
121
 
300
- if (variantSelector === selector) {
301
- return null
302
- }
122
+ return '[dir="ltr"] &'
123
+ })
303
124
 
304
- let darkSelector = prefixSelector(config('prefix'), `.dark`)
125
+ addVariant('rtl', () => {
126
+ log.warn('rtl-experimental', [
127
+ 'The RTL features in Tailwind CSS are currently in preview.',
128
+ 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
129
+ ])
305
130
 
306
- return `${darkSelector} ${variantSelector}`
307
- })
308
- )
309
- } else if (mode === 'media') {
310
- addVariant(
311
- 'dark',
312
- transformLastClasses(
313
- (className) => {
314
- return `dark${config('separator')}${className}`
315
- },
316
- {
317
- wrap: () =>
318
- postcss.atRule({
319
- name: 'media',
320
- params: '(prefers-color-scheme: dark)',
321
- }),
322
- }
323
- )
324
- )
325
- }
326
- }
131
+ return '[dir="rtl"] &'
132
+ })
133
+ },
134
+
135
+ reducedMotionVariants: ({ addVariant }) => {
136
+ addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)')
137
+ addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)')
138
+ },
139
+
140
+ darkVariants: ({ config, addVariant }) => {
141
+ let mode = config('darkMode', 'media')
142
+ if (mode === false) {
143
+ mode = 'media'
144
+ log.warn('darkmode-false', [
145
+ 'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
146
+ 'Change `darkMode` to `media` or remove it entirely.',
147
+ ])
148
+ }
327
149
 
328
- export let screenVariants = ({ config, theme, addVariant }) => {
329
- for (let screen in theme('screens')) {
330
- let size = theme('screens')[screen]
331
- let query = buildMediaQuery(size)
150
+ if (mode === 'class') {
151
+ addVariant('dark', '.dark &')
152
+ } else if (mode === 'media') {
153
+ addVariant('dark', '@media (prefers-color-scheme: dark)')
154
+ }
155
+ },
332
156
 
333
- addVariant(
334
- screen,
335
- transformLastClasses(
336
- (className) => {
337
- return `${screen}${config('separator')}${className}`
338
- },
339
- { wrap: () => postcss.atRule({ name: 'media', params: query }) }
340
- )
341
- )
342
- }
343
- }
157
+ printVariant: ({ addVariant }) => {
158
+ addVariant('print', '@media print')
159
+ },
160
+
161
+ screenVariants: ({ theme, addVariant }) => {
162
+ for (let screen of normalizeScreens(theme('screens'))) {
163
+ let query = buildMediaQuery(screen)
344
164
 
345
- // Actual plugins
346
- export let preflight = ({ addBase }) => {
347
- let preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8'))
165
+ addVariant(screen.name, `@media ${query}`)
166
+ }
167
+ },
348
168
 
349
- addBase([
350
- postcss.comment({
351
- text: `! tailwindcss v${packageJson.version} | MIT License | https://tailwindcss.com`,
352
- }),
353
- ...preflightStyles.nodes,
354
- ])
169
+ orientationVariants: ({ addVariant }) => {
170
+ addVariant('portrait', '@media (orientation: portrait)')
171
+ addVariant('landscape', '@media (orientation: landscape)')
172
+ },
355
173
  }
356
174
 
357
- export let container = (() => {
358
- function extractMinWidths(breakpoints) {
359
- return Object.values(breakpoints ?? {}).flatMap((breakpoints) => {
360
- if (typeof breakpoints === 'string') {
361
- breakpoints = { min: breakpoints }
362
- }
175
+ export let corePlugins = {
176
+ preflight: ({ addBase }) => {
177
+ let preflightStyles = postcss.parse(
178
+ fs.readFileSync(path.join(__dirname, './css/preflight.css'), 'utf8')
179
+ )
363
180
 
364
- if (!Array.isArray(breakpoints)) {
365
- breakpoints = [breakpoints]
366
- }
181
+ addBase([
182
+ postcss.comment({
183
+ text: `! tailwindcss v${tailwindVersion} | MIT License | https://tailwindcss.com`,
184
+ }),
185
+ ...preflightStyles.nodes,
186
+ ])
187
+ },
367
188
 
189
+ container: (() => {
190
+ function extractMinWidths(breakpoints = []) {
368
191
  return breakpoints
369
- .filter((breakpoint) => {
370
- return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
371
- })
372
- .map((breakpoint) => {
373
- return breakpoint['min-width'] ?? breakpoint.min
374
- })
375
- })
376
- }
377
-
378
- function mapMinWidthsToPadding(minWidths, screens, paddings) {
379
- if (typeof paddings === 'undefined') {
380
- return []
192
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
193
+ .filter((v) => v !== undefined)
381
194
  }
382
195
 
383
- if (!(typeof paddings === 'object' && paddings !== null)) {
384
- return [
385
- {
386
- screen: 'DEFAULT',
387
- minWidth: 0,
388
- padding: paddings,
389
- },
390
- ]
391
- }
196
+ function mapMinWidthsToPadding(minWidths, screens, paddings) {
197
+ if (typeof paddings === 'undefined') {
198
+ return []
199
+ }
392
200
 
393
- let mapping = []
201
+ if (!(typeof paddings === 'object' && paddings !== null)) {
202
+ return [
203
+ {
204
+ screen: 'DEFAULT',
205
+ minWidth: 0,
206
+ padding: paddings,
207
+ },
208
+ ]
209
+ }
394
210
 
395
- if (paddings.DEFAULT) {
396
- mapping.push({
397
- screen: 'DEFAULT',
398
- minWidth: 0,
399
- padding: paddings.DEFAULT,
400
- })
401
- }
211
+ let mapping = []
402
212
 
403
- for (let minWidth of minWidths) {
404
- for (let [screen, value] of Object.entries(screens)) {
405
- let screenMinWidth =
406
- typeof value === 'object' && value !== null ? value.min || value['min-width'] : value
213
+ if (paddings.DEFAULT) {
214
+ mapping.push({
215
+ screen: 'DEFAULT',
216
+ minWidth: 0,
217
+ padding: paddings.DEFAULT,
218
+ })
219
+ }
407
220
 
408
- if (`${screenMinWidth}` === `${minWidth}`) {
409
- mapping.push({
410
- screen,
411
- minWidth,
412
- padding: paddings[screen],
413
- })
221
+ for (let minWidth of minWidths) {
222
+ for (let screen of screens) {
223
+ for (let { min } of screen.values) {
224
+ if (min === minWidth) {
225
+ mapping.push({ minWidth, padding: paddings[screen.name] })
226
+ }
227
+ }
414
228
  }
415
229
  }
230
+
231
+ return mapping
416
232
  }
417
233
 
418
- return mapping
419
- }
234
+ return function ({ addComponents, theme }) {
235
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
236
+ let minWidths = extractMinWidths(screens)
237
+ let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
420
238
 
421
- return function ({ addComponents, theme }) {
422
- let screens = theme('container.screens', theme('screens'))
423
- let minWidths = extractMinWidths(screens)
424
- let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
239
+ let generatePaddingFor = (minWidth) => {
240
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
425
241
 
426
- let generatePaddingFor = (minWidth) => {
427
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
242
+ if (!paddingConfig) {
243
+ return {}
244
+ }
428
245
 
429
- if (!paddingConfig) {
430
- return {}
246
+ return {
247
+ paddingRight: paddingConfig.padding,
248
+ paddingLeft: paddingConfig.padding,
249
+ }
431
250
  }
432
251
 
433
- return {
434
- paddingRight: paddingConfig.padding,
435
- paddingLeft: paddingConfig.padding,
436
- }
437
- }
252
+ let atRules = Array.from(
253
+ new Set(minWidths.slice().sort((a, z) => parseInt(a) - parseInt(z)))
254
+ ).map((minWidth) => ({
255
+ [`@media (min-width: ${minWidth})`]: {
256
+ '.container': {
257
+ 'max-width': minWidth,
258
+ ...generatePaddingFor(minWidth),
259
+ },
260
+ },
261
+ }))
438
262
 
439
- let atRules = Array.from(
440
- new Set(minWidths.slice().sort((a, z) => parseInt(a) - parseInt(z)))
441
- ).map((minWidth) => ({
442
- [`@media (min-width: ${minWidth})`]: {
443
- '.container': {
444
- 'max-width': minWidth,
445
- ...generatePaddingFor(minWidth),
263
+ addComponents([
264
+ {
265
+ '.container': Object.assign(
266
+ { width: '100%' },
267
+ theme('container.center', false) ? { marginRight: 'auto', marginLeft: 'auto' } : {},
268
+ generatePaddingFor(0)
269
+ ),
446
270
  },
271
+ ...atRules,
272
+ ])
273
+ }
274
+ })(),
275
+
276
+ accessibility: ({ addUtilities }) => {
277
+ addUtilities({
278
+ '.sr-only': {
279
+ position: 'absolute',
280
+ width: '1px',
281
+ height: '1px',
282
+ padding: '0',
283
+ margin: '-1px',
284
+ overflow: 'hidden',
285
+ clip: 'rect(0, 0, 0, 0)',
286
+ whiteSpace: 'nowrap',
287
+ borderWidth: '0',
447
288
  },
448
- }))
449
-
450
- addComponents([
451
- {
452
- '.container': Object.assign(
453
- { width: '100%' },
454
- theme('container.center', false) ? { marginRight: 'auto', marginLeft: 'auto' } : {},
455
- generatePaddingFor(0)
456
- ),
289
+ '.not-sr-only': {
290
+ position: 'static',
291
+ width: 'auto',
292
+ height: 'auto',
293
+ padding: '0',
294
+ margin: '0',
295
+ overflow: 'visible',
296
+ clip: 'auto',
297
+ whiteSpace: 'normal',
457
298
  },
458
- ...atRules,
459
- ])
460
- }
461
- })()
462
-
463
- export let accessibility = ({ addUtilities }) => {
464
- addUtilities({
465
- '.sr-only': {
466
- position: 'absolute',
467
- width: '1px',
468
- height: '1px',
469
- padding: '0',
470
- margin: '-1px',
471
- overflow: 'hidden',
472
- clip: 'rect(0, 0, 0, 0)',
473
- whiteSpace: 'nowrap',
474
- borderWidth: '0',
475
- },
476
- '.not-sr-only': {
477
- position: 'static',
478
- width: 'auto',
479
- height: 'auto',
480
- padding: '0',
481
- margin: '0',
482
- overflow: 'visible',
483
- clip: 'auto',
484
- whiteSpace: 'normal',
485
- },
486
- })
487
- }
488
-
489
- export let pointerEvents = ({ addUtilities }) => {
490
- addUtilities({
491
- '.pointer-events-none': { 'pointer-events': 'none' },
492
- '.pointer-events-auto': { 'pointer-events': 'auto' },
493
- })
494
- }
495
-
496
- export let visibility = ({ addUtilities }) => {
497
- addUtilities({
498
- '.visible': { visibility: 'visible' },
499
- '.invisible': { visibility: 'hidden' },
500
- })
501
- }
502
-
503
- export let position = ({ addUtilities }) => {
504
- addUtilities({
505
- '.static': { position: 'static' },
506
- '.fixed': { position: 'fixed' },
507
- '.absolute': { position: 'absolute' },
508
- '.relative': { position: 'relative' },
509
- '.sticky': { position: 'sticky' },
510
- })
511
- }
512
-
513
- export let inset = ({ matchUtilities, theme }) => {
514
- let options = {
515
- values: theme('inset'),
516
- type: 'any',
517
- }
518
-
519
- matchUtilities(
520
- { inset: (value) => ({ top: value, right: value, bottom: value, left: value }) },
521
- options
522
- )
523
-
524
- matchUtilities(
525
- {
526
- 'inset-x': (value) => ({ left: value, right: value }),
527
- 'inset-y': (value) => ({ top: value, bottom: value }),
528
- },
529
- options
530
- )
531
-
532
- matchUtilities(
533
- {
534
- top: (top) => ({ top }),
535
- right: (right) => ({ right }),
536
- bottom: (bottom) => ({ bottom }),
537
- left: (left) => ({ left }),
538
- },
539
- options
540
- )
541
- }
299
+ })
300
+ },
542
301
 
543
- export let isolation = ({ addUtilities }) => {
544
- addUtilities({
545
- '.isolate': { isolation: 'isolate' },
546
- '.isolation-auto': { isolation: 'auto' },
547
- })
548
- }
302
+ pointerEvents: ({ addUtilities }) => {
303
+ addUtilities({
304
+ '.pointer-events-none': { 'pointer-events': 'none' },
305
+ '.pointer-events-auto': { 'pointer-events': 'auto' },
306
+ })
307
+ },
549
308
 
550
- export let zIndex = createUtilityPlugin('zIndex', [['z', ['zIndex']]])
551
- export let order = createUtilityPlugin('order')
552
- export let gridColumn = createUtilityPlugin('gridColumn', [['col', ['gridColumn']]])
553
- export let gridColumnStart = createUtilityPlugin('gridColumnStart', [
554
- ['col-start', ['gridColumnStart']],
555
- ])
556
- export let gridColumnEnd = createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]])
557
- export let gridRow = createUtilityPlugin('gridRow', [['row', ['gridRow']]])
558
- export let gridRowStart = createUtilityPlugin('gridRowStart', [['row-start', ['gridRowStart']]])
559
- export let gridRowEnd = createUtilityPlugin('gridRowEnd', [['row-end', ['gridRowEnd']]])
560
-
561
- export let float = ({ addUtilities }) => {
562
- addUtilities({
563
- '.float-right': { float: 'right' },
564
- '.float-left': { float: 'left' },
565
- '.float-none': { float: 'none' },
566
- })
567
- }
309
+ visibility: ({ addUtilities }) => {
310
+ addUtilities({
311
+ '.visible': { visibility: 'visible' },
312
+ '.invisible': { visibility: 'hidden' },
313
+ })
314
+ },
315
+
316
+ position: ({ addUtilities }) => {
317
+ addUtilities({
318
+ '.static': { position: 'static' },
319
+ '.fixed': { position: 'fixed' },
320
+ '.absolute': { position: 'absolute' },
321
+ '.relative': { position: 'relative' },
322
+ '.sticky': { position: 'sticky' },
323
+ })
324
+ },
568
325
 
569
- export let clear = ({ addUtilities }) => {
570
- addUtilities({
571
- '.clear-left': { clear: 'left' },
572
- '.clear-right': { clear: 'right' },
573
- '.clear-both': { clear: 'both' },
574
- '.clear-none': { clear: 'none' },
575
- })
576
- }
326
+ inset: createUtilityPlugin(
327
+ 'inset',
328
+ [
329
+ ['inset', ['top', 'right', 'bottom', 'left']],
330
+ [
331
+ ['inset-x', ['left', 'right']],
332
+ ['inset-y', ['top', 'bottom']],
333
+ ],
334
+ [
335
+ ['top', ['top']],
336
+ ['right', ['right']],
337
+ ['bottom', ['bottom']],
338
+ ['left', ['left']],
339
+ ],
340
+ ],
341
+ { supportsNegativeValues: true }
342
+ ),
577
343
 
578
- export let margin = createUtilityPlugin('margin', [
579
- ['m', ['margin']],
580
- [
581
- ['mx', ['margin-left', 'margin-right']],
582
- ['my', ['margin-top', 'margin-bottom']],
583
- ],
584
- [
585
- ['mt', ['margin-top']],
586
- ['mr', ['margin-right']],
587
- ['mb', ['margin-bottom']],
588
- ['ml', ['margin-left']],
589
- ],
590
- ])
591
-
592
- export let boxSizing = ({ addUtilities }) => {
593
- addUtilities({
594
- '.box-border': { 'box-sizing': 'border-box' },
595
- '.box-content': { 'box-sizing': 'content-box' },
596
- })
597
- }
344
+ isolation: ({ addUtilities }) => {
345
+ addUtilities({
346
+ '.isolate': { isolation: 'isolate' },
347
+ '.isolation-auto': { isolation: 'auto' },
348
+ })
349
+ },
350
+
351
+ zIndex: createUtilityPlugin('zIndex', [['z', ['zIndex']]], { supportsNegativeValues: true }),
352
+ order: createUtilityPlugin('order', undefined, { supportsNegativeValues: true }),
353
+ gridColumn: createUtilityPlugin('gridColumn', [['col', ['gridColumn']]]),
354
+ gridColumnStart: createUtilityPlugin('gridColumnStart', [['col-start', ['gridColumnStart']]]),
355
+ gridColumnEnd: createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]]),
356
+ gridRow: createUtilityPlugin('gridRow', [['row', ['gridRow']]]),
357
+ gridRowStart: createUtilityPlugin('gridRowStart', [['row-start', ['gridRowStart']]]),
358
+ gridRowEnd: createUtilityPlugin('gridRowEnd', [['row-end', ['gridRowEnd']]]),
359
+
360
+ float: ({ addUtilities }) => {
361
+ addUtilities({
362
+ '.float-right': { float: 'right' },
363
+ '.float-left': { float: 'left' },
364
+ '.float-none': { float: 'none' },
365
+ })
366
+ },
367
+
368
+ clear: ({ addUtilities }) => {
369
+ addUtilities({
370
+ '.clear-left': { clear: 'left' },
371
+ '.clear-right': { clear: 'right' },
372
+ '.clear-both': { clear: 'both' },
373
+ '.clear-none': { clear: 'none' },
374
+ })
375
+ },
598
376
 
599
- export let display = ({ addUtilities }) => {
600
- addUtilities({
601
- '.block': { display: 'block' },
602
- '.inline-block': { display: 'inline-block' },
603
- '.inline': { display: 'inline' },
604
- '.flex': { display: 'flex' },
605
- '.inline-flex': { display: 'inline-flex' },
606
- '.table': { display: 'table' },
607
- '.inline-table': { display: 'inline-table' },
608
- '.table-caption': { display: 'table-caption' },
609
- '.table-cell': { display: 'table-cell' },
610
- '.table-column': { display: 'table-column' },
611
- '.table-column-group': { display: 'table-column-group' },
612
- '.table-footer-group': { display: 'table-footer-group' },
613
- '.table-header-group': { display: 'table-header-group' },
614
- '.table-row-group': { display: 'table-row-group' },
615
- '.table-row': { display: 'table-row' },
616
- '.flow-root': { display: 'flow-root' },
617
- '.grid': { display: 'grid' },
618
- '.inline-grid': { display: 'inline-grid' },
619
- '.contents': { display: 'contents' },
620
- '.list-item': { display: 'list-item' },
621
- '.hidden': { display: 'none' },
622
- })
623
- }
377
+ margin: createUtilityPlugin(
378
+ 'margin',
379
+ [
380
+ ['m', ['margin']],
381
+ [
382
+ ['mx', ['margin-left', 'margin-right']],
383
+ ['my', ['margin-top', 'margin-bottom']],
384
+ ],
385
+ [
386
+ ['mt', ['margin-top']],
387
+ ['mr', ['margin-right']],
388
+ ['mb', ['margin-bottom']],
389
+ ['ml', ['margin-left']],
390
+ ],
391
+ ],
392
+ { supportsNegativeValues: true }
393
+ ),
624
394
 
625
- export let aspectRatio = createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]])
626
- export let height = createUtilityPlugin('height', [['h', ['height']]])
627
- export let maxHeight = createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]])
628
- export let minHeight = createUtilityPlugin('minHeight', [['min-h', ['minHeight']]])
629
- export let width = createUtilityPlugin('width', [['w', ['width']]])
630
- export let minWidth = createUtilityPlugin('minWidth', [['min-w', ['minWidth']]])
631
- export let maxWidth = createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]])
632
- export let flex = createUtilityPlugin('flex')
633
- export let flexShrink = createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]])
634
- export let flexGrow = createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]])
635
-
636
- export let tableLayout = ({ addUtilities }) => {
637
- addUtilities({
638
- '.table-auto': { 'table-layout': 'auto' },
639
- '.table-fixed': { 'table-layout': 'fixed' },
640
- })
641
- }
395
+ boxSizing: ({ addUtilities }) => {
396
+ addUtilities({
397
+ '.box-border': { 'box-sizing': 'border-box' },
398
+ '.box-content': { 'box-sizing': 'content-box' },
399
+ })
400
+ },
401
+
402
+ display: ({ addUtilities }) => {
403
+ addUtilities({
404
+ '.block': { display: 'block' },
405
+ '.inline-block': { display: 'inline-block' },
406
+ '.inline': { display: 'inline' },
407
+ '.flex': { display: 'flex' },
408
+ '.inline-flex': { display: 'inline-flex' },
409
+ '.table': { display: 'table' },
410
+ '.inline-table': { display: 'inline-table' },
411
+ '.table-caption': { display: 'table-caption' },
412
+ '.table-cell': { display: 'table-cell' },
413
+ '.table-column': { display: 'table-column' },
414
+ '.table-column-group': { display: 'table-column-group' },
415
+ '.table-footer-group': { display: 'table-footer-group' },
416
+ '.table-header-group': { display: 'table-header-group' },
417
+ '.table-row-group': { display: 'table-row-group' },
418
+ '.table-row': { display: 'table-row' },
419
+ '.flow-root': { display: 'flow-root' },
420
+ '.grid': { display: 'grid' },
421
+ '.inline-grid': { display: 'inline-grid' },
422
+ '.contents': { display: 'contents' },
423
+ '.list-item': { display: 'list-item' },
424
+ '.hidden': { display: 'none' },
425
+ })
426
+ },
427
+
428
+ aspectRatio: createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]]),
429
+
430
+ height: createUtilityPlugin('height', [['h', ['height']]]),
431
+ maxHeight: createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]]),
432
+ minHeight: createUtilityPlugin('minHeight', [['min-h', ['minHeight']]]),
433
+
434
+ width: createUtilityPlugin('width', [['w', ['width']]]),
435
+ minWidth: createUtilityPlugin('minWidth', [['min-w', ['minWidth']]]),
436
+ maxWidth: createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]]),
437
+
438
+ flex: createUtilityPlugin('flex'),
439
+ flexShrink: createUtilityPlugin('flexShrink', [
440
+ ['flex-shrink', ['flex-shrink']], // Deprecated
441
+ ['shrink', ['flex-shrink']],
442
+ ]),
443
+ flexGrow: createUtilityPlugin('flexGrow', [
444
+ ['flex-grow', ['flex-grow']], // Deprecated
445
+ ['grow', ['flex-grow']],
446
+ ]),
447
+ flexBasis: createUtilityPlugin('flexBasis', [['basis', ['flex-basis']]]),
448
+
449
+ tableLayout: ({ addUtilities }) => {
450
+ addUtilities({
451
+ '.table-auto': { 'table-layout': 'auto' },
452
+ '.table-fixed': { 'table-layout': 'fixed' },
453
+ })
454
+ },
642
455
 
643
- export let borderCollapse = ({ addUtilities }) => {
644
- addUtilities({
645
- '.border-collapse': { 'border-collapse': 'collapse' },
646
- '.border-separate': { 'border-collapse': 'separate' },
647
- })
648
- }
456
+ borderCollapse: ({ addUtilities }) => {
457
+ addUtilities({
458
+ '.border-collapse': { 'border-collapse': 'collapse' },
459
+ '.border-separate': { 'border-collapse': 'separate' },
460
+ })
461
+ },
649
462
 
650
- export let transformOrigin = createUtilityPlugin('transformOrigin', [
651
- ['origin', ['transformOrigin']],
652
- ])
653
- export let translate = createUtilityPlugin('translate', [
654
- [
655
- [
656
- 'translate-x',
657
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
658
- ],
463
+ transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
464
+ translate: createUtilityPlugin(
465
+ 'translate',
659
466
  [
660
- 'translate-y',
661
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
467
+ [
468
+ [
469
+ 'translate-x',
470
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
471
+ ],
472
+ [
473
+ 'translate-y',
474
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
475
+ ],
476
+ ],
662
477
  ],
663
- ],
664
- ])
665
- export let rotate = createUtilityPlugin('rotate', [
666
- ['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']]],
667
- ])
668
- export let skew = createUtilityPlugin('skew', [
669
- [
670
- ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']]],
671
- ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']]],
672
- ],
673
- ])
674
- export let scale = createUtilityPlugin('scale', [
675
- [
676
- 'scale',
478
+ { supportsNegativeValues: true }
479
+ ),
480
+ rotate: createUtilityPlugin(
481
+ 'rotate',
677
482
  [
678
- ['@defaults transform', {}],
679
- '--tw-scale-x',
680
- '--tw-scale-y',
681
- ['transform', 'var(--tw-transform)'],
483
+ [
484
+ 'rotate',
485
+ [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
486
+ ],
682
487
  ],
683
- ],
684
- [
488
+ { supportsNegativeValues: true }
489
+ ),
490
+ skew: createUtilityPlugin(
491
+ 'skew',
685
492
  [
686
- 'scale-x',
687
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
493
+ [
494
+ [
495
+ 'skew-x',
496
+ [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
497
+ ],
498
+ [
499
+ 'skew-y',
500
+ [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
501
+ ],
502
+ ],
688
503
  ],
504
+ { supportsNegativeValues: true }
505
+ ),
506
+ scale: createUtilityPlugin(
507
+ 'scale',
689
508
  [
690
- 'scale-y',
691
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
509
+ [
510
+ 'scale',
511
+ [
512
+ ['@defaults transform', {}],
513
+ '--tw-scale-x',
514
+ '--tw-scale-y',
515
+ ['transform', 'var(--tw-transform)'],
516
+ ],
517
+ ],
518
+ [
519
+ [
520
+ 'scale-x',
521
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
522
+ ],
523
+ [
524
+ 'scale-y',
525
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
526
+ ],
527
+ ],
692
528
  ],
693
- ],
694
- ])
695
-
696
- export let transform = ({ addBase, addUtilities }) => {
697
- addBase({
698
- '@defaults transform': {
699
- '--tw-translate-x': '0',
700
- '--tw-translate-y': '0',
701
- '--tw-rotate': '0',
702
- '--tw-skew-x': '0',
703
- '--tw-skew-y': '0',
704
- '--tw-scale-x': '1',
705
- '--tw-scale-y': '1',
706
- '--tw-transform': [
707
- 'translateX(var(--tw-translate-x))',
708
- 'translateY(var(--tw-translate-y))',
709
- 'rotate(var(--tw-rotate))',
710
- 'skewX(var(--tw-skew-x))',
711
- 'skewY(var(--tw-skew-y))',
712
- 'scaleX(var(--tw-scale-x))',
713
- 'scaleY(var(--tw-scale-y))',
714
- ].join(' '),
715
- },
716
- })
717
- addUtilities({
718
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
719
- '.transform-cpu': {
720
- '--tw-transform': [
721
- 'translateX(var(--tw-translate-x))',
722
- 'translateY(var(--tw-translate-y))',
723
- 'rotate(var(--tw-rotate))',
724
- 'skewX(var(--tw-skew-x))',
725
- 'skewY(var(--tw-skew-y))',
726
- 'scaleX(var(--tw-scale-x))',
727
- 'scaleY(var(--tw-scale-y))',
728
- ].join(' '),
729
- },
730
- '.transform-gpu': {
731
- '--tw-transform': [
732
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
733
- 'rotate(var(--tw-rotate))',
734
- 'skewX(var(--tw-skew-x))',
735
- 'skewY(var(--tw-skew-y))',
736
- 'scaleX(var(--tw-scale-x))',
737
- 'scaleY(var(--tw-scale-y))',
738
- ].join(' '),
739
- },
740
- '.transform-none': { transform: 'none' },
741
- })
742
- }
529
+ { supportsNegativeValues: true }
530
+ ),
743
531
 
744
- export let animation = ({ matchUtilities, theme, prefix }) => {
745
- let prefixName = (name) => prefix(`.${name}`).slice(1)
746
- let keyframes = Object.fromEntries(
747
- Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
748
- return [key, [{ [`@keyframes ${prefixName(key)}`]: value }]]
532
+ transform: ({ addBase, addUtilities }) => {
533
+ addBase({
534
+ '@defaults transform': {
535
+ '--tw-translate-x': '0',
536
+ '--tw-translate-y': '0',
537
+ '--tw-rotate': '0',
538
+ '--tw-skew-x': '0',
539
+ '--tw-skew-y': '0',
540
+ '--tw-scale-x': '1',
541
+ '--tw-scale-y': '1',
542
+ '--tw-transform': [
543
+ 'translateX(var(--tw-translate-x))',
544
+ 'translateY(var(--tw-translate-y))',
545
+ 'rotate(var(--tw-rotate))',
546
+ 'skewX(var(--tw-skew-x))',
547
+ 'skewY(var(--tw-skew-y))',
548
+ 'scaleX(var(--tw-scale-x))',
549
+ 'scaleY(var(--tw-scale-y))',
550
+ ].join(' '),
551
+ },
552
+ })
553
+ addUtilities({
554
+ '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
555
+ '.transform-cpu': {
556
+ '--tw-transform': [
557
+ 'translateX(var(--tw-translate-x))',
558
+ 'translateY(var(--tw-translate-y))',
559
+ 'rotate(var(--tw-rotate))',
560
+ 'skewX(var(--tw-skew-x))',
561
+ 'skewY(var(--tw-skew-y))',
562
+ 'scaleX(var(--tw-scale-x))',
563
+ 'scaleY(var(--tw-scale-y))',
564
+ ].join(' '),
565
+ },
566
+ '.transform-gpu': {
567
+ '--tw-transform': [
568
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
569
+ 'rotate(var(--tw-rotate))',
570
+ 'skewX(var(--tw-skew-x))',
571
+ 'skewY(var(--tw-skew-y))',
572
+ 'scaleX(var(--tw-scale-x))',
573
+ 'scaleY(var(--tw-scale-y))',
574
+ ].join(' '),
575
+ },
576
+ '.transform-none': { transform: 'none' },
749
577
  })
750
- )
578
+ },
751
579
 
752
- matchUtilities(
753
- {
754
- animate: (value, { includeRules }) => {
755
- let animations = parseAnimationValue(value)
580
+ animation: ({ matchUtilities, theme, prefix }) => {
581
+ let prefixName = (name) => prefix(`.${name}`).slice(1)
582
+ let keyframes = Object.fromEntries(
583
+ Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
584
+ return [key, { [`@keyframes ${prefixName(key)}`]: value }]
585
+ })
586
+ )
756
587
 
757
- for (let { name } of animations) {
758
- if (keyframes[name] !== undefined) {
759
- includeRules(keyframes[name], { respectImportant: false })
760
- }
761
- }
588
+ matchUtilities(
589
+ {
590
+ animate: (value) => {
591
+ let animations = parseAnimationValue(value)
592
+
593
+ return [
594
+ ...animations.flatMap((animation) => keyframes[animation.name]),
595
+ {
596
+ animation: animations
597
+ .map(({ name, value }) => {
598
+ if (name === undefined || keyframes[name] === undefined) {
599
+ return value
600
+ }
601
+ return value.replace(name, prefixName(name))
602
+ })
603
+ .join(', '),
604
+ },
605
+ ]
606
+ },
607
+ },
608
+ { values: theme('animation') }
609
+ )
610
+ },
762
611
 
763
- return {
764
- animation: animations
765
- .map(({ name, value }) => {
766
- if (name === undefined || keyframes[name] === undefined) {
767
- return value
768
- }
769
- return value.replace(name, prefixName(name))
770
- })
771
- .join(', '),
772
- }
612
+ cursor: createUtilityPlugin('cursor'),
613
+
614
+ touchAction: ({ addBase, addUtilities }) => {
615
+ addBase({
616
+ '@defaults touch-action': {
617
+ '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
618
+ '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
619
+ '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
620
+ '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
773
621
  },
774
- },
775
- { values: theme('animation') }
776
- )
777
- }
622
+ })
778
623
 
779
- export let cursor = createUtilityPlugin('cursor')
624
+ addUtilities({
625
+ '.touch-auto': { 'touch-action': 'auto' },
626
+ '.touch-none': { 'touch-action': 'none' },
627
+ '.touch-pan-x': {
628
+ '@defaults touch-action': {},
629
+ '--tw-pan-x': 'pan-x',
630
+ 'touch-action': 'var(--tw-touch-action)',
631
+ },
632
+ '.touch-pan-left': {
633
+ '@defaults touch-action': {},
634
+ '--tw-pan-x': 'pan-left',
635
+ 'touch-action': 'var(--tw-touch-action)',
636
+ },
637
+ '.touch-pan-right': {
638
+ '@defaults touch-action': {},
639
+ '--tw-pan-x': 'pan-right',
640
+ 'touch-action': 'var(--tw-touch-action)',
641
+ },
642
+ '.touch-pan-y': {
643
+ '@defaults touch-action': {},
644
+ '--tw-pan-y': 'pan-y',
645
+ 'touch-action': 'var(--tw-touch-action)',
646
+ },
647
+ '.touch-pan-up': {
648
+ '@defaults touch-action': {},
649
+ '--tw-pan-y': 'pan-up',
650
+ 'touch-action': 'var(--tw-touch-action)',
651
+ },
652
+ '.touch-pan-down': {
653
+ '@defaults touch-action': {},
654
+ '--tw-pan-y': 'pan-down',
655
+ 'touch-action': 'var(--tw-touch-action)',
656
+ },
657
+ '.touch-pinch-zoom': {
658
+ '@defaults touch-action': {},
659
+ '--tw-pinch-zoom': 'pinch-zoom',
660
+ 'touch-action': 'var(--tw-touch-action)',
661
+ },
662
+ '.touch-manipulation': { 'touch-action': 'manipulation' },
663
+ })
664
+ },
665
+
666
+ userSelect: ({ addUtilities }) => {
667
+ addUtilities({
668
+ '.select-none': { 'user-select': 'none' },
669
+ '.select-text': { 'user-select': 'text' },
670
+ '.select-all': { 'user-select': 'all' },
671
+ '.select-auto': { 'user-select': 'auto' },
672
+ })
673
+ },
674
+
675
+ resize: ({ addUtilities }) => {
676
+ addUtilities({
677
+ '.resize-none': { resize: 'none' },
678
+ '.resize-y': { resize: 'vertical' },
679
+ '.resize-x': { resize: 'horizontal' },
680
+ '.resize': { resize: 'both' },
681
+ })
682
+ },
780
683
 
781
- export let userSelect = ({ addUtilities }) => {
782
- addUtilities({
783
- '.select-none': { 'user-select': 'none' },
784
- '.select-text': { 'user-select': 'text' },
785
- '.select-all': { 'user-select': 'all' },
786
- '.select-auto': { 'user-select': 'auto' },
787
- })
788
- }
684
+ scrollSnapType: ({ addUtilities, addBase }) => {
685
+ addBase({
686
+ '@defaults scroll-snap-type': {
687
+ '--tw-scroll-snap-strictness': 'proximity',
688
+ },
689
+ })
789
690
 
790
- export let resize = ({ addUtilities }) => {
791
- addUtilities({
792
- '.resize-none': { resize: 'none' },
793
- '.resize-y': { resize: 'vertical' },
794
- '.resize-x': { resize: 'horizontal' },
795
- '.resize': { resize: 'both' },
796
- })
797
- }
691
+ addUtilities({
692
+ '.snap-none': { 'scroll-snap-type': 'none' },
693
+ '.snap-x': {
694
+ '@defaults scroll-snap-type': {},
695
+ 'scroll-snap-type': 'x var(--tw-scroll-snap-strictness)',
696
+ },
697
+ '.snap-y': {
698
+ '@defaults scroll-snap-type': {},
699
+ 'scroll-snap-type': 'y var(--tw-scroll-snap-strictness)',
700
+ },
701
+ '.snap-both': {
702
+ '@defaults scroll-snap-type': {},
703
+ 'scroll-snap-type': 'both var(--tw-scroll-snap-strictness)',
704
+ },
705
+ '.snap-mandatory': { '--tw-scroll-snap-strictness': 'mandatory' },
706
+ '.snap-proximity': { '--tw-scroll-snap-strictness': 'proximity' },
707
+ })
708
+ },
709
+
710
+ scrollSnapAlign: ({ addUtilities }) => {
711
+ addUtilities({
712
+ '.snap-start': { 'scroll-snap-align': 'start' },
713
+ '.snap-end': { 'scroll-snap-align': 'end' },
714
+ '.snap-center': { 'scroll-snap-align': 'center' },
715
+ '.snap-align-none': { 'scroll-snap-align': 'none' },
716
+ })
717
+ },
798
718
 
799
- export let listStylePosition = ({ addUtilities }) => {
800
- addUtilities({
801
- '.list-inside': { 'list-style-position': 'inside' },
802
- '.list-outside': { 'list-style-position': 'outside' },
803
- })
804
- }
719
+ scrollSnapStop: ({ addUtilities }) => {
720
+ addUtilities({
721
+ '.snap-normal': { 'scroll-snap-stop': 'normal' },
722
+ '.snap-always': { 'scroll-snap-stop': 'always' },
723
+ })
724
+ },
805
725
 
806
- export let listStyleType = createUtilityPlugin('listStyleType', [['list', ['listStyleType']]])
726
+ scrollMargin: createUtilityPlugin(
727
+ 'scrollMargin',
728
+ [
729
+ ['scroll-m', ['scroll-margin']],
730
+ [
731
+ ['scroll-mx', ['scroll-margin-left', 'scroll-margin-right']],
732
+ ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
733
+ ],
734
+ [
735
+ ['scroll-mt', ['scroll-margin-top']],
736
+ ['scroll-mr', ['scroll-margin-right']],
737
+ ['scroll-mb', ['scroll-margin-bottom']],
738
+ ['scroll-ml', ['scroll-margin-left']],
739
+ ],
740
+ ],
741
+ { supportsNegativeValues: true }
742
+ ),
807
743
 
808
- export let appearance = ({ addUtilities }) => {
809
- addUtilities({
810
- '.appearance-none': { appearance: 'none' },
811
- })
812
- }
744
+ scrollPadding: createUtilityPlugin('scrollPadding', [
745
+ ['scroll-p', ['scroll-padding']],
746
+ [
747
+ ['scroll-px', ['scroll-padding-left', 'scroll-padding-right']],
748
+ ['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
749
+ ],
750
+ [
751
+ ['scroll-pt', ['scroll-padding-top']],
752
+ ['scroll-pr', ['scroll-padding-right']],
753
+ ['scroll-pb', ['scroll-padding-bottom']],
754
+ ['scroll-pl', ['scroll-padding-left']],
755
+ ],
756
+ ]),
813
757
 
814
- export let columns = createUtilityPlugin('columns', [['columns', ['columns']]])
758
+ listStylePosition: ({ addUtilities }) => {
759
+ addUtilities({
760
+ '.list-inside': { 'list-style-position': 'inside' },
761
+ '.list-outside': { 'list-style-position': 'outside' },
762
+ })
763
+ },
815
764
 
816
- export let gridAutoColumns = createUtilityPlugin('gridAutoColumns', [
817
- ['auto-cols', ['gridAutoColumns']],
818
- ])
765
+ listStyleType: createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]),
819
766
 
820
- export let gridAutoFlow = ({ addUtilities }) => {
821
- addUtilities({
822
- '.grid-flow-row': { gridAutoFlow: 'row' },
823
- '.grid-flow-col': { gridAutoFlow: 'column' },
824
- '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
825
- '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
826
- })
827
- }
767
+ appearance: ({ addUtilities }) => {
768
+ addUtilities({
769
+ '.appearance-none': { appearance: 'none' },
770
+ })
771
+ },
772
+
773
+ columns: createUtilityPlugin('columns', [['columns', ['columns']]]),
774
+
775
+ breakBefore: ({ addUtilities }) => {
776
+ addUtilities({
777
+ '.break-before-auto': { 'break-before': 'auto' },
778
+ '.break-before-avoid': { 'break-before': 'avoid' },
779
+ '.break-before-all': { 'break-before': 'all' },
780
+ '.break-before-avoid-page': { 'break-before': 'avoid-page' },
781
+ '.break-before-page': { 'break-before': 'page' },
782
+ '.break-before-left': { 'break-before': 'left' },
783
+ '.break-before-right': { 'break-before': 'right' },
784
+ '.break-before-column': { 'break-before': 'column' },
785
+ })
786
+ },
787
+
788
+ breakInside: ({ addUtilities }) => {
789
+ addUtilities({
790
+ '.break-inside-auto': { 'break-inside': 'auto' },
791
+ '.break-inside-avoid': { 'break-inside': 'avoid' },
792
+ '.break-inside-avoid-page': { 'break-inside': 'avoid-page' },
793
+ '.break-inside-avoid-column': { 'break-inside': 'avoid-column' },
794
+ })
795
+ },
796
+
797
+ breakAfter: ({ addUtilities }) => {
798
+ addUtilities({
799
+ '.break-after-auto': { 'break-after': 'auto' },
800
+ '.break-after-avoid': { 'break-after': 'avoid' },
801
+ '.break-after-all': { 'break-after': 'all' },
802
+ '.break-after-avoid-page': { 'break-after': 'avoid-page' },
803
+ '.break-after-page': { 'break-after': 'page' },
804
+ '.break-after-left': { 'break-after': 'left' },
805
+ '.break-after-right': { 'break-after': 'right' },
806
+ '.break-after-column': { 'break-after': 'column' },
807
+ })
808
+ },
828
809
 
829
- export let gridAutoRows = createUtilityPlugin('gridAutoRows', [['auto-rows', ['gridAutoRows']]])
830
- export let gridTemplateColumns = createUtilityPlugin('gridTemplateColumns', [
831
- ['grid-cols', ['gridTemplateColumns']],
832
- ])
833
- export let gridTemplateRows = createUtilityPlugin('gridTemplateRows', [
834
- ['grid-rows', ['gridTemplateRows']],
835
- ])
836
-
837
- export let flexDirection = ({ addUtilities }) => {
838
- addUtilities({
839
- '.flex-row': { 'flex-direction': 'row' },
840
- '.flex-row-reverse': { 'flex-direction': 'row-reverse' },
841
- '.flex-col': { 'flex-direction': 'column' },
842
- '.flex-col-reverse': { 'flex-direction': 'column-reverse' },
843
- })
844
- }
810
+ gridAutoColumns: createUtilityPlugin('gridAutoColumns', [['auto-cols', ['gridAutoColumns']]]),
845
811
 
846
- export let flexWrap = ({ addUtilities }) => {
847
- addUtilities({
848
- '.flex-wrap': { 'flex-wrap': 'wrap' },
849
- '.flex-wrap-reverse': { 'flex-wrap': 'wrap-reverse' },
850
- '.flex-nowrap': { 'flex-wrap': 'nowrap' },
851
- })
852
- }
812
+ gridAutoFlow: ({ addUtilities }) => {
813
+ addUtilities({
814
+ '.grid-flow-row': { gridAutoFlow: 'row' },
815
+ '.grid-flow-col': { gridAutoFlow: 'column' },
816
+ '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
817
+ '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
818
+ })
819
+ },
820
+
821
+ gridAutoRows: createUtilityPlugin('gridAutoRows', [['auto-rows', ['gridAutoRows']]]),
822
+ gridTemplateColumns: createUtilityPlugin('gridTemplateColumns', [
823
+ ['grid-cols', ['gridTemplateColumns']],
824
+ ]),
825
+ gridTemplateRows: createUtilityPlugin('gridTemplateRows', [['grid-rows', ['gridTemplateRows']]]),
826
+
827
+ flexDirection: ({ addUtilities }) => {
828
+ addUtilities({
829
+ '.flex-row': { 'flex-direction': 'row' },
830
+ '.flex-row-reverse': { 'flex-direction': 'row-reverse' },
831
+ '.flex-col': { 'flex-direction': 'column' },
832
+ '.flex-col-reverse': { 'flex-direction': 'column-reverse' },
833
+ })
834
+ },
853
835
 
854
- export let placeContent = ({ addUtilities }) => {
855
- addUtilities({
856
- '.place-content-center': { 'place-content': 'center' },
857
- '.place-content-start': { 'place-content': 'start' },
858
- '.place-content-end': { 'place-content': 'end' },
859
- '.place-content-between': { 'place-content': 'space-between' },
860
- '.place-content-around': { 'place-content': 'space-around' },
861
- '.place-content-evenly': { 'place-content': 'space-evenly' },
862
- '.place-content-stretch': { 'place-content': 'stretch' },
863
- })
864
- }
836
+ flexWrap: ({ addUtilities }) => {
837
+ addUtilities({
838
+ '.flex-wrap': { 'flex-wrap': 'wrap' },
839
+ '.flex-wrap-reverse': { 'flex-wrap': 'wrap-reverse' },
840
+ '.flex-nowrap': { 'flex-wrap': 'nowrap' },
841
+ })
842
+ },
843
+
844
+ placeContent: ({ addUtilities }) => {
845
+ addUtilities({
846
+ '.place-content-center': { 'place-content': 'center' },
847
+ '.place-content-start': { 'place-content': 'start' },
848
+ '.place-content-end': { 'place-content': 'end' },
849
+ '.place-content-between': { 'place-content': 'space-between' },
850
+ '.place-content-around': { 'place-content': 'space-around' },
851
+ '.place-content-evenly': { 'place-content': 'space-evenly' },
852
+ '.place-content-stretch': { 'place-content': 'stretch' },
853
+ })
854
+ },
855
+
856
+ placeItems: ({ addUtilities }) => {
857
+ addUtilities({
858
+ '.place-items-start': { 'place-items': 'start' },
859
+ '.place-items-end': { 'place-items': 'end' },
860
+ '.place-items-center': { 'place-items': 'center' },
861
+ '.place-items-stretch': { 'place-items': 'stretch' },
862
+ })
863
+ },
864
+
865
+ alignContent: ({ addUtilities }) => {
866
+ addUtilities({
867
+ '.content-center': { 'align-content': 'center' },
868
+ '.content-start': { 'align-content': 'flex-start' },
869
+ '.content-end': { 'align-content': 'flex-end' },
870
+ '.content-between': { 'align-content': 'space-between' },
871
+ '.content-around': { 'align-content': 'space-around' },
872
+ '.content-evenly': { 'align-content': 'space-evenly' },
873
+ })
874
+ },
875
+
876
+ alignItems: ({ addUtilities }) => {
877
+ addUtilities({
878
+ '.items-start': { 'align-items': 'flex-start' },
879
+ '.items-end': { 'align-items': 'flex-end' },
880
+ '.items-center': { 'align-items': 'center' },
881
+ '.items-baseline': { 'align-items': 'baseline' },
882
+ '.items-stretch': { 'align-items': 'stretch' },
883
+ })
884
+ },
885
+
886
+ justifyContent: ({ addUtilities }) => {
887
+ addUtilities({
888
+ '.justify-start': { 'justify-content': 'flex-start' },
889
+ '.justify-end': { 'justify-content': 'flex-end' },
890
+ '.justify-center': { 'justify-content': 'center' },
891
+ '.justify-between': { 'justify-content': 'space-between' },
892
+ '.justify-around': { 'justify-content': 'space-around' },
893
+ '.justify-evenly': { 'justify-content': 'space-evenly' },
894
+ })
895
+ },
896
+
897
+ justifyItems: ({ addUtilities }) => {
898
+ addUtilities({
899
+ '.justify-items-start': { 'justify-items': 'start' },
900
+ '.justify-items-end': { 'justify-items': 'end' },
901
+ '.justify-items-center': { 'justify-items': 'center' },
902
+ '.justify-items-stretch': { 'justify-items': 'stretch' },
903
+ })
904
+ },
865
905
 
866
- export let placeItems = ({ addUtilities }) => {
867
- addUtilities({
868
- '.place-items-start': { 'place-items': 'start' },
869
- '.place-items-end': { 'place-items': 'end' },
870
- '.place-items-center': { 'place-items': 'center' },
871
- '.place-items-stretch': { 'place-items': 'stretch' },
872
- })
873
- }
906
+ gap: createUtilityPlugin('gap', [
907
+ ['gap', ['gap']],
908
+ [
909
+ ['gap-x', ['columnGap']],
910
+ ['gap-y', ['rowGap']],
911
+ ],
912
+ ]),
874
913
 
875
- export let alignContent = ({ addUtilities }) => {
876
- addUtilities({
877
- '.content-center': { 'align-content': 'center' },
878
- '.content-start': { 'align-content': 'flex-start' },
879
- '.content-end': { 'align-content': 'flex-end' },
880
- '.content-between': { 'align-content': 'space-between' },
881
- '.content-around': { 'align-content': 'space-around' },
882
- '.content-evenly': { 'align-content': 'space-evenly' },
883
- })
884
- }
914
+ space: ({ matchUtilities, addUtilities, theme }) => {
915
+ matchUtilities(
916
+ {
917
+ 'space-x': (value) => {
918
+ value = value === '0' ? '0px' : value
885
919
 
886
- export let alignItems = ({ addUtilities }) => {
887
- addUtilities({
888
- '.items-start': { 'align-items': 'flex-start' },
889
- '.items-end': { 'align-items': 'flex-end' },
890
- '.items-center': { 'align-items': 'center' },
891
- '.items-baseline': { 'align-items': 'baseline' },
892
- '.items-stretch': { 'align-items': 'stretch' },
893
- })
894
- }
920
+ return {
921
+ '& > :not([hidden]) ~ :not([hidden])': {
922
+ '--tw-space-x-reverse': '0',
923
+ 'margin-right': `calc(${value} * var(--tw-space-x-reverse))`,
924
+ 'margin-left': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`,
925
+ },
926
+ }
927
+ },
928
+ 'space-y': (value) => {
929
+ value = value === '0' ? '0px' : value
895
930
 
896
- export let justifyContent = ({ addUtilities }) => {
897
- addUtilities({
898
- '.justify-start': { 'justify-content': 'flex-start' },
899
- '.justify-end': { 'justify-content': 'flex-end' },
900
- '.justify-center': { 'justify-content': 'center' },
901
- '.justify-between': { 'justify-content': 'space-between' },
902
- '.justify-around': { 'justify-content': 'space-around' },
903
- '.justify-evenly': { 'justify-content': 'space-evenly' },
904
- })
905
- }
931
+ return {
932
+ '& > :not([hidden]) ~ :not([hidden])': {
933
+ '--tw-space-y-reverse': '0',
934
+ 'margin-top': `calc(${value} * calc(1 - var(--tw-space-y-reverse)))`,
935
+ 'margin-bottom': `calc(${value} * var(--tw-space-y-reverse))`,
936
+ },
937
+ }
938
+ },
939
+ },
940
+ { values: theme('space'), supportsNegativeValues: true }
941
+ )
906
942
 
907
- export let justifyItems = ({ addUtilities }) => {
908
- addUtilities({
909
- '.justify-items-start': { 'justify-items': 'start' },
910
- '.justify-items-end': { 'justify-items': 'end' },
911
- '.justify-items-center': { 'justify-items': 'center' },
912
- '.justify-items-stretch': { 'justify-items': 'stretch' },
913
- })
914
- }
943
+ addUtilities({
944
+ '.space-y-reverse > :not([hidden]) ~ :not([hidden])': { '--tw-space-y-reverse': '1' },
945
+ '.space-x-reverse > :not([hidden]) ~ :not([hidden])': { '--tw-space-x-reverse': '1' },
946
+ })
947
+ },
915
948
 
916
- export let gap = createUtilityPlugin('gap', [
917
- ['gap', ['gap']],
918
- [
919
- ['gap-x', ['columnGap']],
920
- ['gap-y', ['rowGap']],
921
- ],
922
- ])
949
+ divideWidth: ({ matchUtilities, addUtilities, theme }) => {
950
+ matchUtilities(
951
+ {
952
+ 'divide-x': (value) => {
953
+ value = value === '0' ? '0px' : value
923
954
 
924
- export let space = ({ matchUtilities, addUtilities, theme }) => {
925
- matchUtilities(
926
- {
927
- 'space-x': (value) => {
928
- value = value === '0' ? '0px' : value
955
+ return {
956
+ '& > :not([hidden]) ~ :not([hidden])': {
957
+ '@defaults border-width': {},
958
+ '--tw-divide-x-reverse': '0',
959
+ 'border-right-width': `calc(${value} * var(--tw-divide-x-reverse))`,
960
+ 'border-left-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`,
961
+ },
962
+ }
963
+ },
964
+ 'divide-y': (value) => {
965
+ value = value === '0' ? '0px' : value
929
966
 
930
- return {
931
- '& > :not([hidden]) ~ :not([hidden])': {
932
- '--tw-space-x-reverse': '0',
933
- 'margin-right': `calc(${value} * var(--tw-space-x-reverse))`,
934
- 'margin-left': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`,
935
- },
936
- }
967
+ return {
968
+ '& > :not([hidden]) ~ :not([hidden])': {
969
+ '@defaults border-width': {},
970
+ '--tw-divide-y-reverse': '0',
971
+ 'border-top-width': `calc(${value} * calc(1 - var(--tw-divide-y-reverse)))`,
972
+ 'border-bottom-width': `calc(${value} * var(--tw-divide-y-reverse))`,
973
+ },
974
+ }
975
+ },
937
976
  },
938
- 'space-y': (value) => {
939
- value = value === '0' ? '0px' : value
977
+ { values: theme('divideWidth'), type: ['line-width', 'length'] }
978
+ )
940
979
 
941
- return {
942
- '& > :not([hidden]) ~ :not([hidden])': {
943
- '--tw-space-y-reverse': '0',
944
- 'margin-top': `calc(${value} * calc(1 - var(--tw-space-y-reverse)))`,
945
- 'margin-bottom': `calc(${value} * var(--tw-space-y-reverse))`,
946
- },
947
- }
980
+ addUtilities({
981
+ '.divide-y-reverse > :not([hidden]) ~ :not([hidden])': {
982
+ '@defaults border-width': {},
983
+ '--tw-divide-y-reverse': '1',
948
984
  },
949
- },
950
- { values: theme('space'), type: 'any' }
951
- )
952
-
953
- addUtilities({
954
- '.space-y-reverse > :not([hidden]) ~ :not([hidden])': { '--tw-space-y-reverse': '1' },
955
- '.space-x-reverse > :not([hidden]) ~ :not([hidden])': { '--tw-space-x-reverse': '1' },
956
- })
957
- }
958
-
959
- export let divideWidth = ({ matchUtilities, addUtilities, theme }) => {
960
- matchUtilities(
961
- {
962
- 'divide-x': (value) => {
963
- value = value === '0' ? '0px' : value
964
-
965
- return {
966
- '& > :not([hidden]) ~ :not([hidden])': {
967
- '@defaults border-width': {},
968
- '--tw-divide-x-reverse': '0',
969
- 'border-right-width': `calc(${value} * var(--tw-divide-x-reverse))`,
970
- 'border-left-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`,
971
- },
972
- }
973
- },
974
- 'divide-y': (value) => {
975
- value = value === '0' ? '0px' : value
976
-
977
- return {
978
- '& > :not([hidden]) ~ :not([hidden])': {
979
- '@defaults border-width': {},
980
- '--tw-divide-y-reverse': '0',
981
- 'border-top-width': `calc(${value} * calc(1 - var(--tw-divide-y-reverse)))`,
982
- 'border-bottom-width': `calc(${value} * var(--tw-divide-y-reverse))`,
983
- },
984
- }
985
+ '.divide-x-reverse > :not([hidden]) ~ :not([hidden])': {
986
+ '@defaults border-width': {},
987
+ '--tw-divide-x-reverse': '1',
985
988
  },
986
- },
987
- { values: theme('divideWidth'), type: 'length' }
988
- )
989
-
990
- addUtilities({
991
- '.divide-y-reverse > :not([hidden]) ~ :not([hidden])': {
992
- '@defaults border-width': {},
993
- '--tw-divide-y-reverse': '1',
994
- },
995
- '.divide-x-reverse > :not([hidden]) ~ :not([hidden])': {
996
- '@defaults border-width': {},
997
- '--tw-divide-x-reverse': '1',
998
- },
999
- })
1000
- }
989
+ })
990
+ },
991
+
992
+ divideStyle: ({ addUtilities }) => {
993
+ addUtilities({
994
+ '.divide-solid > :not([hidden]) ~ :not([hidden])': { 'border-style': 'solid' },
995
+ '.divide-dashed > :not([hidden]) ~ :not([hidden])': { 'border-style': 'dashed' },
996
+ '.divide-dotted > :not([hidden]) ~ :not([hidden])': { 'border-style': 'dotted' },
997
+ '.divide-double > :not([hidden]) ~ :not([hidden])': { 'border-style': 'double' },
998
+ '.divide-none > :not([hidden]) ~ :not([hidden])': { 'border-style': 'none' },
999
+ })
1000
+ },
1001
1001
 
1002
- export let divideStyle = ({ addUtilities }) => {
1003
- addUtilities({
1004
- '.divide-solid > :not([hidden]) ~ :not([hidden])': { 'border-style': 'solid' },
1005
- '.divide-dashed > :not([hidden]) ~ :not([hidden])': { 'border-style': 'dashed' },
1006
- '.divide-dotted > :not([hidden]) ~ :not([hidden])': { 'border-style': 'dotted' },
1007
- '.divide-double > :not([hidden]) ~ :not([hidden])': { 'border-style': 'double' },
1008
- '.divide-none > :not([hidden]) ~ :not([hidden])': { 'border-style': 'none' },
1009
- })
1010
- }
1002
+ divideColor: ({ matchUtilities, theme, corePlugins }) => {
1003
+ matchUtilities(
1004
+ {
1005
+ divide: (value) => {
1006
+ if (!corePlugins('divideOpacity')) {
1007
+ return {
1008
+ ['& > :not([hidden]) ~ :not([hidden])']: {
1009
+ 'border-color': toColorValue(value),
1010
+ },
1011
+ }
1012
+ }
1011
1013
 
1012
- export let divideColor = ({ matchUtilities, theme, corePlugins }) => {
1013
- matchUtilities(
1014
- {
1015
- divide: (value) => {
1016
- if (!corePlugins('divideOpacity')) {
1017
1014
  return {
1018
- ['& > :not([hidden]) ~ :not([hidden])']: {
1019
- 'border-color': toColorValue(value),
1020
- },
1015
+ ['& > :not([hidden]) ~ :not([hidden])']: withAlphaVariable({
1016
+ color: value,
1017
+ property: 'border-color',
1018
+ variable: '--tw-divide-opacity',
1019
+ }),
1021
1020
  }
1022
- }
1023
-
1024
- return {
1025
- ['& > :not([hidden]) ~ :not([hidden])']: withAlphaVariable({
1026
- color: value,
1027
- property: 'border-color',
1028
- variable: '--tw-divide-opacity',
1029
- }),
1030
- }
1021
+ },
1031
1022
  },
1032
- },
1033
- {
1034
- values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1035
- type: 'color',
1036
- }
1037
- )
1038
- }
1023
+ {
1024
+ values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1025
+ type: 'color',
1026
+ }
1027
+ )
1028
+ },
1039
1029
 
1040
- export let divideOpacity = ({ matchUtilities, theme }) => {
1041
- matchUtilities(
1042
- {
1043
- 'divide-opacity': (value) => {
1044
- return { [`& > :not([hidden]) ~ :not([hidden])`]: { '--tw-divide-opacity': value } }
1030
+ divideOpacity: ({ matchUtilities, theme }) => {
1031
+ matchUtilities(
1032
+ {
1033
+ 'divide-opacity': (value) => {
1034
+ return { [`& > :not([hidden]) ~ :not([hidden])`]: { '--tw-divide-opacity': value } }
1035
+ },
1045
1036
  },
1046
- },
1047
- { values: theme('divideOpacity'), type: 'any' }
1048
- )
1049
- }
1050
-
1051
- export let placeSelf = ({ addUtilities }) => {
1052
- addUtilities({
1053
- '.place-self-auto': { 'place-self': 'auto' },
1054
- '.place-self-start': { 'place-self': 'start' },
1055
- '.place-self-end': { 'place-self': 'end' },
1056
- '.place-self-center': { 'place-self': 'center' },
1057
- '.place-self-stretch': { 'place-self': 'stretch' },
1058
- })
1059
- }
1060
-
1061
- export let alignSelf = ({ addUtilities }) => {
1062
- addUtilities({
1063
- '.self-auto': { 'align-self': 'auto' },
1064
- '.self-start': { 'align-self': 'flex-start' },
1065
- '.self-end': { 'align-self': 'flex-end' },
1066
- '.self-center': { 'align-self': 'center' },
1067
- '.self-stretch': { 'align-self': 'stretch' },
1068
- '.self-baseline': { 'align-self': 'baseline' },
1069
- })
1070
- }
1071
-
1072
- export let justifySelf = ({ addUtilities }) => {
1073
- addUtilities({
1074
- '.justify-self-auto': { 'justify-self': 'auto' },
1075
- '.justify-self-start': { 'justify-self': 'start' },
1076
- '.justify-self-end': { 'justify-self': 'end' },
1077
- '.justify-self-center': { 'justify-self': 'center' },
1078
- '.justify-self-stretch': { 'justify-self': 'stretch' },
1079
- })
1080
- }
1081
-
1082
- export let overflow = ({ addUtilities }) => {
1083
- addUtilities({
1084
- '.overflow-auto': { overflow: 'auto' },
1085
- '.overflow-hidden': { overflow: 'hidden' },
1086
- '.overflow-visible': { overflow: 'visible' },
1087
- '.overflow-scroll': { overflow: 'scroll' },
1088
- '.overflow-x-auto': { 'overflow-x': 'auto' },
1089
- '.overflow-y-auto': { 'overflow-y': 'auto' },
1090
- '.overflow-x-hidden': { 'overflow-x': 'hidden' },
1091
- '.overflow-y-hidden': { 'overflow-y': 'hidden' },
1092
- '.overflow-x-visible': { 'overflow-x': 'visible' },
1093
- '.overflow-y-visible': { 'overflow-y': 'visible' },
1094
- '.overflow-x-scroll': { 'overflow-x': 'scroll' },
1095
- '.overflow-y-scroll': { 'overflow-y': 'scroll' },
1096
- })
1097
- }
1098
-
1099
- export let overscrollBehavior = ({ addUtilities }) => {
1100
- addUtilities({
1101
- '.overscroll-auto': { 'overscroll-behavior': 'auto' },
1102
- '.overscroll-contain': { 'overscroll-behavior': 'contain' },
1103
- '.overscroll-none': { 'overscroll-behavior': 'none' },
1104
- '.overscroll-y-auto': { 'overscroll-behavior-y': 'auto' },
1105
- '.overscroll-y-contain': { 'overscroll-behavior-y': 'contain' },
1106
- '.overscroll-y-none': { 'overscroll-behavior-y': 'none' },
1107
- '.overscroll-x-auto': { 'overscroll-behavior-x': 'auto' },
1108
- '.overscroll-x-contain': { 'overscroll-behavior-x': 'contain' },
1109
- '.overscroll-x-none': { 'overscroll-behavior-x': 'none' },
1110
- })
1111
- }
1112
-
1113
- export let scrollBehavior = ({ addUtilities }) => {
1114
- addUtilities({
1115
- '.scroll-auto': { 'scroll-behavior': 'auto' },
1116
- '.scroll-smooth': { 'scroll-behavior': 'smooth' },
1117
- })
1118
- }
1119
-
1120
- export let textOverflow = ({ addUtilities }) => {
1121
- addUtilities({
1122
- '.truncate': { overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap' },
1123
- '.overflow-ellipsis': { 'text-overflow': 'ellipsis' },
1124
- '.overflow-clip': { 'text-overflow': 'clip' },
1125
- })
1126
- }
1037
+ { values: theme('divideOpacity') }
1038
+ )
1039
+ },
1040
+
1041
+ placeSelf: ({ addUtilities }) => {
1042
+ addUtilities({
1043
+ '.place-self-auto': { 'place-self': 'auto' },
1044
+ '.place-self-start': { 'place-self': 'start' },
1045
+ '.place-self-end': { 'place-self': 'end' },
1046
+ '.place-self-center': { 'place-self': 'center' },
1047
+ '.place-self-stretch': { 'place-self': 'stretch' },
1048
+ })
1049
+ },
1050
+
1051
+ alignSelf: ({ addUtilities }) => {
1052
+ addUtilities({
1053
+ '.self-auto': { 'align-self': 'auto' },
1054
+ '.self-start': { 'align-self': 'flex-start' },
1055
+ '.self-end': { 'align-self': 'flex-end' },
1056
+ '.self-center': { 'align-self': 'center' },
1057
+ '.self-stretch': { 'align-self': 'stretch' },
1058
+ '.self-baseline': { 'align-self': 'baseline' },
1059
+ })
1060
+ },
1061
+
1062
+ justifySelf: ({ addUtilities }) => {
1063
+ addUtilities({
1064
+ '.justify-self-auto': { 'justify-self': 'auto' },
1065
+ '.justify-self-start': { 'justify-self': 'start' },
1066
+ '.justify-self-end': { 'justify-self': 'end' },
1067
+ '.justify-self-center': { 'justify-self': 'center' },
1068
+ '.justify-self-stretch': { 'justify-self': 'stretch' },
1069
+ })
1070
+ },
1071
+
1072
+ overflow: ({ addUtilities }) => {
1073
+ addUtilities({
1074
+ '.overflow-auto': { overflow: 'auto' },
1075
+ '.overflow-hidden': { overflow: 'hidden' },
1076
+ '.overflow-clip': { overflow: 'clip' },
1077
+ '.overflow-visible': { overflow: 'visible' },
1078
+ '.overflow-scroll': { overflow: 'scroll' },
1079
+ '.overflow-x-auto': { 'overflow-x': 'auto' },
1080
+ '.overflow-y-auto': { 'overflow-y': 'auto' },
1081
+ '.overflow-x-hidden': { 'overflow-x': 'hidden' },
1082
+ '.overflow-y-hidden': { 'overflow-y': 'hidden' },
1083
+ '.overflow-x-clip': { 'overflow-x': 'clip' },
1084
+ '.overflow-y-clip': { 'overflow-y': 'clip' },
1085
+ '.overflow-x-visible': { 'overflow-x': 'visible' },
1086
+ '.overflow-y-visible': { 'overflow-y': 'visible' },
1087
+ '.overflow-x-scroll': { 'overflow-x': 'scroll' },
1088
+ '.overflow-y-scroll': { 'overflow-y': 'scroll' },
1089
+ })
1090
+ },
1091
+
1092
+ overscrollBehavior: ({ addUtilities }) => {
1093
+ addUtilities({
1094
+ '.overscroll-auto': { 'overscroll-behavior': 'auto' },
1095
+ '.overscroll-contain': { 'overscroll-behavior': 'contain' },
1096
+ '.overscroll-none': { 'overscroll-behavior': 'none' },
1097
+ '.overscroll-y-auto': { 'overscroll-behavior-y': 'auto' },
1098
+ '.overscroll-y-contain': { 'overscroll-behavior-y': 'contain' },
1099
+ '.overscroll-y-none': { 'overscroll-behavior-y': 'none' },
1100
+ '.overscroll-x-auto': { 'overscroll-behavior-x': 'auto' },
1101
+ '.overscroll-x-contain': { 'overscroll-behavior-x': 'contain' },
1102
+ '.overscroll-x-none': { 'overscroll-behavior-x': 'none' },
1103
+ })
1104
+ },
1127
1105
 
1128
- export let whitespace = ({ addUtilities }) => {
1129
- addUtilities({
1130
- '.whitespace-normal': { 'white-space': 'normal' },
1131
- '.whitespace-nowrap': { 'white-space': 'nowrap' },
1132
- '.whitespace-pre': { 'white-space': 'pre' },
1133
- '.whitespace-pre-line': { 'white-space': 'pre-line' },
1134
- '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
1135
- })
1136
- }
1106
+ scrollBehavior: ({ addUtilities }) => {
1107
+ addUtilities({
1108
+ '.scroll-auto': { 'scroll-behavior': 'auto' },
1109
+ '.scroll-smooth': { 'scroll-behavior': 'smooth' },
1110
+ })
1111
+ },
1112
+
1113
+ textOverflow: ({ addUtilities }) => {
1114
+ addUtilities({
1115
+ '.truncate': { overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap' },
1116
+ '.overflow-ellipsis': { 'text-overflow': 'ellipsis' }, // Deprecated
1117
+ '.text-ellipsis': { 'text-overflow': 'ellipsis' },
1118
+ '.text-clip': { 'text-overflow': 'clip' },
1119
+ })
1120
+ },
1121
+
1122
+ whitespace: ({ addUtilities }) => {
1123
+ addUtilities({
1124
+ '.whitespace-normal': { 'white-space': 'normal' },
1125
+ '.whitespace-nowrap': { 'white-space': 'nowrap' },
1126
+ '.whitespace-pre': { 'white-space': 'pre' },
1127
+ '.whitespace-pre-line': { 'white-space': 'pre-line' },
1128
+ '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
1129
+ })
1130
+ },
1137
1131
 
1138
- export let wordBreak = ({ addUtilities }) => {
1139
- addUtilities({
1140
- '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1141
- '.break-words': { 'overflow-wrap': 'break-word' },
1142
- '.break-all': { 'word-break': 'break-all' },
1143
- })
1144
- }
1132
+ wordBreak: ({ addUtilities }) => {
1133
+ addUtilities({
1134
+ '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1135
+ '.break-words': { 'overflow-wrap': 'break-word' },
1136
+ '.break-all': { 'word-break': 'break-all' },
1137
+ })
1138
+ },
1145
1139
 
1146
- export let borderRadius = createUtilityPlugin('borderRadius', [
1147
- ['rounded', ['border-radius']],
1148
- [
1149
- ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
1150
- ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
1151
- ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
1152
- ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
1153
- ],
1154
- [
1155
- ['rounded-tl', ['border-top-left-radius']],
1156
- ['rounded-tr', ['border-top-right-radius']],
1157
- ['rounded-br', ['border-bottom-right-radius']],
1158
- ['rounded-bl', ['border-bottom-left-radius']],
1159
- ],
1160
- ])
1161
-
1162
- export let borderWidth = createUtilityPlugin(
1163
- 'borderWidth',
1164
- [
1165
- ['border', [['@defaults border-width', {}], 'border-width']],
1140
+ borderRadius: createUtilityPlugin('borderRadius', [
1141
+ ['rounded', ['border-radius']],
1166
1142
  [
1167
- ['border-t', [['@defaults border-width', {}], 'border-top-width']],
1168
- ['border-r', [['@defaults border-width', {}], 'border-right-width']],
1169
- ['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
1170
- ['border-l', [['@defaults border-width', {}], 'border-left-width']],
1143
+ ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
1144
+ ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
1145
+ ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
1146
+ ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
1171
1147
  ],
1172
- ],
1173
- { resolveArbitraryValue: asLength }
1174
- )
1175
-
1176
- export let borderStyle = ({ addUtilities }) => {
1177
- addUtilities({
1178
- '.border-solid': { 'border-style': 'solid' },
1179
- '.border-dashed': { 'border-style': 'dashed' },
1180
- '.border-dotted': { 'border-style': 'dotted' },
1181
- '.border-double': { 'border-style': 'double' },
1182
- '.border-hidden': { 'border-style': 'hidden' },
1183
- '.border-none': { 'border-style': 'none' },
1184
- })
1185
- }
1148
+ [
1149
+ ['rounded-tl', ['border-top-left-radius']],
1150
+ ['rounded-tr', ['border-top-right-radius']],
1151
+ ['rounded-br', ['border-bottom-right-radius']],
1152
+ ['rounded-bl', ['border-bottom-left-radius']],
1153
+ ],
1154
+ ]),
1186
1155
 
1187
- export let borderColor = ({ addBase, matchUtilities, theme, corePlugins }) => {
1188
- if (!corePlugins('borderOpacity')) {
1189
- let value = theme('borderColor.DEFAULT', 'currentColor')
1190
- addBase({
1191
- '@defaults border-width': {
1192
- 'border-color': toColorValue(value),
1193
- },
1194
- })
1195
- } else {
1196
- addBase({
1197
- '@defaults border-width': withAlphaVariable({
1198
- color: theme('borderColor.DEFAULT', 'currentColor'),
1199
- property: 'border-color',
1200
- variable: '--tw-border-opacity',
1201
- }),
1156
+ borderWidth: createUtilityPlugin(
1157
+ 'borderWidth',
1158
+ [
1159
+ ['border', [['@defaults border-width', {}], 'border-width']],
1160
+ [
1161
+ ['border-x', [['@defaults border-width', {}], 'border-left-width', 'border-right-width']],
1162
+ ['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
1163
+ ],
1164
+ [
1165
+ ['border-t', [['@defaults border-width', {}], 'border-top-width']],
1166
+ ['border-r', [['@defaults border-width', {}], 'border-right-width']],
1167
+ ['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
1168
+ ['border-l', [['@defaults border-width', {}], 'border-left-width']],
1169
+ ],
1170
+ ],
1171
+ { type: ['line-width', 'length'] }
1172
+ ),
1173
+
1174
+ borderStyle: ({ addUtilities }) => {
1175
+ addUtilities({
1176
+ '.border-solid': { 'border-style': 'solid' },
1177
+ '.border-dashed': { 'border-style': 'dashed' },
1178
+ '.border-dotted': { 'border-style': 'dotted' },
1179
+ '.border-double': { 'border-style': 'double' },
1180
+ '.border-hidden': { 'border-style': 'hidden' },
1181
+ '.border-none': { 'border-style': 'none' },
1202
1182
  })
1203
- }
1204
-
1205
- matchUtilities(
1206
- {
1207
- border: (value) => {
1208
- if (!corePlugins('borderOpacity')) {
1209
- return {
1210
- 'border-color': toColorValue(value),
1211
- }
1212
- }
1213
-
1214
- return withAlphaVariable({
1215
- color: value,
1183
+ },
1184
+
1185
+ borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1186
+ if (!corePlugins('borderOpacity')) {
1187
+ let value = theme('borderColor.DEFAULT', 'currentColor')
1188
+ addBase({
1189
+ '@defaults border-width': {
1190
+ 'border-color': toColorValue(value),
1191
+ },
1192
+ })
1193
+ } else {
1194
+ addBase({
1195
+ '@defaults border-width': withAlphaVariable({
1196
+ color: theme('borderColor.DEFAULT', 'currentColor'),
1216
1197
  property: 'border-color',
1217
1198
  variable: '--tw-border-opacity',
1218
- })
1219
- },
1220
- },
1221
- {
1222
- values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1223
- type: 'color',
1199
+ }),
1200
+ })
1224
1201
  }
1225
- )
1226
1202
 
1227
- matchUtilities(
1228
- {
1229
- 'border-t': (value) => {
1230
- if (!corePlugins('borderOpacity')) {
1231
- return {
1232
- 'border-top-color': toColorValue(value),
1203
+ matchUtilities(
1204
+ {
1205
+ border: (value) => {
1206
+ if (!corePlugins('borderOpacity')) {
1207
+ return {
1208
+ 'border-color': toColorValue(value),
1209
+ }
1233
1210
  }
1234
- }
1235
1211
 
1236
- return withAlphaVariable({
1237
- color: value,
1238
- property: 'border-top-color',
1239
- variable: '--tw-border-opacity',
1240
- })
1212
+ return withAlphaVariable({
1213
+ color: value,
1214
+ property: 'border-color',
1215
+ variable: '--tw-border-opacity',
1216
+ })
1217
+ },
1241
1218
  },
1242
- 'border-r': (value) => {
1243
- if (!corePlugins('borderOpacity')) {
1244
- return {
1245
- 'border-right-color': toColorValue(value),
1246
- }
1247
- }
1219
+ {
1220
+ values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1221
+ type: ['color'],
1222
+ }
1223
+ )
1248
1224
 
1249
- return withAlphaVariable({
1250
- color: value,
1251
- property: 'border-right-color',
1252
- variable: '--tw-border-opacity',
1253
- })
1254
- },
1255
- 'border-b': (value) => {
1256
- if (!corePlugins('borderOpacity')) {
1257
- return {
1258
- 'border-bottom-color': toColorValue(value),
1225
+ matchUtilities(
1226
+ {
1227
+ 'border-x': (value) => {
1228
+ if (!corePlugins('borderOpacity')) {
1229
+ return {
1230
+ 'border-left-color': toColorValue(value),
1231
+ 'border-right-color': toColorValue(value),
1232
+ }
1259
1233
  }
1260
- }
1261
1234
 
1262
- return withAlphaVariable({
1263
- color: value,
1264
- property: 'border-bottom-color',
1265
- variable: '--tw-border-opacity',
1266
- })
1267
- },
1268
- 'border-l': (value) => {
1269
- if (!corePlugins('borderOpacity')) {
1270
- return {
1271
- 'border-left-color': toColorValue(value),
1235
+ return withAlphaVariable({
1236
+ color: value,
1237
+ property: ['border-left-color', 'border-right-color'],
1238
+ variable: '--tw-border-opacity',
1239
+ })
1240
+ },
1241
+ 'border-y': (value) => {
1242
+ if (!corePlugins('borderOpacity')) {
1243
+ return {
1244
+ 'border-top-color': toColorValue(value),
1245
+ 'border-bottom-color': toColorValue(value),
1246
+ }
1272
1247
  }
1273
- }
1274
1248
 
1275
- return withAlphaVariable({
1276
- color: value,
1277
- property: 'border-left-color',
1278
- variable: '--tw-border-opacity',
1279
- })
1249
+ return withAlphaVariable({
1250
+ color: value,
1251
+ property: ['border-top-color', 'border-bottom-color'],
1252
+ variable: '--tw-border-opacity',
1253
+ })
1254
+ },
1280
1255
  },
1281
- },
1282
- {
1283
- values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1284
- type: 'color',
1285
- }
1286
- )
1287
- }
1288
-
1289
- export let borderOpacity = createUtilityPlugin('borderOpacity', [
1290
- ['border-opacity', ['--tw-border-opacity']],
1291
- ])
1256
+ {
1257
+ values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1258
+ type: 'color',
1259
+ }
1260
+ )
1292
1261
 
1293
- export let backgroundColor = ({ matchUtilities, theme, corePlugins }) => {
1294
- matchUtilities(
1295
- {
1296
- bg: (value) => {
1297
- if (!corePlugins('backgroundOpacity')) {
1298
- return {
1299
- 'background-color': toColorValue(value),
1262
+ matchUtilities(
1263
+ {
1264
+ 'border-t': (value) => {
1265
+ if (!corePlugins('borderOpacity')) {
1266
+ return {
1267
+ 'border-top-color': toColorValue(value),
1268
+ }
1300
1269
  }
1301
- }
1302
-
1303
- return withAlphaVariable({
1304
- color: value,
1305
- property: 'background-color',
1306
- variable: '--tw-bg-opacity',
1307
- })
1308
- },
1309
- },
1310
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1311
- )
1312
- }
1313
1270
 
1314
- export let backgroundOpacity = createUtilityPlugin('backgroundOpacity', [
1315
- ['bg-opacity', ['--tw-bg-opacity']],
1316
- ])
1317
- export let backgroundImage = createUtilityPlugin(
1318
- 'backgroundImage',
1319
- [['bg', ['background-image']]],
1320
- { resolveArbitraryValue: asLookupValue }
1321
- )
1322
- export let gradientColorStops = (() => {
1323
- function transparentTo(value) {
1324
- return withAlphaValue(value, 0, 'rgb(255 255 255 / 0)')
1325
- }
1326
-
1327
- return function ({ matchUtilities, theme }) {
1328
- let options = {
1329
- values: flattenColorPalette(theme('gradientColorStops')),
1330
- type: ['color', 'any'],
1331
- }
1271
+ return withAlphaVariable({
1272
+ color: value,
1273
+ property: 'border-top-color',
1274
+ variable: '--tw-border-opacity',
1275
+ })
1276
+ },
1277
+ 'border-r': (value) => {
1278
+ if (!corePlugins('borderOpacity')) {
1279
+ return {
1280
+ 'border-right-color': toColorValue(value),
1281
+ }
1282
+ }
1332
1283
 
1333
- matchUtilities(
1334
- {
1335
- from: (value) => {
1336
- let transparentToValue = transparentTo(value)
1284
+ return withAlphaVariable({
1285
+ color: value,
1286
+ property: 'border-right-color',
1287
+ variable: '--tw-border-opacity',
1288
+ })
1289
+ },
1290
+ 'border-b': (value) => {
1291
+ if (!corePlugins('borderOpacity')) {
1292
+ return {
1293
+ 'border-bottom-color': toColorValue(value),
1294
+ }
1295
+ }
1337
1296
 
1338
- return {
1339
- '--tw-gradient-from': toColorValue(value, 'from'),
1340
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1297
+ return withAlphaVariable({
1298
+ color: value,
1299
+ property: 'border-bottom-color',
1300
+ variable: '--tw-border-opacity',
1301
+ })
1302
+ },
1303
+ 'border-l': (value) => {
1304
+ if (!corePlugins('borderOpacity')) {
1305
+ return {
1306
+ 'border-left-color': toColorValue(value),
1307
+ }
1341
1308
  }
1309
+
1310
+ return withAlphaVariable({
1311
+ color: value,
1312
+ property: 'border-left-color',
1313
+ variable: '--tw-border-opacity',
1314
+ })
1342
1315
  },
1343
1316
  },
1344
- options
1317
+ {
1318
+ values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1319
+ type: 'color',
1320
+ }
1345
1321
  )
1322
+ },
1323
+
1324
+ borderOpacity: createUtilityPlugin('borderOpacity', [
1325
+ ['border-opacity', ['--tw-border-opacity']],
1326
+ ]),
1327
+
1328
+ backgroundColor: ({ matchUtilities, theme, corePlugins }) => {
1346
1329
  matchUtilities(
1347
1330
  {
1348
- via: (value) => {
1349
- let transparentToValue = transparentTo(value)
1350
-
1351
- return {
1352
- '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1353
- value,
1354
- 'via'
1355
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1331
+ bg: (value) => {
1332
+ if (!corePlugins('backgroundOpacity')) {
1333
+ return {
1334
+ 'background-color': toColorValue(value),
1335
+ }
1356
1336
  }
1337
+
1338
+ return withAlphaVariable({
1339
+ color: value,
1340
+ property: 'background-color',
1341
+ variable: '--tw-bg-opacity',
1342
+ })
1357
1343
  },
1358
1344
  },
1359
- options
1345
+ { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1360
1346
  )
1361
- matchUtilities({ to: (value) => ({ '--tw-gradient-to': toColorValue(value, 'to') }) }, options)
1362
- }
1363
- })()
1364
-
1365
- export let boxDecorationBreak = ({ addUtilities }) => {
1366
- addUtilities({
1367
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1368
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1369
- })
1370
- }
1347
+ },
1348
+
1349
+ backgroundOpacity: createUtilityPlugin('backgroundOpacity', [
1350
+ ['bg-opacity', ['--tw-bg-opacity']],
1351
+ ]),
1352
+ backgroundImage: createUtilityPlugin('backgroundImage', [['bg', ['background-image']]], {
1353
+ type: ['lookup', 'image', 'url'],
1354
+ }),
1355
+ gradientColorStops: (() => {
1356
+ function transparentTo(value) {
1357
+ return withAlphaValue(value, 0, 'rgb(255 255 255 / 0)')
1358
+ }
1371
1359
 
1372
- export let backgroundSize = createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1373
- resolveArbitraryValue: asLookupValue,
1374
- })
1360
+ return function ({ matchUtilities, theme }) {
1361
+ let options = {
1362
+ values: flattenColorPalette(theme('gradientColorStops')),
1363
+ type: ['color', 'any'],
1364
+ }
1375
1365
 
1376
- export let backgroundAttachment = ({ addUtilities }) => {
1377
- addUtilities({
1378
- '.bg-fixed': { 'background-attachment': 'fixed' },
1379
- '.bg-local': { 'background-attachment': 'local' },
1380
- '.bg-scroll': { 'background-attachment': 'scroll' },
1381
- })
1382
- }
1366
+ matchUtilities(
1367
+ {
1368
+ from: (value) => {
1369
+ let transparentToValue = transparentTo(value)
1383
1370
 
1384
- export let backgroundClip = ({ addUtilities }) => {
1385
- addUtilities({
1386
- '.bg-clip-border': { 'background-clip': 'border-box' },
1387
- '.bg-clip-padding': { 'background-clip': 'padding-box' },
1388
- '.bg-clip-content': { 'background-clip': 'content-box' },
1389
- '.bg-clip-text': { 'background-clip': 'text' },
1390
- })
1391
- }
1371
+ return {
1372
+ '--tw-gradient-from': toColorValue(value, 'from'),
1373
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1374
+ }
1375
+ },
1376
+ },
1377
+ options
1378
+ )
1379
+ matchUtilities(
1380
+ {
1381
+ via: (value) => {
1382
+ let transparentToValue = transparentTo(value)
1383
+
1384
+ return {
1385
+ '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1386
+ value,
1387
+ 'via'
1388
+ )}, var(--tw-gradient-to, ${transparentToValue})`,
1389
+ }
1390
+ },
1391
+ },
1392
+ options
1393
+ )
1394
+ matchUtilities(
1395
+ { to: (value) => ({ '--tw-gradient-to': toColorValue(value, 'to') }) },
1396
+ options
1397
+ )
1398
+ }
1399
+ })(),
1400
+
1401
+ boxDecorationBreak: ({ addUtilities }) => {
1402
+ addUtilities({
1403
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1404
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1405
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1406
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1407
+ })
1408
+ },
1392
1409
 
1393
- export let backgroundPosition = createUtilityPlugin(
1394
- 'backgroundPosition',
1395
- [['bg', ['background-position']]],
1396
- { resolveArbitraryValue: asLookupValue }
1397
- )
1398
-
1399
- export let backgroundRepeat = ({ addUtilities }) => {
1400
- addUtilities({
1401
- '.bg-repeat': { 'background-repeat': 'repeat' },
1402
- '.bg-no-repeat': { 'background-repeat': 'no-repeat' },
1403
- '.bg-repeat-x': { 'background-repeat': 'repeat-x' },
1404
- '.bg-repeat-y': { 'background-repeat': 'repeat-y' },
1405
- '.bg-repeat-round': { 'background-repeat': 'round' },
1406
- '.bg-repeat-space': { 'background-repeat': 'space' },
1407
- })
1408
- }
1410
+ backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1411
+ type: ['lookup', 'length', 'percentage'],
1412
+ }),
1409
1413
 
1410
- export let backgroundOrigin = ({ addUtilities }) => {
1411
- addUtilities({
1412
- '.bg-origin-border': { 'background-origin': 'border-box' },
1413
- '.bg-origin-padding': { 'background-origin': 'padding-box' },
1414
- '.bg-origin-content': { 'background-origin': 'content-box' },
1415
- })
1416
- }
1414
+ backgroundAttachment: ({ addUtilities }) => {
1415
+ addUtilities({
1416
+ '.bg-fixed': { 'background-attachment': 'fixed' },
1417
+ '.bg-local': { 'background-attachment': 'local' },
1418
+ '.bg-scroll': { 'background-attachment': 'scroll' },
1419
+ })
1420
+ },
1421
+
1422
+ backgroundClip: ({ addUtilities }) => {
1423
+ addUtilities({
1424
+ '.bg-clip-border': { 'background-clip': 'border-box' },
1425
+ '.bg-clip-padding': { 'background-clip': 'padding-box' },
1426
+ '.bg-clip-content': { 'background-clip': 'content-box' },
1427
+ '.bg-clip-text': { 'background-clip': 'text' },
1428
+ })
1429
+ },
1430
+
1431
+ backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1432
+ type: ['lookup', 'position'],
1433
+ }),
1434
+
1435
+ backgroundRepeat: ({ addUtilities }) => {
1436
+ addUtilities({
1437
+ '.bg-repeat': { 'background-repeat': 'repeat' },
1438
+ '.bg-no-repeat': { 'background-repeat': 'no-repeat' },
1439
+ '.bg-repeat-x': { 'background-repeat': 'repeat-x' },
1440
+ '.bg-repeat-y': { 'background-repeat': 'repeat-y' },
1441
+ '.bg-repeat-round': { 'background-repeat': 'round' },
1442
+ '.bg-repeat-space': { 'background-repeat': 'space' },
1443
+ })
1444
+ },
1445
+
1446
+ backgroundOrigin: ({ addUtilities }) => {
1447
+ addUtilities({
1448
+ '.bg-origin-border': { 'background-origin': 'border-box' },
1449
+ '.bg-origin-padding': { 'background-origin': 'padding-box' },
1450
+ '.bg-origin-content': { 'background-origin': 'content-box' },
1451
+ })
1452
+ },
1417
1453
 
1418
- export let fill = ({ matchUtilities, theme }) => {
1419
- matchUtilities(
1420
- {
1421
- fill: (value) => {
1422
- return { fill: toColorValue(value) }
1454
+ fill: ({ matchUtilities, theme }) => {
1455
+ matchUtilities(
1456
+ {
1457
+ fill: (value) => {
1458
+ return { fill: toColorValue(value) }
1459
+ },
1423
1460
  },
1424
- },
1425
- { values: flattenColorPalette(theme('fill')), type: ['color', 'any'] }
1426
- )
1427
- }
1461
+ { values: flattenColorPalette(theme('fill')), type: ['color', 'any'] }
1462
+ )
1463
+ },
1428
1464
 
1429
- export let stroke = ({ matchUtilities, theme }) => {
1430
- matchUtilities(
1431
- {
1432
- stroke: (value) => {
1433
- return { stroke: toColorValue(value) }
1465
+ stroke: ({ matchUtilities, theme }) => {
1466
+ matchUtilities(
1467
+ {
1468
+ stroke: (value) => {
1469
+ return { stroke: toColorValue(value) }
1470
+ },
1434
1471
  },
1435
- },
1436
- { values: flattenColorPalette(theme('stroke')), type: 'color' }
1437
- )
1438
- }
1472
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1473
+ )
1474
+ },
1475
+
1476
+ strokeWidth: createUtilityPlugin('strokeWidth', [['stroke', ['stroke-width']]], {
1477
+ type: ['length', 'number', 'percentage'],
1478
+ }),
1479
+
1480
+ objectFit: ({ addUtilities }) => {
1481
+ addUtilities({
1482
+ '.object-contain': { 'object-fit': 'contain' },
1483
+ '.object-cover': { 'object-fit': 'cover' },
1484
+ '.object-fill': { 'object-fit': 'fill' },
1485
+ '.object-none': { 'object-fit': 'none' },
1486
+ '.object-scale-down': { 'object-fit': 'scale-down' },
1487
+ })
1488
+ },
1489
+ objectPosition: createUtilityPlugin('objectPosition', [['object', ['object-position']]]),
1439
1490
 
1440
- export let strokeWidth = createUtilityPlugin('strokeWidth', [['stroke', ['stroke-width']]], {
1441
- resolveArbitraryValue: asLength,
1442
- })
1443
-
1444
- export let objectFit = ({ addUtilities }) => {
1445
- addUtilities({
1446
- '.object-contain': { 'object-fit': 'contain' },
1447
- '.object-cover': { 'object-fit': 'cover' },
1448
- '.object-fill': { 'object-fit': 'fill' },
1449
- '.object-none': { 'object-fit': 'none' },
1450
- '.object-scale-down': { 'object-fit': 'scale-down' },
1451
- })
1452
- }
1453
- export let objectPosition = createUtilityPlugin('objectPosition', [['object', ['object-position']]])
1454
-
1455
- export let padding = createUtilityPlugin('padding', [
1456
- ['p', ['padding']],
1457
- [
1458
- ['px', ['padding-left', 'padding-right']],
1459
- ['py', ['padding-top', 'padding-bottom']],
1460
- ],
1461
- [
1462
- ['pt', ['padding-top']],
1463
- ['pr', ['padding-right']],
1464
- ['pb', ['padding-bottom']],
1465
- ['pl', ['padding-left']],
1466
- ],
1467
- ])
1468
-
1469
- export let textAlign = ({ addUtilities }) => {
1470
- addUtilities({
1471
- '.text-left': { 'text-align': 'left' },
1472
- '.text-center': { 'text-align': 'center' },
1473
- '.text-right': { 'text-align': 'right' },
1474
- '.text-justify': { 'text-align': 'justify' },
1475
- })
1476
- }
1491
+ padding: createUtilityPlugin('padding', [
1492
+ ['p', ['padding']],
1493
+ [
1494
+ ['px', ['padding-left', 'padding-right']],
1495
+ ['py', ['padding-top', 'padding-bottom']],
1496
+ ],
1497
+ [
1498
+ ['pt', ['padding-top']],
1499
+ ['pr', ['padding-right']],
1500
+ ['pb', ['padding-bottom']],
1501
+ ['pl', ['padding-left']],
1502
+ ],
1503
+ ]),
1504
+
1505
+ textAlign: ({ addUtilities }) => {
1506
+ addUtilities({
1507
+ '.text-left': { 'text-align': 'left' },
1508
+ '.text-center': { 'text-align': 'center' },
1509
+ '.text-right': { 'text-align': 'right' },
1510
+ '.text-justify': { 'text-align': 'justify' },
1511
+ })
1512
+ },
1513
+
1514
+ textIndent: createUtilityPlugin('textIndent', [['indent', ['text-indent']]], {
1515
+ supportsNegativeValues: true,
1516
+ }),
1517
+
1518
+ verticalAlign: ({ addUtilities, matchUtilities }) => {
1519
+ addUtilities({
1520
+ '.align-baseline': { 'vertical-align': 'baseline' },
1521
+ '.align-top': { 'vertical-align': 'top' },
1522
+ '.align-middle': { 'vertical-align': 'middle' },
1523
+ '.align-bottom': { 'vertical-align': 'bottom' },
1524
+ '.align-text-top': { 'vertical-align': 'text-top' },
1525
+ '.align-text-bottom': { 'vertical-align': 'text-bottom' },
1526
+ '.align-sub': { 'vertical-align': 'sub' },
1527
+ '.align-super': { 'vertical-align': 'super' },
1528
+ })
1477
1529
 
1478
- export let textIndent = createUtilityPlugin('textIndent', [['indent', ['text-indent']]])
1479
-
1480
- export let verticalAlign = ({ addUtilities }) => {
1481
- addUtilities({
1482
- '.align-baseline': { 'vertical-align': 'baseline' },
1483
- '.align-top': { 'vertical-align': 'top' },
1484
- '.align-middle': { 'vertical-align': 'middle' },
1485
- '.align-bottom': { 'vertical-align': 'bottom' },
1486
- '.align-text-top': { 'vertical-align': 'text-top' },
1487
- '.align-text-bottom': { 'vertical-align': 'text-bottom' },
1488
- })
1489
- }
1530
+ matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1531
+ },
1490
1532
 
1491
- export let fontFamily = createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1492
- resolveArbitraryValue: asLookupValue,
1493
- })
1533
+ fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1534
+ type: ['lookup', 'generic-name', 'family-name'],
1535
+ }),
1494
1536
 
1495
- export let fontSize = ({ matchUtilities, theme }) => {
1496
- matchUtilities(
1497
- {
1498
- text: (value) => {
1499
- let [fontSize, options] = Array.isArray(value) ? value : [value]
1500
- let { lineHeight, letterSpacing } = isPlainObject(options)
1501
- ? options
1502
- : { lineHeight: options }
1537
+ fontSize: ({ matchUtilities, theme }) => {
1538
+ matchUtilities(
1539
+ {
1540
+ text: (value) => {
1541
+ let [fontSize, options] = Array.isArray(value) ? value : [value]
1542
+ let { lineHeight, letterSpacing } = isPlainObject(options)
1543
+ ? options
1544
+ : { lineHeight: options }
1503
1545
 
1504
- return {
1505
- 'font-size': fontSize,
1506
- ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1507
- ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1508
- }
1546
+ return {
1547
+ 'font-size': fontSize,
1548
+ ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1549
+ ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1550
+ }
1551
+ },
1509
1552
  },
1510
- },
1511
- { values: theme('fontSize'), type: 'length' }
1512
- )
1513
- }
1514
-
1515
- export let fontWeight = createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1516
- resolveArbitraryValue: asLookupValue,
1517
- })
1518
-
1519
- export let textTransform = ({ addUtilities }) => {
1520
- addUtilities({
1521
- '.uppercase': { 'text-transform': 'uppercase' },
1522
- '.lowercase': { 'text-transform': 'lowercase' },
1523
- '.capitalize': { 'text-transform': 'capitalize' },
1524
- '.normal-case': { 'text-transform': 'none' },
1525
- })
1526
- }
1553
+ {
1554
+ values: theme('fontSize'),
1555
+ type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1556
+ }
1557
+ )
1558
+ },
1559
+
1560
+ fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1561
+ type: ['lookup', 'number'],
1562
+ }),
1563
+
1564
+ textTransform: ({ addUtilities }) => {
1565
+ addUtilities({
1566
+ '.uppercase': { 'text-transform': 'uppercase' },
1567
+ '.lowercase': { 'text-transform': 'lowercase' },
1568
+ '.capitalize': { 'text-transform': 'capitalize' },
1569
+ '.normal-case': { 'text-transform': 'none' },
1570
+ })
1571
+ },
1527
1572
 
1528
- export let fontStyle = ({ addUtilities }) => {
1529
- addUtilities({
1530
- '.italic': { 'font-style': 'italic' },
1531
- '.not-italic': { 'font-style': 'normal' },
1532
- })
1533
- }
1573
+ fontStyle: ({ addUtilities }) => {
1574
+ addUtilities({
1575
+ '.italic': { 'font-style': 'italic' },
1576
+ '.not-italic': { 'font-style': 'normal' },
1577
+ })
1578
+ },
1534
1579
 
1535
- export let fontVariantNumeric = ({ addUtilities }) => {
1536
- addUtilities({
1537
- '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions':
1538
- {
1580
+ fontVariantNumeric: ({ addUtilities }) => {
1581
+ addUtilities({
1582
+ '@defaults font-variant-numeric': {
1539
1583
  '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1540
1584
  '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1541
1585
  '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1542
1586
  '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1543
1587
  '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1544
- 'font-variant-numeric':
1588
+ '--tw-font-variant-numeric':
1545
1589
  'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1546
1590
  },
1547
- '.normal-nums': { 'font-variant-numeric': 'normal' },
1548
- '.ordinal': { '--tw-ordinal': 'ordinal' },
1549
- '.slashed-zero': { '--tw-slashed-zero': 'slashed-zero' },
1550
- '.lining-nums': { '--tw-numeric-figure': 'lining-nums' },
1551
- '.oldstyle-nums': { '--tw-numeric-figure': 'oldstyle-nums' },
1552
- '.proportional-nums': { '--tw-numeric-spacing': 'proportional-nums' },
1553
- '.tabular-nums': { '--tw-numeric-spacing': 'tabular-nums' },
1554
- '.diagonal-fractions': { '--tw-numeric-fraction': 'diagonal-fractions' },
1555
- '.stacked-fractions': { '--tw-numeric-fraction': 'stacked-fractions' },
1556
- })
1557
- }
1558
-
1559
- export let lineHeight = createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]])
1560
- export let letterSpacing = createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]])
1561
-
1562
- export let textColor = ({ matchUtilities, theme, corePlugins }) => {
1563
- matchUtilities(
1564
- {
1565
- text: (value) => {
1566
- if (!corePlugins('textOpacity')) {
1567
- return { color: toColorValue(value) }
1568
- }
1569
-
1570
- return withAlphaVariable({
1571
- color: value,
1572
- property: 'color',
1573
- variable: '--tw-text-opacity',
1574
- })
1591
+ '.normal-nums': { 'font-variant-numeric': 'normal' },
1592
+ '.ordinal': {
1593
+ '@defaults font-variant-numeric': {},
1594
+ '--tw-ordinal': 'ordinal',
1595
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1575
1596
  },
1576
- },
1577
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
1578
- )
1579
- }
1580
-
1581
- export let textOpacity = createUtilityPlugin('textOpacity', [
1582
- ['text-opacity', ['--tw-text-opacity']],
1583
- ])
1584
-
1585
- export let textDecoration = ({ addUtilities }) => {
1586
- addUtilities({
1587
- '.underline': { 'text-decoration': 'underline' },
1588
- '.line-through': { 'text-decoration': 'line-through' },
1589
- '.no-underline': { 'text-decoration': 'none' },
1590
- })
1591
- }
1597
+ '.slashed-zero': {
1598
+ '@defaults font-variant-numeric': {},
1599
+ '--tw-slashed-zero': 'slashed-zero',
1600
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1601
+ },
1602
+ '.lining-nums': {
1603
+ '@defaults font-variant-numeric': {},
1604
+ '--tw-numeric-figure': 'lining-nums',
1605
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1606
+ },
1607
+ '.oldstyle-nums': {
1608
+ '@defaults font-variant-numeric': {},
1609
+ '--tw-numeric-figure': 'oldstyle-nums',
1610
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1611
+ },
1612
+ '.proportional-nums': {
1613
+ '@defaults font-variant-numeric': {},
1614
+ '--tw-numeric-spacing': 'proportional-nums',
1615
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1616
+ },
1617
+ '.tabular-nums': {
1618
+ '@defaults font-variant-numeric': {},
1619
+ '--tw-numeric-spacing': 'tabular-nums',
1620
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1621
+ },
1622
+ '.diagonal-fractions': {
1623
+ '@defaults font-variant-numeric': {},
1624
+ '--tw-numeric-fraction': 'diagonal-fractions',
1625
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1626
+ },
1627
+ '.stacked-fractions': {
1628
+ '@defaults font-variant-numeric': {},
1629
+ '--tw-numeric-fraction': 'stacked-fractions',
1630
+ 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1631
+ },
1632
+ })
1633
+ },
1592
1634
 
1593
- export let fontSmoothing = ({ addUtilities }) => {
1594
- addUtilities({
1595
- '.antialiased': {
1596
- '-webkit-font-smoothing': 'antialiased',
1597
- '-moz-osx-font-smoothing': 'grayscale',
1598
- },
1599
- '.subpixel-antialiased': {
1600
- '-webkit-font-smoothing': 'auto',
1601
- '-moz-osx-font-smoothing': 'auto',
1602
- },
1603
- })
1604
- }
1635
+ lineHeight: createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]]),
1636
+ letterSpacing: createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]], {
1637
+ supportsNegativeValues: true,
1638
+ }),
1605
1639
 
1606
- export let placeholderColor = ({ matchUtilities, theme, corePlugins }) => {
1607
- matchUtilities(
1608
- {
1609
- placeholder: (value) => {
1610
- if (!corePlugins('placeholderOpacity')) {
1611
- return {
1612
- '&::placeholder': {
1613
- color: toColorValue(value),
1614
- },
1640
+ textColor: ({ matchUtilities, theme, corePlugins }) => {
1641
+ matchUtilities(
1642
+ {
1643
+ text: (value) => {
1644
+ if (!corePlugins('textOpacity')) {
1645
+ return { color: toColorValue(value) }
1615
1646
  }
1616
- }
1617
1647
 
1618
- return {
1619
- '&::placeholder': withAlphaVariable({
1648
+ return withAlphaVariable({
1620
1649
  color: value,
1621
1650
  property: 'color',
1622
- variable: '--tw-placeholder-opacity',
1623
- }),
1624
- }
1651
+ variable: '--tw-text-opacity',
1652
+ })
1653
+ },
1625
1654
  },
1626
- },
1627
- { values: flattenColorPalette(theme('placeholderColor')), type: ['color', 'any'] }
1628
- )
1629
- }
1655
+ { values: flattenColorPalette(theme('textColor')), type: 'color' }
1656
+ )
1657
+ },
1630
1658
 
1631
- export let placeholderOpacity = ({ matchUtilities, theme }) => {
1632
- matchUtilities(
1633
- {
1634
- 'placeholder-opacity': (value) => {
1635
- return { ['&::placeholder']: { '--tw-placeholder-opacity': value } }
1636
- },
1637
- },
1638
- { values: theme('placeholderOpacity'), type: 'any' }
1639
- )
1640
- }
1659
+ textOpacity: createUtilityPlugin('textOpacity', [['text-opacity', ['--tw-text-opacity']]]),
1641
1660
 
1642
- export let caretColor = ({ matchUtilities, theme }) => {
1643
- matchUtilities(
1644
- {
1645
- caret: (value) => {
1646
- return { 'caret-color': toColorValue(value) }
1647
- },
1648
- },
1649
- { values: flattenColorPalette(theme('caretColor')), type: ['color', 'any'] }
1650
- )
1651
- }
1661
+ textDecoration: ({ addUtilities }) => {
1662
+ addUtilities({
1663
+ '.underline': { 'text-decoration': 'underline' },
1664
+ '.overline': { 'text-decoration': 'overline' },
1665
+ '.line-through': { 'text-decoration': 'line-through' },
1666
+ '.no-underline': { 'text-decoration': 'none' },
1667
+ })
1668
+ },
1652
1669
 
1653
- export let accentColor = ({ matchUtilities, theme }) => {
1654
- matchUtilities(
1655
- {
1656
- accent: (value) => {
1657
- return { 'accent-color': toColorValue(value) }
1658
- },
1659
- },
1660
- { values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] }
1661
- )
1662
- }
1670
+ textDecorationColor: ({ matchUtilities, theme }) => {
1671
+ matchUtilities(
1672
+ {
1673
+ decoration: (value) => {
1674
+ return { 'text-decoration-color': toColorValue(value) }
1675
+ },
1676
+ },
1677
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
1678
+ )
1679
+ },
1680
+
1681
+ textDecorationStyle: ({ addUtilities }) => {
1682
+ addUtilities({
1683
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1684
+ '.decoration-double': { 'text-decoration-style': 'double' },
1685
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1686
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1687
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1688
+ })
1689
+ },
1690
+
1691
+ textDecorationThickness: createUtilityPlugin(
1692
+ 'textDecorationThickness',
1693
+ [['decoration', ['text-decoration-thickness']]],
1694
+ { type: ['length', 'percentage'] }
1695
+ ),
1696
+
1697
+ textUnderlineOffset: createUtilityPlugin(
1698
+ 'textUnderlineOffset',
1699
+ [['underline-offset', ['text-underline-offset']]],
1700
+ { type: ['length', 'percentage'] }
1701
+ ),
1702
+
1703
+ fontSmoothing: ({ addUtilities }) => {
1704
+ addUtilities({
1705
+ '.antialiased': {
1706
+ '-webkit-font-smoothing': 'antialiased',
1707
+ '-moz-osx-font-smoothing': 'grayscale',
1708
+ },
1709
+ '.subpixel-antialiased': {
1710
+ '-webkit-font-smoothing': 'auto',
1711
+ '-moz-osx-font-smoothing': 'auto',
1712
+ },
1713
+ })
1714
+ },
1663
1715
 
1664
- export let opacity = createUtilityPlugin('opacity', [['opacity', ['opacity']]])
1665
-
1666
- export let backgroundBlendMode = ({ addUtilities }) => {
1667
- addUtilities({
1668
- '.bg-blend-normal': { 'background-blend-mode': 'normal' },
1669
- '.bg-blend-multiply': { 'background-blend-mode': 'multiply' },
1670
- '.bg-blend-screen': { 'background-blend-mode': 'screen' },
1671
- '.bg-blend-overlay': { 'background-blend-mode': 'overlay' },
1672
- '.bg-blend-darken': { 'background-blend-mode': 'darken' },
1673
- '.bg-blend-lighten': { 'background-blend-mode': 'lighten' },
1674
- '.bg-blend-color-dodge': { 'background-blend-mode': 'color-dodge' },
1675
- '.bg-blend-color-burn': { 'background-blend-mode': 'color-burn' },
1676
- '.bg-blend-hard-light': { 'background-blend-mode': 'hard-light' },
1677
- '.bg-blend-soft-light': { 'background-blend-mode': 'soft-light' },
1678
- '.bg-blend-difference': { 'background-blend-mode': 'difference' },
1679
- '.bg-blend-exclusion': { 'background-blend-mode': 'exclusion' },
1680
- '.bg-blend-hue': { 'background-blend-mode': 'hue' },
1681
- '.bg-blend-saturation': { 'background-blend-mode': 'saturation' },
1682
- '.bg-blend-color': { 'background-blend-mode': 'color' },
1683
- '.bg-blend-luminosity': { 'background-blend-mode': 'luminosity' },
1684
- })
1685
- }
1716
+ placeholderColor: ({ matchUtilities, theme, corePlugins }) => {
1717
+ matchUtilities(
1718
+ {
1719
+ placeholder: (value) => {
1720
+ if (!corePlugins('placeholderOpacity')) {
1721
+ return {
1722
+ '&::placeholder': {
1723
+ color: toColorValue(value),
1724
+ },
1725
+ }
1726
+ }
1686
1727
 
1687
- export let mixBlendMode = ({ addUtilities }) => {
1688
- addUtilities({
1689
- '.mix-blend-normal': { 'mix-blend-mode': 'normal' },
1690
- '.mix-blend-multiply': { 'mix-blend-mode': 'multiply' },
1691
- '.mix-blend-screen': { 'mix-blend-mode': 'screen' },
1692
- '.mix-blend-overlay': { 'mix-blend-mode': 'overlay' },
1693
- '.mix-blend-darken': { 'mix-blend-mode': 'darken' },
1694
- '.mix-blend-lighten': { 'mix-blend-mode': 'lighten' },
1695
- '.mix-blend-color-dodge': { 'mix-blend-mode': 'color-dodge' },
1696
- '.mix-blend-color-burn': { 'mix-blend-mode': 'color-burn' },
1697
- '.mix-blend-hard-light': { 'mix-blend-mode': 'hard-light' },
1698
- '.mix-blend-soft-light': { 'mix-blend-mode': 'soft-light' },
1699
- '.mix-blend-difference': { 'mix-blend-mode': 'difference' },
1700
- '.mix-blend-exclusion': { 'mix-blend-mode': 'exclusion' },
1701
- '.mix-blend-hue': { 'mix-blend-mode': 'hue' },
1702
- '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1703
- '.mix-blend-color': { 'mix-blend-mode': 'color' },
1704
- '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
1705
- })
1706
- }
1728
+ return {
1729
+ '&::placeholder': withAlphaVariable({
1730
+ color: value,
1731
+ property: 'color',
1732
+ variable: '--tw-placeholder-opacity',
1733
+ }),
1734
+ }
1735
+ },
1736
+ },
1737
+ { values: flattenColorPalette(theme('placeholderColor')), type: ['color', 'any'] }
1738
+ )
1739
+ },
1707
1740
 
1708
- export let boxShadow = (() => {
1709
- let transformValue = transformThemeValue('boxShadow')
1710
- let defaultBoxShadow = [
1711
- `var(--tw-ring-offset-shadow, 0 0 #0000)`,
1712
- `var(--tw-ring-shadow, 0 0 #0000)`,
1713
- `var(--tw-shadow)`,
1714
- ].join(', ')
1741
+ placeholderOpacity: ({ matchUtilities, theme }) => {
1742
+ matchUtilities(
1743
+ {
1744
+ 'placeholder-opacity': (value) => {
1745
+ return { ['&::placeholder']: { '--tw-placeholder-opacity': value } }
1746
+ },
1747
+ },
1748
+ { values: theme('placeholderOpacity') }
1749
+ )
1750
+ },
1715
1751
 
1716
- return function ({ matchUtilities, addBase, theme }) {
1717
- addBase({
1718
- '@defaults box-shadow': {
1719
- '--tw-ring-offset-shadow': '0 0 #0000',
1720
- '--tw-ring-shadow': '0 0 #0000',
1721
- '--tw-shadow': '0 0 #0000',
1752
+ caretColor: ({ matchUtilities, theme }) => {
1753
+ matchUtilities(
1754
+ {
1755
+ caret: (value) => {
1756
+ return { 'caret-color': toColorValue(value) }
1757
+ },
1722
1758
  },
1759
+ { values: flattenColorPalette(theme('caretColor')), type: ['color', 'any'] }
1760
+ )
1761
+ },
1762
+
1763
+ accentColor: ({ matchUtilities, theme }) => {
1764
+ matchUtilities(
1765
+ {
1766
+ accent: (value) => {
1767
+ return { 'accent-color': toColorValue(value) }
1768
+ },
1769
+ },
1770
+ { values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] }
1771
+ )
1772
+ },
1773
+
1774
+ opacity: createUtilityPlugin('opacity', [['opacity', ['opacity']]]),
1775
+
1776
+ backgroundBlendMode: ({ addUtilities }) => {
1777
+ addUtilities({
1778
+ '.bg-blend-normal': { 'background-blend-mode': 'normal' },
1779
+ '.bg-blend-multiply': { 'background-blend-mode': 'multiply' },
1780
+ '.bg-blend-screen': { 'background-blend-mode': 'screen' },
1781
+ '.bg-blend-overlay': { 'background-blend-mode': 'overlay' },
1782
+ '.bg-blend-darken': { 'background-blend-mode': 'darken' },
1783
+ '.bg-blend-lighten': { 'background-blend-mode': 'lighten' },
1784
+ '.bg-blend-color-dodge': { 'background-blend-mode': 'color-dodge' },
1785
+ '.bg-blend-color-burn': { 'background-blend-mode': 'color-burn' },
1786
+ '.bg-blend-hard-light': { 'background-blend-mode': 'hard-light' },
1787
+ '.bg-blend-soft-light': { 'background-blend-mode': 'soft-light' },
1788
+ '.bg-blend-difference': { 'background-blend-mode': 'difference' },
1789
+ '.bg-blend-exclusion': { 'background-blend-mode': 'exclusion' },
1790
+ '.bg-blend-hue': { 'background-blend-mode': 'hue' },
1791
+ '.bg-blend-saturation': { 'background-blend-mode': 'saturation' },
1792
+ '.bg-blend-color': { 'background-blend-mode': 'color' },
1793
+ '.bg-blend-luminosity': { 'background-blend-mode': 'luminosity' },
1794
+ })
1795
+ },
1796
+
1797
+ mixBlendMode: ({ addUtilities }) => {
1798
+ addUtilities({
1799
+ '.mix-blend-normal': { 'mix-blend-mode': 'normal' },
1800
+ '.mix-blend-multiply': { 'mix-blend-mode': 'multiply' },
1801
+ '.mix-blend-screen': { 'mix-blend-mode': 'screen' },
1802
+ '.mix-blend-overlay': { 'mix-blend-mode': 'overlay' },
1803
+ '.mix-blend-darken': { 'mix-blend-mode': 'darken' },
1804
+ '.mix-blend-lighten': { 'mix-blend-mode': 'lighten' },
1805
+ '.mix-blend-color-dodge': { 'mix-blend-mode': 'color-dodge' },
1806
+ '.mix-blend-color-burn': { 'mix-blend-mode': 'color-burn' },
1807
+ '.mix-blend-hard-light': { 'mix-blend-mode': 'hard-light' },
1808
+ '.mix-blend-soft-light': { 'mix-blend-mode': 'soft-light' },
1809
+ '.mix-blend-difference': { 'mix-blend-mode': 'difference' },
1810
+ '.mix-blend-exclusion': { 'mix-blend-mode': 'exclusion' },
1811
+ '.mix-blend-hue': { 'mix-blend-mode': 'hue' },
1812
+ '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1813
+ '.mix-blend-color': { 'mix-blend-mode': 'color' },
1814
+ '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
1723
1815
  })
1816
+ },
1817
+
1818
+ boxShadow: (() => {
1819
+ let transformValue = transformThemeValue('boxShadow')
1820
+ let defaultBoxShadow = [
1821
+ `var(--tw-ring-offset-shadow, 0 0 #0000)`,
1822
+ `var(--tw-ring-shadow, 0 0 #0000)`,
1823
+ `var(--tw-shadow)`,
1824
+ ].join(', ')
1825
+
1826
+ return function ({ matchUtilities, addBase, theme }) {
1827
+ addBase({
1828
+ '@defaults box-shadow': {
1829
+ '--tw-ring-offset-shadow': '0 0 #0000',
1830
+ '--tw-ring-shadow': '0 0 #0000',
1831
+ '--tw-shadow': '0 0 #0000',
1832
+ '--tw-shadow-colored': '0 0 #0000',
1833
+ },
1834
+ })
1835
+
1836
+ matchUtilities(
1837
+ {
1838
+ shadow: (value) => {
1839
+ value = transformValue(value)
1840
+
1841
+ let ast = parseBoxShadowValue(value)
1842
+ for (let shadow of ast) {
1843
+ // Don't override color if the whole shadow is a variable
1844
+ if (!shadow.valid) {
1845
+ continue
1846
+ }
1847
+
1848
+ shadow.color = 'var(--tw-shadow-color)'
1849
+ }
1724
1850
 
1851
+ return {
1852
+ '@defaults box-shadow': {},
1853
+ '--tw-shadow': value === 'none' ? '0 0 #0000' : value,
1854
+ '--tw-shadow-colored': value === 'none' ? '0 0 #0000' : formatBoxShadowValue(ast),
1855
+ 'box-shadow': defaultBoxShadow,
1856
+ }
1857
+ },
1858
+ },
1859
+ { values: theme('boxShadow'), type: ['shadow'] }
1860
+ )
1861
+ }
1862
+ })(),
1863
+
1864
+ boxShadowColor: ({ matchUtilities, theme }) => {
1725
1865
  matchUtilities(
1726
1866
  {
1727
1867
  shadow: (value) => {
1728
- value = transformValue(value)
1729
-
1730
1868
  return {
1731
- '@defaults box-shadow': {},
1732
- '--tw-shadow': value === 'none' ? '0 0 #0000' : value,
1733
- 'box-shadow': defaultBoxShadow,
1869
+ '--tw-shadow-color': toColorValue(value),
1870
+ '--tw-shadow': 'var(--tw-shadow-colored)',
1734
1871
  }
1735
1872
  },
1736
1873
  },
1737
- { values: theme('boxShadow') }
1874
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
1738
1875
  )
1739
- }
1740
- })()
1741
-
1742
- export let outline = ({ matchUtilities, theme }) => {
1743
- matchUtilities(
1744
- {
1745
- outline: (value) => {
1746
- let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [value]
1876
+ },
1747
1877
 
1748
- return { outline, 'outline-offset': outlineOffset }
1878
+ outlineStyle: ({ addUtilities }) => {
1879
+ addUtilities({
1880
+ '.outline-none': {
1881
+ outline: '2px solid transparent',
1882
+ 'outline-offset': '2px',
1749
1883
  },
1750
- },
1751
- { values: theme('outline'), type: 'any' }
1752
- )
1753
- }
1884
+ '.outline': { 'outline-style': 'solid' },
1885
+ '.outline-dashed': { 'outline-style': 'dashed' },
1886
+ '.outline-dotted': { 'outline-style': 'dotted' },
1887
+ '.outline-double': { 'outline-style': 'double' },
1888
+ '.outline-hidden': { 'outline-style': 'hidden' },
1889
+ })
1890
+ },
1754
1891
 
1755
- export let ringWidth = ({ matchUtilities, addBase, addUtilities, theme }) => {
1756
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1757
- let ringColorDefault = withAlphaValue(
1758
- theme('ringColor.DEFAULT'),
1759
- ringOpacityDefault,
1760
- `rgb(147 197 253 / ${ringOpacityDefault})`
1761
- )
1762
-
1763
- addBase({
1764
- '@defaults ring-width': {
1765
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1766
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1767
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1768
- '--tw-ring-color': ringColorDefault,
1769
- '--tw-ring-offset-shadow': '0 0 #0000',
1770
- '--tw-ring-shadow': '0 0 #0000',
1771
- '--tw-shadow': '0 0 #0000',
1772
- },
1773
- })
1774
-
1775
- matchUtilities(
1776
- {
1777
- ring: (value) => {
1778
- return {
1779
- '@defaults ring-width': {},
1780
- '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`,
1781
- '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(${value} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,
1782
- 'box-shadow': [
1783
- `var(--tw-ring-offset-shadow)`,
1784
- `var(--tw-ring-shadow)`,
1785
- `var(--tw-shadow, 0 0 #0000)`,
1786
- ].join(', '),
1787
- }
1892
+ outlineWidth: createUtilityPlugin('outlineWidth', [['outline', ['outline-width']]], {
1893
+ type: ['length', 'number', 'percentage'],
1894
+ }),
1895
+
1896
+ outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1897
+ type: ['length', 'number', 'percentage'],
1898
+ }),
1899
+
1900
+ outlineColor: ({ matchUtilities, theme }) => {
1901
+ matchUtilities(
1902
+ {
1903
+ outline: (value) => {
1904
+ return { 'outline-color': toColorValue(value) }
1905
+ },
1788
1906
  },
1789
- },
1790
- { values: theme('ringWidth'), type: 'length' }
1791
- )
1907
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
1908
+ )
1909
+ },
1910
+
1911
+ ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1912
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1913
+ let ringColorDefault = withAlphaValue(
1914
+ theme('ringColor.DEFAULT'),
1915
+ ringOpacityDefault,
1916
+ `rgb(147 197 253 / ${ringOpacityDefault})`
1917
+ )
1792
1918
 
1793
- addUtilities({
1794
- '.ring-inset': { '@defaults ring-width': {}, '--tw-ring-inset': 'inset' },
1795
- })
1796
- }
1919
+ addBase({
1920
+ '@defaults ring-width': {
1921
+ '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1922
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1923
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1924
+ '--tw-ring-color': ringColorDefault,
1925
+ '--tw-ring-offset-shadow': '0 0 #0000',
1926
+ '--tw-ring-shadow': '0 0 #0000',
1927
+ '--tw-shadow': '0 0 #0000',
1928
+ '--tw-shadow-colored': '0 0 #0000',
1929
+ },
1930
+ })
1797
1931
 
1798
- export let ringColor = ({ matchUtilities, theme }) => {
1799
- matchUtilities(
1800
- {
1801
- ring: (value) => {
1802
- return withAlphaVariable({
1803
- color: value,
1804
- property: '--tw-ring-color',
1805
- variable: '--tw-ring-opacity',
1806
- })
1932
+ matchUtilities(
1933
+ {
1934
+ ring: (value) => {
1935
+ return {
1936
+ '@defaults ring-width': {},
1937
+ '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`,
1938
+ '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(${value} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,
1939
+ 'box-shadow': [
1940
+ `var(--tw-ring-offset-shadow)`,
1941
+ `var(--tw-ring-shadow)`,
1942
+ `var(--tw-shadow, 0 0 #0000)`,
1943
+ ].join(', '),
1944
+ }
1945
+ },
1807
1946
  },
1808
- },
1809
- {
1810
- values: Object.fromEntries(
1811
- Object.entries(flattenColorPalette(theme('ringColor'))).filter(
1812
- ([modifier]) => modifier !== 'DEFAULT'
1813
- )
1814
- ),
1815
- type: 'color',
1816
- }
1817
- )
1818
- }
1947
+ { values: theme('ringWidth'), type: 'length' }
1948
+ )
1819
1949
 
1820
- export let ringOpacity = createUtilityPlugin(
1821
- 'ringOpacity',
1822
- [['ring-opacity', ['--tw-ring-opacity']]],
1823
- { filterDefault: true }
1824
- )
1825
- export let ringOffsetWidth = createUtilityPlugin(
1826
- 'ringOffsetWidth',
1827
- [['ring-offset', ['--tw-ring-offset-width']]],
1828
- { resolveArbitraryValue: asLength }
1829
- )
1830
-
1831
- export let ringOffsetColor = ({ matchUtilities, theme }) => {
1832
- matchUtilities(
1833
- {
1834
- 'ring-offset': (value) => {
1835
- return {
1836
- '--tw-ring-offset-color': toColorValue(value),
1837
- }
1950
+ addUtilities({
1951
+ '.ring-inset': { '@defaults ring-width': {}, '--tw-ring-inset': 'inset' },
1952
+ })
1953
+ },
1954
+
1955
+ ringColor: ({ matchUtilities, theme }) => {
1956
+ matchUtilities(
1957
+ {
1958
+ ring: (value) => {
1959
+ return withAlphaVariable({
1960
+ color: value,
1961
+ property: '--tw-ring-color',
1962
+ variable: '--tw-ring-opacity',
1963
+ })
1964
+ },
1838
1965
  },
1839
- },
1840
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
1841
- )
1842
- }
1966
+ {
1967
+ values: Object.fromEntries(
1968
+ Object.entries(flattenColorPalette(theme('ringColor'))).filter(
1969
+ ([modifier]) => modifier !== 'DEFAULT'
1970
+ )
1971
+ ),
1972
+ type: 'color',
1973
+ }
1974
+ )
1975
+ },
1976
+
1977
+ ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1978
+ filterDefault: true,
1979
+ }),
1980
+ ringOffsetWidth: createUtilityPlugin(
1981
+ 'ringOffsetWidth',
1982
+ [['ring-offset', ['--tw-ring-offset-width']]],
1983
+ { type: 'length' }
1984
+ ),
1985
+
1986
+ ringOffsetColor: ({ matchUtilities, theme }) => {
1987
+ matchUtilities(
1988
+ {
1989
+ 'ring-offset': (value) => {
1990
+ return {
1991
+ '--tw-ring-offset-color': toColorValue(value),
1992
+ }
1993
+ },
1994
+ },
1995
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
1996
+ )
1997
+ },
1843
1998
 
1844
- export let blur = ({ matchUtilities, theme }) => {
1845
- matchUtilities(
1846
- {
1847
- blur: (value) => {
1848
- return {
1849
- '--tw-blur': `blur(${value})`,
1850
- '@defaults filter': {},
1851
- filter: 'var(--tw-filter)',
1852
- }
1999
+ blur: ({ matchUtilities, theme }) => {
2000
+ matchUtilities(
2001
+ {
2002
+ blur: (value) => {
2003
+ return {
2004
+ '--tw-blur': `blur(${value})`,
2005
+ '@defaults filter': {},
2006
+ filter: 'var(--tw-filter)',
2007
+ }
2008
+ },
1853
2009
  },
1854
- },
1855
- { values: theme('blur'), type: 'any' }
1856
- )
1857
- }
2010
+ { values: theme('blur') }
2011
+ )
2012
+ },
1858
2013
 
1859
- export let brightness = ({ matchUtilities, theme }) => {
1860
- matchUtilities(
1861
- {
1862
- brightness: (value) => {
1863
- return {
1864
- '--tw-brightness': `brightness(${value})`,
1865
- '@defaults filter': {},
1866
- filter: 'var(--tw-filter)',
1867
- }
2014
+ brightness: ({ matchUtilities, theme }) => {
2015
+ matchUtilities(
2016
+ {
2017
+ brightness: (value) => {
2018
+ return {
2019
+ '--tw-brightness': `brightness(${value})`,
2020
+ '@defaults filter': {},
2021
+ filter: 'var(--tw-filter)',
2022
+ }
2023
+ },
1868
2024
  },
1869
- },
1870
- { values: theme('brightness'), type: 'any' }
1871
- )
1872
- }
2025
+ { values: theme('brightness') }
2026
+ )
2027
+ },
1873
2028
 
1874
- export let contrast = ({ matchUtilities, theme }) => {
1875
- matchUtilities(
1876
- {
1877
- contrast: (value) => {
1878
- return {
1879
- '--tw-contrast': `contrast(${value})`,
1880
- '@defaults filter': {},
1881
- filter: 'var(--tw-filter)',
1882
- }
2029
+ contrast: ({ matchUtilities, theme }) => {
2030
+ matchUtilities(
2031
+ {
2032
+ contrast: (value) => {
2033
+ return {
2034
+ '--tw-contrast': `contrast(${value})`,
2035
+ '@defaults filter': {},
2036
+ filter: 'var(--tw-filter)',
2037
+ }
2038
+ },
1883
2039
  },
1884
- },
1885
- { values: theme('contrast'), type: 'any' }
1886
- )
1887
- }
2040
+ { values: theme('contrast') }
2041
+ )
2042
+ },
1888
2043
 
1889
- export let dropShadow = ({ matchUtilities, theme }) => {
1890
- matchUtilities(
1891
- {
1892
- 'drop-shadow': (value) => {
1893
- return {
1894
- '--tw-drop-shadow': Array.isArray(value)
1895
- ? value.map((v) => `drop-shadow(${v})`).join(' ')
1896
- : `drop-shadow(${value})`,
1897
- '@defaults filter': {},
1898
- filter: 'var(--tw-filter)',
1899
- }
2044
+ dropShadow: ({ matchUtilities, theme }) => {
2045
+ matchUtilities(
2046
+ {
2047
+ 'drop-shadow': (value) => {
2048
+ return {
2049
+ '--tw-drop-shadow': Array.isArray(value)
2050
+ ? value.map((v) => `drop-shadow(${v})`).join(' ')
2051
+ : `drop-shadow(${value})`,
2052
+ '@defaults filter': {},
2053
+ filter: 'var(--tw-filter)',
2054
+ }
2055
+ },
1900
2056
  },
1901
- },
1902
- { values: theme('dropShadow') }
1903
- )
1904
- }
2057
+ { values: theme('dropShadow') }
2058
+ )
2059
+ },
1905
2060
 
1906
- export let grayscale = ({ matchUtilities, theme }) => {
1907
- matchUtilities(
1908
- {
1909
- grayscale: (value) => {
1910
- return {
1911
- '--tw-grayscale': `grayscale(${value})`,
1912
- '@defaults filter': {},
1913
- filter: 'var(--tw-filter)',
1914
- }
2061
+ grayscale: ({ matchUtilities, theme }) => {
2062
+ matchUtilities(
2063
+ {
2064
+ grayscale: (value) => {
2065
+ return {
2066
+ '--tw-grayscale': `grayscale(${value})`,
2067
+ '@defaults filter': {},
2068
+ filter: 'var(--tw-filter)',
2069
+ }
2070
+ },
1915
2071
  },
1916
- },
1917
- { values: theme('grayscale'), type: 'any' }
1918
- )
1919
- }
2072
+ { values: theme('grayscale') }
2073
+ )
2074
+ },
1920
2075
 
1921
- export let hueRotate = ({ matchUtilities, theme }) => {
1922
- matchUtilities(
1923
- {
1924
- 'hue-rotate': (value) => {
1925
- return {
1926
- '--tw-hue-rotate': `hue-rotate(${value})`,
1927
- '@defaults filter': {},
1928
- filter: 'var(--tw-filter)',
1929
- }
2076
+ hueRotate: ({ matchUtilities, theme }) => {
2077
+ matchUtilities(
2078
+ {
2079
+ 'hue-rotate': (value) => {
2080
+ return {
2081
+ '--tw-hue-rotate': `hue-rotate(${value})`,
2082
+ '@defaults filter': {},
2083
+ filter: 'var(--tw-filter)',
2084
+ }
2085
+ },
1930
2086
  },
1931
- },
1932
- { values: theme('hueRotate'), type: 'any' }
1933
- )
1934
- }
2087
+ { values: theme('hueRotate'), supportsNegativeValues: true }
2088
+ )
2089
+ },
1935
2090
 
1936
- export let invert = ({ matchUtilities, theme }) => {
1937
- matchUtilities(
1938
- {
1939
- invert: (value) => {
1940
- return {
1941
- '--tw-invert': `invert(${value})`,
1942
- '@defaults filter': {},
1943
- filter: 'var(--tw-filter)',
1944
- }
2091
+ invert: ({ matchUtilities, theme }) => {
2092
+ matchUtilities(
2093
+ {
2094
+ invert: (value) => {
2095
+ return {
2096
+ '--tw-invert': `invert(${value})`,
2097
+ '@defaults filter': {},
2098
+ filter: 'var(--tw-filter)',
2099
+ }
2100
+ },
1945
2101
  },
1946
- },
1947
- { values: theme('invert'), type: 'any' }
1948
- )
1949
- }
2102
+ { values: theme('invert') }
2103
+ )
2104
+ },
1950
2105
 
1951
- export let saturate = ({ matchUtilities, theme }) => {
1952
- matchUtilities(
1953
- {
1954
- saturate: (value) => {
1955
- return {
1956
- '--tw-saturate': `saturate(${value})`,
1957
- '@defaults filter': {},
1958
- filter: 'var(--tw-filter)',
1959
- }
2106
+ saturate: ({ matchUtilities, theme }) => {
2107
+ matchUtilities(
2108
+ {
2109
+ saturate: (value) => {
2110
+ return {
2111
+ '--tw-saturate': `saturate(${value})`,
2112
+ '@defaults filter': {},
2113
+ filter: 'var(--tw-filter)',
2114
+ }
2115
+ },
1960
2116
  },
1961
- },
1962
- { values: theme('saturate'), type: 'any' }
1963
- )
1964
- }
2117
+ { values: theme('saturate') }
2118
+ )
2119
+ },
1965
2120
 
1966
- export let sepia = ({ matchUtilities, theme }) => {
1967
- matchUtilities(
1968
- {
1969
- sepia: (value) => {
1970
- return {
1971
- '--tw-sepia': `sepia(${value})`,
1972
- '@defaults filter': {},
1973
- filter: 'var(--tw-filter)',
1974
- }
2121
+ sepia: ({ matchUtilities, theme }) => {
2122
+ matchUtilities(
2123
+ {
2124
+ sepia: (value) => {
2125
+ return {
2126
+ '--tw-sepia': `sepia(${value})`,
2127
+ '@defaults filter': {},
2128
+ filter: 'var(--tw-filter)',
2129
+ }
2130
+ },
1975
2131
  },
1976
- },
1977
- { values: theme('sepia'), type: 'any' }
1978
- )
1979
- }
2132
+ { values: theme('sepia') }
2133
+ )
2134
+ },
1980
2135
 
1981
- export let filter = ({ addBase, addUtilities }) => {
1982
- addBase({
1983
- '@defaults filter': {
1984
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
1985
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
1986
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
1987
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
1988
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
1989
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
1990
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
1991
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
1992
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
1993
- '--tw-filter': [
1994
- 'var(--tw-blur)',
1995
- 'var(--tw-brightness)',
1996
- 'var(--tw-contrast)',
1997
- 'var(--tw-grayscale)',
1998
- 'var(--tw-hue-rotate)',
1999
- 'var(--tw-invert)',
2000
- 'var(--tw-saturate)',
2001
- 'var(--tw-sepia)',
2002
- 'var(--tw-drop-shadow)',
2003
- ].join(' '),
2004
- },
2005
- })
2006
- addUtilities({
2007
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2008
- '.filter-none': { filter: 'none' },
2009
- })
2010
- }
2136
+ filter: ({ addBase, addUtilities }) => {
2137
+ addBase({
2138
+ '@defaults filter': {
2139
+ '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2140
+ '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2141
+ '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2142
+ '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2143
+ '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2144
+ '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2145
+ '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2146
+ '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2147
+ '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2148
+ '--tw-filter': [
2149
+ 'var(--tw-blur)',
2150
+ 'var(--tw-brightness)',
2151
+ 'var(--tw-contrast)',
2152
+ 'var(--tw-grayscale)',
2153
+ 'var(--tw-hue-rotate)',
2154
+ 'var(--tw-invert)',
2155
+ 'var(--tw-saturate)',
2156
+ 'var(--tw-sepia)',
2157
+ 'var(--tw-drop-shadow)',
2158
+ ].join(' '),
2159
+ },
2160
+ })
2161
+ addUtilities({
2162
+ '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2163
+ '.filter-none': { filter: 'none' },
2164
+ })
2165
+ },
2011
2166
 
2012
- export let backdropBlur = ({ matchUtilities, theme }) => {
2013
- matchUtilities(
2014
- {
2015
- 'backdrop-blur': (value) => {
2016
- return {
2017
- '--tw-backdrop-blur': `blur(${value})`,
2018
- '@defaults backdrop-filter': {},
2019
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2020
- }
2167
+ backdropBlur: ({ matchUtilities, theme }) => {
2168
+ matchUtilities(
2169
+ {
2170
+ 'backdrop-blur': (value) => {
2171
+ return {
2172
+ '--tw-backdrop-blur': `blur(${value})`,
2173
+ '@defaults backdrop-filter': {},
2174
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2175
+ }
2176
+ },
2021
2177
  },
2022
- },
2023
- { values: theme('backdropBlur'), type: 'any' }
2024
- )
2025
- }
2178
+ { values: theme('backdropBlur') }
2179
+ )
2180
+ },
2026
2181
 
2027
- export let backdropBrightness = ({ matchUtilities, theme }) => {
2028
- matchUtilities(
2029
- {
2030
- 'backdrop-brightness': (value) => {
2031
- return {
2032
- '--tw-backdrop-brightness': `brightness(${value})`,
2033
- '@defaults backdrop-filter': {},
2034
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2035
- }
2182
+ backdropBrightness: ({ matchUtilities, theme }) => {
2183
+ matchUtilities(
2184
+ {
2185
+ 'backdrop-brightness': (value) => {
2186
+ return {
2187
+ '--tw-backdrop-brightness': `brightness(${value})`,
2188
+ '@defaults backdrop-filter': {},
2189
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2190
+ }
2191
+ },
2036
2192
  },
2037
- },
2038
- { values: theme('backdropBrightness'), type: 'any' }
2039
- )
2040
- }
2193
+ { values: theme('backdropBrightness') }
2194
+ )
2195
+ },
2041
2196
 
2042
- export let backdropContrast = ({ matchUtilities, theme }) => {
2043
- matchUtilities(
2044
- {
2045
- 'backdrop-contrast': (value) => {
2046
- return {
2047
- '--tw-backdrop-contrast': `contrast(${value})`,
2048
- '@defaults backdrop-filter': {},
2049
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2050
- }
2197
+ backdropContrast: ({ matchUtilities, theme }) => {
2198
+ matchUtilities(
2199
+ {
2200
+ 'backdrop-contrast': (value) => {
2201
+ return {
2202
+ '--tw-backdrop-contrast': `contrast(${value})`,
2203
+ '@defaults backdrop-filter': {},
2204
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2205
+ }
2206
+ },
2051
2207
  },
2052
- },
2053
- { values: theme('backdropContrast'), type: 'any' }
2054
- )
2055
- }
2208
+ { values: theme('backdropContrast') }
2209
+ )
2210
+ },
2056
2211
 
2057
- export let backdropGrayscale = ({ matchUtilities, theme }) => {
2058
- matchUtilities(
2059
- {
2060
- 'backdrop-grayscale': (value) => {
2061
- return {
2062
- '--tw-backdrop-grayscale': `grayscale(${value})`,
2063
- '@defaults backdrop-filter': {},
2064
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2065
- }
2212
+ backdropGrayscale: ({ matchUtilities, theme }) => {
2213
+ matchUtilities(
2214
+ {
2215
+ 'backdrop-grayscale': (value) => {
2216
+ return {
2217
+ '--tw-backdrop-grayscale': `grayscale(${value})`,
2218
+ '@defaults backdrop-filter': {},
2219
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2220
+ }
2221
+ },
2066
2222
  },
2067
- },
2068
- { values: theme('backdropGrayscale'), type: 'any' }
2069
- )
2070
- }
2223
+ { values: theme('backdropGrayscale') }
2224
+ )
2225
+ },
2071
2226
 
2072
- export let backdropHueRotate = ({ matchUtilities, theme }) => {
2073
- matchUtilities(
2074
- {
2075
- 'backdrop-hue-rotate': (value) => {
2076
- return {
2077
- '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2078
- '@defaults backdrop-filter': {},
2079
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2080
- }
2227
+ backdropHueRotate: ({ matchUtilities, theme }) => {
2228
+ matchUtilities(
2229
+ {
2230
+ 'backdrop-hue-rotate': (value) => {
2231
+ return {
2232
+ '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2233
+ '@defaults backdrop-filter': {},
2234
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2235
+ }
2236
+ },
2081
2237
  },
2082
- },
2083
- { values: theme('backdropHueRotate'), type: 'any' }
2084
- )
2085
- }
2238
+ { values: theme('backdropHueRotate'), supportsNegativeValues: true }
2239
+ )
2240
+ },
2086
2241
 
2087
- export let backdropInvert = ({ matchUtilities, theme }) => {
2088
- matchUtilities(
2089
- {
2090
- 'backdrop-invert': (value) => {
2091
- return {
2092
- '--tw-backdrop-invert': `invert(${value})`,
2093
- '@defaults backdrop-filter': {},
2094
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2095
- }
2242
+ backdropInvert: ({ matchUtilities, theme }) => {
2243
+ matchUtilities(
2244
+ {
2245
+ 'backdrop-invert': (value) => {
2246
+ return {
2247
+ '--tw-backdrop-invert': `invert(${value})`,
2248
+ '@defaults backdrop-filter': {},
2249
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2250
+ }
2251
+ },
2096
2252
  },
2097
- },
2098
- { values: theme('backdropInvert'), type: 'any' }
2099
- )
2100
- }
2253
+ { values: theme('backdropInvert') }
2254
+ )
2255
+ },
2101
2256
 
2102
- export let backdropOpacity = ({ matchUtilities, theme }) => {
2103
- matchUtilities(
2104
- {
2105
- 'backdrop-opacity': (value) => {
2106
- return {
2107
- '--tw-backdrop-opacity': `opacity(${value})`,
2108
- '@defaults backdrop-filter': {},
2109
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2110
- }
2257
+ backdropOpacity: ({ matchUtilities, theme }) => {
2258
+ matchUtilities(
2259
+ {
2260
+ 'backdrop-opacity': (value) => {
2261
+ return {
2262
+ '--tw-backdrop-opacity': `opacity(${value})`,
2263
+ '@defaults backdrop-filter': {},
2264
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2265
+ }
2266
+ },
2111
2267
  },
2112
- },
2113
- { values: theme('backdropOpacity'), type: 'any' }
2114
- )
2115
- }
2268
+ { values: theme('backdropOpacity') }
2269
+ )
2270
+ },
2116
2271
 
2117
- export let backdropSaturate = ({ matchUtilities, theme }) => {
2118
- matchUtilities(
2119
- {
2120
- 'backdrop-saturate': (value) => {
2121
- return {
2122
- '--tw-backdrop-saturate': `saturate(${value})`,
2123
- '@defaults backdrop-filter': {},
2124
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2125
- }
2272
+ backdropSaturate: ({ matchUtilities, theme }) => {
2273
+ matchUtilities(
2274
+ {
2275
+ 'backdrop-saturate': (value) => {
2276
+ return {
2277
+ '--tw-backdrop-saturate': `saturate(${value})`,
2278
+ '@defaults backdrop-filter': {},
2279
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2280
+ }
2281
+ },
2126
2282
  },
2127
- },
2128
- { values: theme('backdropSaturate'), type: 'any' }
2129
- )
2130
- }
2283
+ { values: theme('backdropSaturate') }
2284
+ )
2285
+ },
2131
2286
 
2132
- export let backdropSepia = ({ matchUtilities, theme }) => {
2133
- matchUtilities(
2134
- {
2135
- 'backdrop-sepia': (value) => {
2136
- return {
2137
- '--tw-backdrop-sepia': `sepia(${value})`,
2138
- '@defaults backdrop-filter': {},
2139
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2140
- }
2287
+ backdropSepia: ({ matchUtilities, theme }) => {
2288
+ matchUtilities(
2289
+ {
2290
+ 'backdrop-sepia': (value) => {
2291
+ return {
2292
+ '--tw-backdrop-sepia': `sepia(${value})`,
2293
+ '@defaults backdrop-filter': {},
2294
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2295
+ }
2296
+ },
2141
2297
  },
2142
- },
2143
- { values: theme('backdropSepia'), type: 'any' }
2144
- )
2145
- }
2298
+ { values: theme('backdropSepia') }
2299
+ )
2300
+ },
2146
2301
 
2147
- export let backdropFilter = ({ addBase, addUtilities }) => {
2148
- addBase({
2149
- '@defaults backdrop-filter': {
2150
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2151
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2152
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2153
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2154
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2155
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2156
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2157
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2158
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2159
- '--tw-backdrop-filter': [
2160
- 'var(--tw-backdrop-blur)',
2161
- 'var(--tw-backdrop-brightness)',
2162
- 'var(--tw-backdrop-contrast)',
2163
- 'var(--tw-backdrop-grayscale)',
2164
- 'var(--tw-backdrop-hue-rotate)',
2165
- 'var(--tw-backdrop-invert)',
2166
- 'var(--tw-backdrop-opacity)',
2167
- 'var(--tw-backdrop-saturate)',
2168
- 'var(--tw-backdrop-sepia)',
2169
- ].join(' '),
2170
- },
2171
- })
2172
- addUtilities({
2173
- '.backdrop-filter': {
2174
- '@defaults backdrop-filter': {},
2175
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2176
- },
2177
- '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2178
- })
2179
- }
2302
+ backdropFilter: ({ addBase, addUtilities }) => {
2303
+ addBase({
2304
+ '@defaults backdrop-filter': {
2305
+ '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2306
+ '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2307
+ '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2308
+ '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2309
+ '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2310
+ '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2311
+ '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2312
+ '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2313
+ '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2314
+ '--tw-backdrop-filter': [
2315
+ 'var(--tw-backdrop-blur)',
2316
+ 'var(--tw-backdrop-brightness)',
2317
+ 'var(--tw-backdrop-contrast)',
2318
+ 'var(--tw-backdrop-grayscale)',
2319
+ 'var(--tw-backdrop-hue-rotate)',
2320
+ 'var(--tw-backdrop-invert)',
2321
+ 'var(--tw-backdrop-opacity)',
2322
+ 'var(--tw-backdrop-saturate)',
2323
+ 'var(--tw-backdrop-sepia)',
2324
+ ].join(' '),
2325
+ },
2326
+ })
2327
+ addUtilities({
2328
+ '.backdrop-filter': {
2329
+ '@defaults backdrop-filter': {},
2330
+ 'backdrop-filter': 'var(--tw-backdrop-filter)',
2331
+ },
2332
+ '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2333
+ })
2334
+ },
2180
2335
 
2181
- export let transitionProperty = ({ matchUtilities, theme }) => {
2182
- let defaultTimingFunction = theme('transitionTimingFunction.DEFAULT')
2183
- let defaultDuration = theme('transitionDuration.DEFAULT')
2336
+ transitionProperty: ({ matchUtilities, theme }) => {
2337
+ let defaultTimingFunction = theme('transitionTimingFunction.DEFAULT')
2338
+ let defaultDuration = theme('transitionDuration.DEFAULT')
2184
2339
 
2185
- matchUtilities(
2186
- {
2187
- transition: (value) => {
2188
- return {
2189
- 'transition-property': value,
2190
- ...(value === 'none'
2191
- ? {}
2192
- : {
2193
- 'transition-timing-function': defaultTimingFunction,
2194
- 'transition-duration': defaultDuration,
2195
- }),
2196
- }
2340
+ matchUtilities(
2341
+ {
2342
+ transition: (value) => {
2343
+ return {
2344
+ 'transition-property': value,
2345
+ ...(value === 'none'
2346
+ ? {}
2347
+ : {
2348
+ 'transition-timing-function': defaultTimingFunction,
2349
+ 'transition-duration': defaultDuration,
2350
+ }),
2351
+ }
2352
+ },
2197
2353
  },
2198
- },
2199
- { values: theme('transitionProperty'), type: 'any' }
2200
- )
2354
+ { values: theme('transitionProperty') }
2355
+ )
2356
+ },
2357
+
2358
+ transitionDelay: createUtilityPlugin('transitionDelay', [['delay', ['transitionDelay']]]),
2359
+ transitionDuration: createUtilityPlugin(
2360
+ 'transitionDuration',
2361
+ [['duration', ['transitionDuration']]],
2362
+ { filterDefault: true }
2363
+ ),
2364
+ transitionTimingFunction: createUtilityPlugin(
2365
+ 'transitionTimingFunction',
2366
+ [['ease', ['transitionTimingFunction']]],
2367
+ { filterDefault: true }
2368
+ ),
2369
+ willChange: createUtilityPlugin('willChange', [['will-change', ['will-change']]]),
2370
+ content: createUtilityPlugin('content', [
2371
+ ['content', ['--tw-content', ['content', 'var(--tw-content)']]],
2372
+ ]),
2201
2373
  }
2202
-
2203
- export let transitionDelay = createUtilityPlugin('transitionDelay', [
2204
- ['delay', ['transitionDelay']],
2205
- ])
2206
- export let transitionDuration = createUtilityPlugin(
2207
- 'transitionDuration',
2208
- [['duration', ['transitionDuration']]],
2209
- { filterDefault: true }
2210
- )
2211
- export let transitionTimingFunction = createUtilityPlugin(
2212
- 'transitionTimingFunction',
2213
- [['ease', ['transitionTimingFunction']]],
2214
- { filterDefault: true }
2215
- )
2216
- export let willChange = createUtilityPlugin('willChange', [['will-change', ['will-change']]])
2217
- export let content = createUtilityPlugin('content')