tailwindcss 0.0.0-insiders.fda68f7 → 0.0.0-oxide.6bf5e56

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