tailwindcss 0.0.0-insiders.f4635e0 → 0.0.0-insiders.f4a2ccd

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