tailwindcss 0.0.0-insiders.fb545bc → 0.0.0-insiders.fb796cd

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 (226) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +15 -7
  3. package/colors.d.ts +3 -0
  4. package/defaultConfig.d.ts +3 -0
  5. package/defaultTheme.d.ts +4 -0
  6. package/lib/cli/build/deps.js +54 -0
  7. package/lib/cli/build/index.js +52 -0
  8. package/lib/cli/build/plugin.js +376 -0
  9. package/lib/cli/build/utils.js +78 -0
  10. package/lib/cli/build/watching.js +180 -0
  11. package/lib/cli/help/index.js +71 -0
  12. package/lib/cli/index.js +230 -0
  13. package/lib/cli/init/index.js +61 -0
  14. package/lib/cli-peer-dependencies.js +20 -7
  15. package/lib/cli.js +4 -703
  16. package/lib/corePluginList.js +10 -3
  17. package/lib/corePlugins.js +2322 -1835
  18. package/lib/css/preflight.css +8 -6
  19. package/lib/featureFlags.js +43 -27
  20. package/lib/index.js +4 -30
  21. package/lib/lib/cacheInvalidation.js +90 -0
  22. package/lib/lib/collapseAdjacentRules.js +28 -10
  23. package/lib/lib/collapseDuplicateDeclarations.js +58 -4
  24. package/lib/lib/content.js +177 -0
  25. package/lib/lib/defaultExtractor.js +241 -0
  26. package/lib/lib/detectNesting.js +19 -10
  27. package/lib/lib/evaluateTailwindFunctions.js +118 -55
  28. package/lib/lib/expandApplyAtRules.js +458 -176
  29. package/lib/lib/expandTailwindAtRules.js +157 -156
  30. package/lib/lib/findAtConfigPath.js +44 -0
  31. package/lib/lib/generateRules.js +533 -204
  32. package/lib/lib/getModuleDependencies.js +85 -36
  33. package/lib/lib/load-config.js +36 -0
  34. package/lib/lib/normalizeTailwindDirectives.js +43 -32
  35. package/lib/lib/offsets.js +304 -0
  36. package/lib/lib/partitionApplyAtRules.js +56 -0
  37. package/lib/lib/regex.js +60 -0
  38. package/lib/lib/remap-bitfield.js +87 -0
  39. package/lib/lib/resolveDefaultsAtRules.js +89 -67
  40. package/lib/lib/setupContextUtils.js +754 -346
  41. package/lib/lib/setupTrackingContext.js +65 -72
  42. package/lib/lib/sharedState.js +68 -9
  43. package/lib/lib/substituteScreenAtRules.js +11 -9
  44. package/lib/oxide/cli/build/deps.js +81 -0
  45. package/lib/oxide/cli/build/index.js +51 -0
  46. package/lib/oxide/cli/build/plugin.js +373 -0
  47. package/lib/oxide/cli/build/utils.js +77 -0
  48. package/lib/oxide/cli/build/watching.js +177 -0
  49. package/lib/oxide/cli/help/index.js +70 -0
  50. package/lib/oxide/cli/index.js +214 -0
  51. package/lib/oxide/cli/init/index.js +50 -0
  52. package/lib/oxide/cli.js +5 -0
  53. package/lib/oxide/postcss-plugin.js +2 -0
  54. package/lib/plugin.js +98 -0
  55. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  56. package/lib/postcss-plugins/nesting/index.js +19 -0
  57. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  58. package/lib/processTailwindFeatures.js +36 -25
  59. package/lib/public/colors.js +269 -245
  60. package/lib/public/create-plugin.js +6 -4
  61. package/lib/public/default-config.js +7 -5
  62. package/lib/public/default-theme.js +7 -5
  63. package/lib/public/load-config.js +10 -0
  64. package/lib/public/resolve-config.js +8 -5
  65. package/lib/util/applyImportantSelector.js +22 -0
  66. package/lib/util/bigSign.js +4 -1
  67. package/lib/util/buildMediaQuery.js +11 -6
  68. package/lib/util/cloneDeep.js +7 -6
  69. package/lib/util/cloneNodes.js +21 -3
  70. package/lib/util/color.js +64 -36
  71. package/lib/util/configurePlugins.js +5 -2
  72. package/lib/util/createPlugin.js +6 -6
  73. package/lib/util/createUtilityPlugin.js +13 -15
  74. package/lib/util/dataTypes.js +143 -110
  75. package/lib/util/defaults.js +8 -5
  76. package/lib/util/escapeClassName.js +9 -6
  77. package/lib/util/escapeCommas.js +5 -2
  78. package/lib/util/flattenColorPalette.js +9 -12
  79. package/lib/util/formatVariantSelector.js +268 -113
  80. package/lib/util/getAllConfigs.js +30 -11
  81. package/lib/util/hashConfig.js +6 -3
  82. package/lib/util/isKeyframeRule.js +5 -2
  83. package/lib/util/isPlainObject.js +5 -2
  84. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +23 -15
  85. package/lib/util/log.js +20 -14
  86. package/lib/util/nameClass.js +20 -9
  87. package/lib/util/negateValue.js +23 -8
  88. package/lib/util/normalizeConfig.js +140 -83
  89. package/lib/util/normalizeScreens.js +120 -11
  90. package/lib/util/parseAnimationValue.js +42 -40
  91. package/lib/util/parseBoxShadowValue.js +30 -23
  92. package/lib/util/parseDependency.js +38 -56
  93. package/lib/util/parseGlob.js +34 -0
  94. package/lib/util/parseObjectStyles.js +11 -8
  95. package/lib/util/pluginUtils.js +146 -68
  96. package/lib/util/prefixSelector.js +27 -11
  97. package/lib/util/removeAlphaVariables.js +29 -0
  98. package/lib/util/resolveConfig.js +98 -78
  99. package/lib/util/resolveConfigPath.js +25 -11
  100. package/lib/util/responsive.js +8 -5
  101. package/lib/util/splitAtTopLevelOnly.js +49 -0
  102. package/lib/util/tap.js +4 -1
  103. package/lib/util/toColorValue.js +5 -3
  104. package/lib/util/toPath.js +24 -3
  105. package/lib/util/transformThemeValue.js +37 -29
  106. package/lib/util/validateConfig.js +24 -0
  107. package/lib/util/validateFormalSyntax.js +24 -0
  108. package/lib/util/withAlphaVariable.js +23 -15
  109. package/loadConfig.d.ts +4 -0
  110. package/loadConfig.js +2 -0
  111. package/nesting/index.js +2 -12
  112. package/package.json +62 -50
  113. package/peers/index.js +11585 -8231
  114. package/plugin.d.ts +11 -0
  115. package/resolveConfig.d.ts +12 -0
  116. package/scripts/generate-types.js +105 -0
  117. package/scripts/release-channel.js +18 -0
  118. package/scripts/release-notes.js +21 -0
  119. package/scripts/swap-engines.js +40 -0
  120. package/scripts/type-utils.js +27 -0
  121. package/src/cli/build/deps.js +56 -0
  122. package/src/cli/build/index.js +49 -0
  123. package/src/cli/build/plugin.js +444 -0
  124. package/src/cli/build/utils.js +76 -0
  125. package/src/cli/build/watching.js +229 -0
  126. package/src/cli/help/index.js +70 -0
  127. package/src/cli/index.js +216 -0
  128. package/src/cli/init/index.js +79 -0
  129. package/src/cli-peer-dependencies.js +7 -1
  130. package/src/cli.js +4 -765
  131. package/src/corePluginList.js +1 -1
  132. package/src/corePlugins.js +675 -236
  133. package/src/css/preflight.css +8 -6
  134. package/src/featureFlags.js +22 -9
  135. package/src/index.js +4 -33
  136. package/src/lib/cacheInvalidation.js +52 -0
  137. package/src/lib/collapseAdjacentRules.js +21 -2
  138. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  139. package/src/lib/content.js +208 -0
  140. package/src/lib/defaultExtractor.js +217 -0
  141. package/src/lib/detectNesting.js +9 -1
  142. package/src/lib/evaluateTailwindFunctions.js +79 -8
  143. package/src/lib/expandApplyAtRules.js +502 -173
  144. package/src/lib/expandTailwindAtRules.js +112 -106
  145. package/src/lib/findAtConfigPath.js +48 -0
  146. package/src/lib/generateRules.js +521 -146
  147. package/src/lib/getModuleDependencies.js +70 -30
  148. package/src/lib/load-config.ts +27 -0
  149. package/src/lib/normalizeTailwindDirectives.js +7 -1
  150. package/src/lib/offsets.js +373 -0
  151. package/src/lib/partitionApplyAtRules.js +52 -0
  152. package/src/lib/regex.js +74 -0
  153. package/src/lib/remap-bitfield.js +82 -0
  154. package/src/lib/resolveDefaultsAtRules.js +51 -30
  155. package/src/lib/setupContextUtils.js +677 -184
  156. package/src/lib/setupTrackingContext.js +50 -61
  157. package/src/lib/sharedState.js +61 -4
  158. package/src/oxide/cli/build/deps.ts +91 -0
  159. package/src/oxide/cli/build/index.ts +47 -0
  160. package/src/oxide/cli/build/plugin.ts +442 -0
  161. package/src/oxide/cli/build/utils.ts +74 -0
  162. package/src/oxide/cli/build/watching.ts +225 -0
  163. package/src/oxide/cli/help/index.ts +69 -0
  164. package/src/oxide/cli/index.ts +204 -0
  165. package/src/oxide/cli/init/index.ts +59 -0
  166. package/src/oxide/cli.ts +1 -0
  167. package/src/oxide/postcss-plugin.ts +1 -0
  168. package/src/plugin.js +107 -0
  169. package/src/postcss-plugins/nesting/README.md +42 -0
  170. package/src/postcss-plugins/nesting/index.js +13 -0
  171. package/src/postcss-plugins/nesting/plugin.js +80 -0
  172. package/src/processTailwindFeatures.js +12 -2
  173. package/src/public/colors.js +22 -0
  174. package/src/public/default-config.js +1 -1
  175. package/src/public/default-theme.js +2 -2
  176. package/src/public/load-config.js +2 -0
  177. package/src/util/applyImportantSelector.js +19 -0
  178. package/src/util/buildMediaQuery.js +5 -3
  179. package/src/util/cloneNodes.js +19 -2
  180. package/src/util/color.js +43 -11
  181. package/src/util/dataTypes.js +54 -21
  182. package/src/util/formatVariantSelector.js +317 -101
  183. package/src/util/getAllConfigs.js +21 -2
  184. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  185. package/src/util/log.js +8 -8
  186. package/src/util/nameClass.js +4 -0
  187. package/src/util/negateValue.js +11 -3
  188. package/src/util/normalizeConfig.js +62 -6
  189. package/src/util/normalizeScreens.js +99 -4
  190. package/src/util/parseBoxShadowValue.js +4 -3
  191. package/src/util/parseDependency.js +37 -42
  192. package/src/util/parseGlob.js +24 -0
  193. package/src/util/pluginUtils.js +127 -24
  194. package/src/util/prefixSelector.js +30 -10
  195. package/src/util/removeAlphaVariables.js +24 -0
  196. package/src/util/resolveConfig.js +74 -26
  197. package/src/util/resolveConfigPath.js +12 -1
  198. package/src/util/splitAtTopLevelOnly.js +52 -0
  199. package/src/util/toPath.js +23 -1
  200. package/src/util/transformThemeValue.js +13 -3
  201. package/src/util/validateConfig.js +13 -0
  202. package/src/util/validateFormalSyntax.js +34 -0
  203. package/src/util/withAlphaVariable.js +1 -1
  204. package/stubs/.gitignore +1 -0
  205. package/stubs/.prettierrc.json +6 -0
  206. package/stubs/{defaultConfig.stub.js → config.full.js} +183 -166
  207. package/stubs/postcss.config.js +6 -0
  208. package/stubs/tailwind.config.cjs +2 -0
  209. package/stubs/tailwind.config.js +2 -0
  210. package/stubs/tailwind.config.ts +3 -0
  211. package/types/config.d.ts +373 -0
  212. package/types/generated/.gitkeep +0 -0
  213. package/types/generated/colors.d.ts +298 -0
  214. package/types/generated/corePluginList.d.ts +1 -0
  215. package/types/generated/default-theme.d.ts +347 -0
  216. package/types/index.d.ts +7 -0
  217. package/CHANGELOG.md +0 -1897
  218. package/lib/constants.js +0 -37
  219. package/lib/lib/setupWatchingContext.js +0 -288
  220. package/nesting/plugin.js +0 -41
  221. package/scripts/install-integrations.js +0 -27
  222. package/scripts/rebuildFixtures.js +0 -68
  223. package/src/constants.js +0 -17
  224. package/src/lib/setupWatchingContext.js +0 -311
  225. /package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -0
  226. /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
@@ -1,8 +1,10 @@
1
1
  import fs from 'fs'
2
2
  import * as path from 'path'
3
3
  import postcss from 'postcss'
4
+ import { env } from './lib/sharedState'
4
5
  import createUtilityPlugin from './util/createUtilityPlugin'
5
6
  import buildMediaQuery from './util/buildMediaQuery'
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'
@@ -11,21 +13,43 @@ import isPlainObject from './util/isPlainObject'
11
13
  import transformThemeValue from './util/transformThemeValue'
12
14
  import { version as tailwindVersion } from '../package.json'
13
15
  import log from './util/log'
14
- import { normalizeScreens } from './util/normalizeScreens'
16
+ import {
17
+ normalizeScreens,
18
+ isScreenSortable,
19
+ compareScreens,
20
+ toScreen,
21
+ } from './util/normalizeScreens'
15
22
  import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
23
+ import { removeAlphaVariables } from './util/removeAlphaVariables'
24
+ import { flagEnabled } from './featureFlags'
25
+ import { normalize } from './util/dataTypes'
16
26
 
17
27
  export let variantPlugins = {
18
28
  pseudoElementVariants: ({ addVariant }) => {
19
29
  addVariant('first-letter', '&::first-letter')
20
30
  addVariant('first-line', '&::first-line')
21
31
 
22
- addVariant('marker', ['& *::marker', '&::marker'])
32
+ addVariant('marker', [
33
+ ({ container }) => {
34
+ removeAlphaVariables(container, ['--tw-text-opacity'])
35
+
36
+ return '& *::marker'
37
+ },
38
+ ({ container }) => {
39
+ removeAlphaVariables(container, ['--tw-text-opacity'])
40
+
41
+ return '&::marker'
42
+ },
43
+ ])
44
+
23
45
  addVariant('selection', ['& *::selection', '&::selection'])
24
46
 
25
47
  addVariant('file', '&::file-selector-button')
26
48
 
27
49
  addVariant('placeholder', '&::placeholder')
28
50
 
51
+ addVariant('backdrop', '&::backdrop')
52
+
29
53
  addVariant('before', ({ container }) => {
30
54
  container.walkRules((rule) => {
31
55
  let foundContent = false
@@ -57,22 +81,33 @@ export let variantPlugins = {
57
81
  })
58
82
  },
59
83
 
60
- pseudoClassVariants: ({ addVariant }) => {
84
+ pseudoClassVariants: ({ addVariant, matchVariant, config }) => {
61
85
  let pseudoVariants = [
62
86
  // Positional
63
- ['first', ':first-child'],
64
- ['last', ':last-child'],
65
- ['only', ':only-child'],
66
- ['odd', ':nth-child(odd)'],
67
- ['even', ':nth-child(even)'],
87
+ ['first', '&:first-child'],
88
+ ['last', '&:last-child'],
89
+ ['only', '&:only-child'],
90
+ ['odd', '&:nth-child(odd)'],
91
+ ['even', '&:nth-child(even)'],
68
92
  'first-of-type',
69
93
  'last-of-type',
70
94
  'only-of-type',
71
95
 
72
96
  // State
73
- 'visited',
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
+ ],
74
109
  'target',
75
- ['open', '[open]'],
110
+ ['open', '&[open]'],
76
111
 
77
112
  // Forms
78
113
  'default',
@@ -80,6 +115,7 @@ export let variantPlugins = {
80
115
  'indeterminate',
81
116
  'placeholder-shown',
82
117
  'autofill',
118
+ 'optional',
83
119
  'required',
84
120
  'valid',
85
121
  'invalid',
@@ -92,44 +128,79 @@ export let variantPlugins = {
92
128
 
93
129
  // Interactive
94
130
  'focus-within',
95
- 'hover',
131
+ [
132
+ 'hover',
133
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
134
+ ? '&:hover'
135
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
136
+ ],
96
137
  'focus',
97
138
  'focus-visible',
98
139
  'active',
140
+ 'enabled',
99
141
  'disabled',
100
- ].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
142
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
101
143
 
102
144
  for (let [variantName, state] of pseudoVariants) {
103
- addVariant(variantName, `&${state}`)
104
- }
145
+ addVariant(variantName, (ctx) => {
146
+ let result = typeof state === 'function' ? state(ctx) : state
105
147
 
106
- for (let [variantName, state] of pseudoVariants) {
107
- addVariant(`group-${variantName}`, `:merge(.group)${state} &`)
148
+ return result
149
+ })
108
150
  }
109
151
 
110
- for (let [variantName, state] of pseudoVariants) {
111
- addVariant(`peer-${variantName}`, `:merge(.peer)${state} ~ &`)
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)`, ' ~ &'],
112
161
  }
113
- },
114
162
 
115
- directionVariants: ({ addVariant }) => {
116
- addVariant('ltr', () => {
117
- log.warn('rtl-experimental', [
118
- 'The RTL features in Tailwind CSS are currently in preview.',
119
- 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
120
- ])
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
+ }
121
186
 
122
- return '[dir="ltr"] &'
123
- })
187
+ if (start !== null && end === null) {
188
+ end = result.length
189
+ }
124
190
 
125
- addVariant('rtl', () => {
126
- log.warn('rtl-experimental', [
127
- 'The RTL features in Tailwind CSS are currently in preview.',
128
- 'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
129
- ])
191
+ // Basically this but can handle quotes:
192
+ // result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
130
193
 
131
- return '[dir="rtl"] &'
132
- })
194
+ return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end)
195
+ },
196
+ { values: Object.fromEntries(pseudoVariants) }
197
+ )
198
+ }
199
+ },
200
+
201
+ directionVariants: ({ addVariant }) => {
202
+ addVariant('ltr', ':is([dir="ltr"] &)')
203
+ addVariant('rtl', ':is([dir="rtl"] &)')
133
204
  },
134
205
 
135
206
  reducedMotionVariants: ({ addVariant }) => {
@@ -138,17 +209,19 @@ export let variantPlugins = {
138
209
  },
139
210
 
140
211
  darkVariants: ({ config, addVariant }) => {
141
- let mode = config('darkMode', 'media')
212
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
213
+
142
214
  if (mode === false) {
143
215
  mode = 'media'
144
216
  log.warn('darkmode-false', [
145
217
  'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
146
218
  'Change `darkMode` to `media` or remove it entirely.',
219
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
147
220
  ])
148
221
  }
149
222
 
150
223
  if (mode === 'class') {
151
- addVariant('dark', '.dark &')
224
+ addVariant('dark', `:is(${className} &)`)
152
225
  } else if (mode === 'media') {
153
226
  addVariant('dark', '@media (prefers-color-scheme: dark)')
154
227
  }
@@ -158,20 +231,246 @@ export let variantPlugins = {
158
231
  addVariant('print', '@media print')
159
232
  },
160
233
 
161
- screenVariants: ({ theme, addVariant }) => {
162
- for (let screen of normalizeScreens(theme('screens'))) {
163
- let query = buildMediaQuery(screen)
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'))
238
+
239
+ /** @type {Set<string>} */
240
+ let unitCache = new Set([])
241
+
242
+ /** @param {string} value */
243
+ function units(value) {
244
+ return value.match(/(\D+)$/)?.[1] ?? '(none)'
245
+ }
246
+
247
+ /** @param {string} value */
248
+ function recordUnits(value) {
249
+ if (value !== undefined) {
250
+ unitCache.add(units(value))
251
+ }
252
+ }
253
+
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)
268
+ }
269
+ }
270
+
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
+ }
301
+
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)
308
+ }
309
+
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
+ }
338
+ }
164
339
 
165
- addVariant(screen.name, `@media ${query}`)
340
+ matchVariant('max', buildScreenVariant('max'), {
341
+ sort: maxSort,
342
+ values: areSimpleScreens ? buildScreenValues('max') : {},
343
+ })
344
+
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,
352
+ })
166
353
  }
354
+
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)
367
+
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}`
374
+ }
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
+ )
167
428
  },
168
429
 
169
430
  orientationVariants: ({ addVariant }) => {
170
431
  addVariant('portrait', '@media (orientation: portrait)')
171
432
  addVariant('landscape', '@media (orientation: landscape)')
172
433
  },
434
+
435
+ prefersContrastVariants: ({ addVariant }) => {
436
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
437
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
438
+ },
173
439
  }
174
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
+
175
474
  export let corePlugins = {
176
475
  preflight: ({ addBase }) => {
177
476
  let preflightStyles = postcss.parse(
@@ -310,6 +609,7 @@ export let corePlugins = {
310
609
  addUtilities({
311
610
  '.visible': { visibility: 'visible' },
312
611
  '.invisible': { visibility: 'hidden' },
612
+ '.collapse': { visibility: 'collapse' },
313
613
  })
314
614
  },
315
615
 
@@ -326,12 +626,14 @@ export let corePlugins = {
326
626
  inset: createUtilityPlugin(
327
627
  'inset',
328
628
  [
329
- ['inset', ['top', 'right', 'bottom', 'left']],
629
+ ['inset', ['inset']],
330
630
  [
331
631
  ['inset-x', ['left', 'right']],
332
632
  ['inset-y', ['top', 'bottom']],
333
633
  ],
334
634
  [
635
+ ['start', ['inset-inline-start']],
636
+ ['end', ['inset-inline-end']],
335
637
  ['top', ['top']],
336
638
  ['right', ['right']],
337
639
  ['bottom', ['bottom']],
@@ -383,6 +685,8 @@ export let corePlugins = {
383
685
  ['my', ['margin-top', 'margin-bottom']],
384
686
  ],
385
687
  [
688
+ ['ms', ['margin-inline-start']],
689
+ ['me', ['margin-inline-end']],
386
690
  ['mt', ['margin-top']],
387
691
  ['mr', ['margin-right']],
388
692
  ['mb', ['margin-bottom']],
@@ -399,6 +703,29 @@ export let corePlugins = {
399
703
  })
400
704
  },
401
705
 
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
+ )
718
+
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
+
402
729
  display: ({ addUtilities }) => {
403
730
  addUtilities({
404
731
  '.block': { display: 'block' },
@@ -453,6 +780,13 @@ export let corePlugins = {
453
780
  })
454
781
  },
455
782
 
783
+ captionSide: ({ addUtilities }) => {
784
+ addUtilities({
785
+ '.caption-top': { 'caption-side': 'top' },
786
+ '.caption-bottom': { 'caption-side': 'bottom' },
787
+ })
788
+ },
789
+
456
790
  borderCollapse: ({ addUtilities }) => {
457
791
  addUtilities({
458
792
  '.border-collapse': { 'border-collapse': 'collapse' },
@@ -460,6 +794,41 @@ export let corePlugins = {
460
794
  })
461
795
  },
462
796
 
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
+ },
831
+
463
832
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
464
833
  translate: createUtilityPlugin(
465
834
  'translate',
@@ -467,11 +836,11 @@ export let corePlugins = {
467
836
  [
468
837
  [
469
838
  'translate-x',
470
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
839
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
471
840
  ],
472
841
  [
473
842
  'translate-y',
474
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
843
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
475
844
  ],
476
845
  ],
477
846
  ],
@@ -479,26 +848,15 @@ export let corePlugins = {
479
848
  ),
480
849
  rotate: createUtilityPlugin(
481
850
  'rotate',
482
- [
483
- [
484
- 'rotate',
485
- [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
486
- ],
487
- ],
851
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
488
852
  { supportsNegativeValues: true }
489
853
  ),
490
854
  skew: createUtilityPlugin(
491
855
  'skew',
492
856
  [
493
857
  [
494
- [
495
- 'skew-x',
496
- [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
497
- ],
498
- [
499
- 'skew-y',
500
- [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
501
- ],
858
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
859
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
502
860
  ],
503
861
  ],
504
862
  { supportsNegativeValues: true }
@@ -512,17 +870,17 @@ export let corePlugins = {
512
870
  ['@defaults transform', {}],
513
871
  '--tw-scale-x',
514
872
  '--tw-scale-y',
515
- ['transform', 'var(--tw-transform)'],
873
+ ['transform', cssTransformValue],
516
874
  ],
517
875
  ],
518
876
  [
519
877
  [
520
878
  'scale-x',
521
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
879
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
522
880
  ],
523
881
  [
524
882
  'scale-y',
525
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
883
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
526
884
  ],
527
885
  ],
528
886
  ],
@@ -538,46 +896,25 @@ export let corePlugins = {
538
896
  '--tw-skew-y': '0',
539
897
  '--tw-scale-x': '1',
540
898
  '--tw-scale-y': '1',
541
- '--tw-transform': [
542
- 'translateX(var(--tw-translate-x))',
543
- 'translateY(var(--tw-translate-y))',
544
- 'rotate(var(--tw-rotate))',
545
- 'skewX(var(--tw-skew-x))',
546
- 'skewY(var(--tw-skew-y))',
547
- 'scaleX(var(--tw-scale-x))',
548
- 'scaleY(var(--tw-scale-y))',
549
- ].join(' '),
550
899
  })
551
900
 
552
901
  addUtilities({
553
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
902
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
554
903
  '.transform-cpu': {
555
- '--tw-transform': [
556
- 'translateX(var(--tw-translate-x))',
557
- 'translateY(var(--tw-translate-y))',
558
- 'rotate(var(--tw-rotate))',
559
- 'skewX(var(--tw-skew-x))',
560
- 'skewY(var(--tw-skew-y))',
561
- 'scaleX(var(--tw-scale-x))',
562
- 'scaleY(var(--tw-scale-y))',
563
- ].join(' '),
904
+ transform: cssTransformValue,
564
905
  },
565
906
  '.transform-gpu': {
566
- '--tw-transform': [
567
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
568
- 'rotate(var(--tw-rotate))',
569
- 'skewX(var(--tw-skew-x))',
570
- 'skewY(var(--tw-skew-y))',
571
- 'scaleX(var(--tw-scale-x))',
572
- 'scaleY(var(--tw-scale-y))',
573
- ].join(' '),
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
+ ),
574
911
  },
575
912
  '.transform-none': { transform: 'none' },
576
913
  })
577
914
  },
578
915
 
579
- animation: ({ matchUtilities, theme, prefix }) => {
580
- let prefixName = (name) => prefix(`.${name}`).slice(1)
916
+ animation: ({ matchUtilities, theme, config }) => {
917
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
581
918
  let keyframes = Object.fromEntries(
582
919
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
583
920
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -612,49 +949,50 @@ export let corePlugins = {
612
949
 
613
950
  touchAction: ({ addDefaults, addUtilities }) => {
614
951
  addDefaults('touch-action', {
615
- '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
616
- '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
617
- '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
618
- '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
952
+ '--tw-pan-x': ' ',
953
+ '--tw-pan-y': ' ',
954
+ '--tw-pinch-zoom': ' ',
619
955
  })
620
956
 
957
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
958
+
621
959
  addUtilities({
622
960
  '.touch-auto': { 'touch-action': 'auto' },
623
961
  '.touch-none': { 'touch-action': 'none' },
624
962
  '.touch-pan-x': {
625
963
  '@defaults touch-action': {},
626
964
  '--tw-pan-x': 'pan-x',
627
- 'touch-action': 'var(--tw-touch-action)',
965
+ 'touch-action': cssTouchActionValue,
628
966
  },
629
967
  '.touch-pan-left': {
630
968
  '@defaults touch-action': {},
631
969
  '--tw-pan-x': 'pan-left',
632
- 'touch-action': 'var(--tw-touch-action)',
970
+ 'touch-action': cssTouchActionValue,
633
971
  },
634
972
  '.touch-pan-right': {
635
973
  '@defaults touch-action': {},
636
974
  '--tw-pan-x': 'pan-right',
637
- 'touch-action': 'var(--tw-touch-action)',
975
+ 'touch-action': cssTouchActionValue,
638
976
  },
639
977
  '.touch-pan-y': {
640
978
  '@defaults touch-action': {},
641
979
  '--tw-pan-y': 'pan-y',
642
- 'touch-action': 'var(--tw-touch-action)',
980
+ 'touch-action': cssTouchActionValue,
643
981
  },
644
982
  '.touch-pan-up': {
645
983
  '@defaults touch-action': {},
646
984
  '--tw-pan-y': 'pan-up',
647
- 'touch-action': 'var(--tw-touch-action)',
985
+ 'touch-action': cssTouchActionValue,
648
986
  },
649
987
  '.touch-pan-down': {
650
988
  '@defaults touch-action': {},
651
989
  '--tw-pan-y': 'pan-down',
652
- 'touch-action': 'var(--tw-touch-action)',
990
+ 'touch-action': cssTouchActionValue,
653
991
  },
654
992
  '.touch-pinch-zoom': {
655
993
  '@defaults touch-action': {},
656
994
  '--tw-pinch-zoom': 'pinch-zoom',
657
- 'touch-action': 'var(--tw-touch-action)',
995
+ 'touch-action': cssTouchActionValue,
658
996
  },
659
997
  '.touch-manipulation': { 'touch-action': 'manipulation' },
660
998
  })
@@ -727,6 +1065,8 @@ export let corePlugins = {
727
1065
  ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
728
1066
  ],
729
1067
  [
1068
+ ['scroll-ms', ['scroll-margin-inline-start']],
1069
+ ['scroll-me', ['scroll-margin-inline-end']],
730
1070
  ['scroll-mt', ['scroll-margin-top']],
731
1071
  ['scroll-mr', ['scroll-margin-right']],
732
1072
  ['scroll-mb', ['scroll-margin-bottom']],
@@ -743,6 +1083,8 @@ export let corePlugins = {
743
1083
  ['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
744
1084
  ],
745
1085
  [
1086
+ ['scroll-ps', ['scroll-padding-inline-start']],
1087
+ ['scroll-pe', ['scroll-padding-inline-end']],
746
1088
  ['scroll-pt', ['scroll-padding-top']],
747
1089
  ['scroll-pr', ['scroll-padding-right']],
748
1090
  ['scroll-pb', ['scroll-padding-bottom']],
@@ -756,8 +1098,8 @@ export let corePlugins = {
756
1098
  '.list-outside': { 'list-style-position': 'outside' },
757
1099
  })
758
1100
  },
759
-
760
1101
  listStyleType: createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]),
1102
+ listStyleImage: createUtilityPlugin('listStyleImage', [['list-image', ['listStyleImage']]]),
761
1103
 
762
1104
  appearance: ({ addUtilities }) => {
763
1105
  addUtilities({
@@ -808,6 +1150,7 @@ export let corePlugins = {
808
1150
  addUtilities({
809
1151
  '.grid-flow-row': { gridAutoFlow: 'row' },
810
1152
  '.grid-flow-col': { gridAutoFlow: 'column' },
1153
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
811
1154
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
812
1155
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
813
1156
  })
@@ -844,6 +1187,7 @@ export let corePlugins = {
844
1187
  '.place-content-between': { 'place-content': 'space-between' },
845
1188
  '.place-content-around': { 'place-content': 'space-around' },
846
1189
  '.place-content-evenly': { 'place-content': 'space-evenly' },
1190
+ '.place-content-baseline': { 'place-content': 'baseline' },
847
1191
  '.place-content-stretch': { 'place-content': 'stretch' },
848
1192
  })
849
1193
  },
@@ -853,18 +1197,22 @@ export let corePlugins = {
853
1197
  '.place-items-start': { 'place-items': 'start' },
854
1198
  '.place-items-end': { 'place-items': 'end' },
855
1199
  '.place-items-center': { 'place-items': 'center' },
1200
+ '.place-items-baseline': { 'place-items': 'baseline' },
856
1201
  '.place-items-stretch': { 'place-items': 'stretch' },
857
1202
  })
858
1203
  },
859
1204
 
860
1205
  alignContent: ({ addUtilities }) => {
861
1206
  addUtilities({
1207
+ '.content-normal': { 'align-content': 'normal' },
862
1208
  '.content-center': { 'align-content': 'center' },
863
1209
  '.content-start': { 'align-content': 'flex-start' },
864
1210
  '.content-end': { 'align-content': 'flex-end' },
865
1211
  '.content-between': { 'align-content': 'space-between' },
866
1212
  '.content-around': { 'align-content': 'space-around' },
867
1213
  '.content-evenly': { 'align-content': 'space-evenly' },
1214
+ '.content-baseline': { 'align-content': 'baseline' },
1215
+ '.content-stretch': { 'align-content': 'stretch' },
868
1216
  })
869
1217
  },
870
1218
 
@@ -880,12 +1228,14 @@ export let corePlugins = {
880
1228
 
881
1229
  justifyContent: ({ addUtilities }) => {
882
1230
  addUtilities({
1231
+ '.justify-normal': { 'justify-content': 'normal' },
883
1232
  '.justify-start': { 'justify-content': 'flex-start' },
884
1233
  '.justify-end': { 'justify-content': 'flex-end' },
885
1234
  '.justify-center': { 'justify-content': 'center' },
886
1235
  '.justify-between': { 'justify-content': 'space-between' },
887
1236
  '.justify-around': { 'justify-content': 'space-around' },
888
1237
  '.justify-evenly': { 'justify-content': 'space-evenly' },
1238
+ '.justify-stretch': { 'justify-content': 'stretch' },
889
1239
  })
890
1240
  },
891
1241
 
@@ -912,6 +1262,16 @@ export let corePlugins = {
912
1262
  'space-x': (value) => {
913
1263
  value = value === '0' ? '0px' : value
914
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
+ }
1274
+
915
1275
  return {
916
1276
  '& > :not([hidden]) ~ :not([hidden])': {
917
1277
  '--tw-space-x-reverse': '0',
@@ -947,6 +1307,17 @@ export let corePlugins = {
947
1307
  'divide-x': (value) => {
948
1308
  value = value === '0' ? '0px' : value
949
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
+ }
1320
+
950
1321
  return {
951
1322
  '& > :not([hidden]) ~ :not([hidden])': {
952
1323
  '@defaults border-width': {},
@@ -969,7 +1340,7 @@ export let corePlugins = {
969
1340
  }
970
1341
  },
971
1342
  },
972
- { values: theme('divideWidth'), type: ['line-width', 'length'] }
1343
+ { values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
973
1344
  )
974
1345
 
975
1346
  addUtilities({
@@ -1017,7 +1388,7 @@ export let corePlugins = {
1017
1388
  },
1018
1389
  {
1019
1390
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1020
- type: 'color',
1391
+ type: ['color', 'any'],
1021
1392
  }
1022
1393
  )
1023
1394
  },
@@ -1114,6 +1485,14 @@ export let corePlugins = {
1114
1485
  })
1115
1486
  },
1116
1487
 
1488
+ hyphens: ({ addUtilities }) => {
1489
+ addUtilities({
1490
+ '.hyphens-none': { hyphens: 'none' },
1491
+ '.hyphens-manual': { hyphens: 'manual' },
1492
+ '.hyphens-auto': { hyphens: 'auto' },
1493
+ })
1494
+ },
1495
+
1117
1496
  whitespace: ({ addUtilities }) => {
1118
1497
  addUtilities({
1119
1498
  '.whitespace-normal': { 'white-space': 'normal' },
@@ -1121,6 +1500,7 @@ export let corePlugins = {
1121
1500
  '.whitespace-pre': { 'white-space': 'pre' },
1122
1501
  '.whitespace-pre-line': { 'white-space': 'pre-line' },
1123
1502
  '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
1503
+ '.whitespace-break-spaces': { 'white-space': 'break-spaces' },
1124
1504
  })
1125
1505
  },
1126
1506
 
@@ -1129,18 +1509,25 @@ export let corePlugins = {
1129
1509
  '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1130
1510
  '.break-words': { 'overflow-wrap': 'break-word' },
1131
1511
  '.break-all': { 'word-break': 'break-all' },
1512
+ '.break-keep': { 'word-break': 'keep-all' },
1132
1513
  })
1133
1514
  },
1134
1515
 
1135
1516
  borderRadius: createUtilityPlugin('borderRadius', [
1136
1517
  ['rounded', ['border-radius']],
1137
1518
  [
1519
+ ['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
1520
+ ['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
1138
1521
  ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
1139
1522
  ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
1140
1523
  ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
1141
1524
  ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
1142
1525
  ],
1143
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']],
1144
1531
  ['rounded-tl', ['border-top-left-radius']],
1145
1532
  ['rounded-tr', ['border-top-right-radius']],
1146
1533
  ['rounded-br', ['border-bottom-right-radius']],
@@ -1157,6 +1544,8 @@ export let corePlugins = {
1157
1544
  ['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
1158
1545
  ],
1159
1546
  [
1547
+ ['border-s', [['@defaults border-width', {}], 'border-inline-start-width']],
1548
+ ['border-e', [['@defaults border-width', {}], 'border-inline-end-width']],
1160
1549
  ['border-t', [['@defaults border-width', {}], 'border-top-width']],
1161
1550
  ['border-r', [['@defaults border-width', {}], 'border-right-width']],
1162
1551
  ['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
@@ -1177,23 +1566,7 @@ export let corePlugins = {
1177
1566
  })
1178
1567
  },
1179
1568
 
1180
- borderColor: ({ addDefaults, matchUtilities, theme, corePlugins }) => {
1181
- if (!corePlugins('borderOpacity')) {
1182
- let value = theme('borderColor.DEFAULT', 'currentColor')
1183
- addDefaults('border-width', {
1184
- 'border-color': toColorValue(value),
1185
- })
1186
- } else {
1187
- addDefaults(
1188
- 'border-width',
1189
- withAlphaVariable({
1190
- color: theme('borderColor.DEFAULT', 'currentColor'),
1191
- property: 'border-color',
1192
- variable: '--tw-border-opacity',
1193
- })
1194
- )
1195
- }
1196
-
1569
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1197
1570
  matchUtilities(
1198
1571
  {
1199
1572
  border: (value) => {
@@ -1212,7 +1585,7 @@ export let corePlugins = {
1212
1585
  },
1213
1586
  {
1214
1587
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1215
- type: ['color'],
1588
+ type: ['color', 'any'],
1216
1589
  }
1217
1590
  )
1218
1591
 
@@ -1249,12 +1622,38 @@ export let corePlugins = {
1249
1622
  },
1250
1623
  {
1251
1624
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1252
- type: 'color',
1625
+ type: ['color', 'any'],
1253
1626
  }
1254
1627
  )
1255
1628
 
1256
1629
  matchUtilities(
1257
1630
  {
1631
+ 'border-s': (value) => {
1632
+ if (!corePlugins('borderOpacity')) {
1633
+ return {
1634
+ 'border-inline-start-color': toColorValue(value),
1635
+ }
1636
+ }
1637
+
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
+ }
1650
+
1651
+ return withAlphaVariable({
1652
+ color: value,
1653
+ property: 'border-inline-end-color',
1654
+ variable: '--tw-border-opacity',
1655
+ })
1656
+ },
1258
1657
  'border-t': (value) => {
1259
1658
  if (!corePlugins('borderOpacity')) {
1260
1659
  return {
@@ -1310,7 +1709,7 @@ export let corePlugins = {
1310
1709
  },
1311
1710
  {
1312
1711
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1313
- type: 'color',
1712
+ type: ['color', 'any'],
1314
1713
  }
1315
1714
  )
1316
1715
  },
@@ -1336,7 +1735,7 @@ export let corePlugins = {
1336
1735
  })
1337
1736
  },
1338
1737
  },
1339
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1738
+ { values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
1340
1739
  )
1341
1740
  },
1342
1741
 
@@ -1364,7 +1763,8 @@ export let corePlugins = {
1364
1763
 
1365
1764
  return {
1366
1765
  '--tw-gradient-from': toColorValue(value, 'from'),
1367
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1766
+ '--tw-gradient-to': transparentToValue,
1767
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
1368
1768
  }
1369
1769
  },
1370
1770
  },
@@ -1376,10 +1776,11 @@ export let corePlugins = {
1376
1776
  let transparentToValue = transparentTo(value)
1377
1777
 
1378
1778
  return {
1779
+ '--tw-gradient-to': transparentToValue,
1379
1780
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1380
1781
  value,
1381
1782
  'via'
1382
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1783
+ )}, var(--tw-gradient-to)`,
1383
1784
  }
1384
1785
  },
1385
1786
  },
@@ -1402,7 +1803,7 @@ export let corePlugins = {
1402
1803
  },
1403
1804
 
1404
1805
  backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1405
- type: ['lookup', 'length', 'percentage'],
1806
+ type: ['lookup', 'length', 'percentage', 'size'],
1406
1807
  }),
1407
1808
 
1408
1809
  backgroundAttachment: ({ addUtilities }) => {
@@ -1423,7 +1824,7 @@ export let corePlugins = {
1423
1824
  },
1424
1825
 
1425
1826
  backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1426
- type: ['lookup', 'position'],
1827
+ type: ['lookup', ['position', { preferOnConflict: true }]],
1427
1828
  }),
1428
1829
 
1429
1830
  backgroundRepeat: ({ addUtilities }) => {
@@ -1463,7 +1864,7 @@ export let corePlugins = {
1463
1864
  return { stroke: toColorValue(value) }
1464
1865
  },
1465
1866
  },
1466
- { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1867
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
1467
1868
  )
1468
1869
  },
1469
1870
 
@@ -1489,6 +1890,8 @@ export let corePlugins = {
1489
1890
  ['py', ['padding-top', 'padding-bottom']],
1490
1891
  ],
1491
1892
  [
1893
+ ['ps', ['padding-inline-start']],
1894
+ ['pe', ['padding-inline-end']],
1492
1895
  ['pt', ['padding-top']],
1493
1896
  ['pr', ['padding-right']],
1494
1897
  ['pb', ['padding-bottom']],
@@ -1502,6 +1905,8 @@ export let corePlugins = {
1502
1905
  '.text-center': { 'text-align': 'center' },
1503
1906
  '.text-right': { 'text-align': 'right' },
1504
1907
  '.text-justify': { 'text-align': 'justify' },
1908
+ '.text-start': { 'text-align': 'start' },
1909
+ '.text-end': { 'text-align': 'end' },
1505
1910
  })
1506
1911
  },
1507
1912
 
@@ -1524,16 +1929,46 @@ export let corePlugins = {
1524
1929
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1525
1930
  },
1526
1931
 
1527
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1528
- type: ['lookup', 'generic-name', 'family-name'],
1529
- }),
1932
+ fontFamily: ({ matchUtilities, theme }) => {
1933
+ matchUtilities(
1934
+ {
1935
+ font: (value) => {
1936
+ let [families, options = {}] =
1937
+ Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
1938
+ let { fontFeatureSettings, fontVariationSettings } = options
1939
+
1940
+ return {
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 }),
1948
+ }
1949
+ },
1950
+ },
1951
+ {
1952
+ values: theme('fontFamily'),
1953
+ type: ['lookup', 'generic-name', 'family-name'],
1954
+ }
1955
+ )
1956
+ },
1530
1957
 
1531
1958
  fontSize: ({ matchUtilities, theme }) => {
1532
1959
  matchUtilities(
1533
1960
  {
1534
- text: (value) => {
1961
+ text: (value, { modifier }) => {
1535
1962
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1536
- let { lineHeight, letterSpacing } = isPlainObject(options)
1963
+
1964
+ if (modifier) {
1965
+ return {
1966
+ 'font-size': fontSize,
1967
+ 'line-height': modifier,
1968
+ }
1969
+ }
1970
+
1971
+ let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1537
1972
  ? options
1538
1973
  : { lineHeight: options }
1539
1974
 
@@ -1541,18 +1976,20 @@ export let corePlugins = {
1541
1976
  'font-size': fontSize,
1542
1977
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1543
1978
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1979
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1544
1980
  }
1545
1981
  },
1546
1982
  },
1547
1983
  {
1548
1984
  values: theme('fontSize'),
1985
+ modifiers: theme('lineHeight'),
1549
1986
  type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1550
1987
  }
1551
1988
  )
1552
1989
  },
1553
1990
 
1554
1991
  fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1555
- type: ['lookup', 'number'],
1992
+ type: ['lookup', 'number', 'any'],
1556
1993
  }),
1557
1994
 
1558
1995
  textTransform: ({ addUtilities }) => {
@@ -1571,57 +2008,59 @@ export let corePlugins = {
1571
2008
  })
1572
2009
  },
1573
2010
 
1574
- fontVariantNumeric: ({ addUtilities }) => {
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
+ })
2022
+
1575
2023
  addUtilities({
1576
- '@defaults font-variant-numeric': {
1577
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1578
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1579
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1580
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1581
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1582
- '--tw-font-variant-numeric':
1583
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1584
- },
1585
2024
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1586
2025
  '.ordinal': {
1587
2026
  '@defaults font-variant-numeric': {},
1588
2027
  '--tw-ordinal': 'ordinal',
1589
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2028
+ 'font-variant-numeric': cssFontVariantNumericValue,
1590
2029
  },
1591
2030
  '.slashed-zero': {
1592
2031
  '@defaults font-variant-numeric': {},
1593
2032
  '--tw-slashed-zero': 'slashed-zero',
1594
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2033
+ 'font-variant-numeric': cssFontVariantNumericValue,
1595
2034
  },
1596
2035
  '.lining-nums': {
1597
2036
  '@defaults font-variant-numeric': {},
1598
2037
  '--tw-numeric-figure': 'lining-nums',
1599
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2038
+ 'font-variant-numeric': cssFontVariantNumericValue,
1600
2039
  },
1601
2040
  '.oldstyle-nums': {
1602
2041
  '@defaults font-variant-numeric': {},
1603
2042
  '--tw-numeric-figure': 'oldstyle-nums',
1604
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2043
+ 'font-variant-numeric': cssFontVariantNumericValue,
1605
2044
  },
1606
2045
  '.proportional-nums': {
1607
2046
  '@defaults font-variant-numeric': {},
1608
2047
  '--tw-numeric-spacing': 'proportional-nums',
1609
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2048
+ 'font-variant-numeric': cssFontVariantNumericValue,
1610
2049
  },
1611
2050
  '.tabular-nums': {
1612
2051
  '@defaults font-variant-numeric': {},
1613
2052
  '--tw-numeric-spacing': 'tabular-nums',
1614
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2053
+ 'font-variant-numeric': cssFontVariantNumericValue,
1615
2054
  },
1616
2055
  '.diagonal-fractions': {
1617
2056
  '@defaults font-variant-numeric': {},
1618
2057
  '--tw-numeric-fraction': 'diagonal-fractions',
1619
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2058
+ 'font-variant-numeric': cssFontVariantNumericValue,
1620
2059
  },
1621
2060
  '.stacked-fractions': {
1622
2061
  '@defaults font-variant-numeric': {},
1623
2062
  '--tw-numeric-fraction': 'stacked-fractions',
1624
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2063
+ 'font-variant-numeric': cssFontVariantNumericValue,
1625
2064
  },
1626
2065
  })
1627
2066
  },
@@ -1646,7 +2085,7 @@ export let corePlugins = {
1646
2085
  })
1647
2086
  },
1648
2087
  },
1649
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
2088
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
1650
2089
  )
1651
2090
  },
1652
2091
 
@@ -1668,7 +2107,7 @@ export let corePlugins = {
1668
2107
  return { 'text-decoration-color': toColorValue(value) }
1669
2108
  },
1670
2109
  },
1671
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
2110
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1672
2111
  )
1673
2112
  },
1674
2113
 
@@ -1691,7 +2130,7 @@ export let corePlugins = {
1691
2130
  textUnderlineOffset: createUtilityPlugin(
1692
2131
  'textUnderlineOffset',
1693
2132
  [['underline-offset', ['text-underline-offset']]],
1694
- { type: ['length', 'percentage'] }
2133
+ { type: ['length', 'percentage', 'any'] }
1695
2134
  ),
1696
2135
 
1697
2136
  fontSmoothing: ({ addUtilities }) => {
@@ -1806,6 +2245,7 @@ export let corePlugins = {
1806
2245
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1807
2246
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1808
2247
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
2248
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1809
2249
  })
1810
2250
  },
1811
2251
 
@@ -1863,7 +2303,7 @@ export let corePlugins = {
1863
2303
  }
1864
2304
  },
1865
2305
  },
1866
- { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
2306
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
1867
2307
  )
1868
2308
  },
1869
2309
 
@@ -1877,7 +2317,6 @@ export let corePlugins = {
1877
2317
  '.outline-dashed': { 'outline-style': 'dashed' },
1878
2318
  '.outline-dotted': { 'outline-style': 'dotted' },
1879
2319
  '.outline-double': { 'outline-style': 'double' },
1880
- '.outline-hidden': { 'outline-style': 'hidden' },
1881
2320
  })
1882
2321
  },
1883
2322
 
@@ -1886,7 +2325,8 @@ export let corePlugins = {
1886
2325
  }),
1887
2326
 
1888
2327
  outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1889
- type: ['length', 'number', 'percentage'],
2328
+ type: ['length', 'number', 'percentage', 'any'],
2329
+ supportsNegativeValues: true,
1890
2330
  }),
1891
2331
 
1892
2332
  outlineColor: ({ matchUtilities, theme }) => {
@@ -1896,20 +2336,31 @@ export let corePlugins = {
1896
2336
  return { 'outline-color': toColorValue(value) }
1897
2337
  },
1898
2338
  },
1899
- { values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
2339
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
1900
2340
  )
1901
2341
  },
1902
2342
 
1903
- ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
1904
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1905
- let ringColorDefault = withAlphaValue(
1906
- theme('ringColor.DEFAULT'),
1907
- ringOpacityDefault,
1908
- `rgb(147 197 253 / ${ringOpacityDefault})`
1909
- )
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
+ })()
1910
2361
 
1911
2362
  addDefaults('ring-width', {
1912
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
2363
+ '--tw-ring-inset': ' ',
1913
2364
  '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1914
2365
  '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1915
2366
  '--tw-ring-color': ringColorDefault,
@@ -1942,10 +2393,16 @@ export let corePlugins = {
1942
2393
  })
1943
2394
  },
1944
2395
 
1945
- ringColor: ({ matchUtilities, theme }) => {
2396
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1946
2397
  matchUtilities(
1947
2398
  {
1948
2399
  ring: (value) => {
2400
+ if (!corePlugins('ringOpacity')) {
2401
+ return {
2402
+ '--tw-ring-color': toColorValue(value),
2403
+ }
2404
+ }
2405
+
1949
2406
  return withAlphaVariable({
1950
2407
  color: value,
1951
2408
  property: '--tw-ring-color',
@@ -1959,14 +2416,18 @@ export let corePlugins = {
1959
2416
  ([modifier]) => modifier !== 'DEFAULT'
1960
2417
  )
1961
2418
  ),
1962
- type: 'color',
2419
+ type: ['color', 'any'],
1963
2420
  }
1964
2421
  )
1965
2422
  },
1966
2423
 
1967
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1968
- filterDefault: true,
1969
- }),
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
+ },
1970
2431
  ringOffsetWidth: createUtilityPlugin(
1971
2432
  'ringOffsetWidth',
1972
2433
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -1982,7 +2443,7 @@ export let corePlugins = {
1982
2443
  }
1983
2444
  },
1984
2445
  },
1985
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
2446
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
1986
2447
  )
1987
2448
  },
1988
2449
 
@@ -1993,7 +2454,7 @@ export let corePlugins = {
1993
2454
  return {
1994
2455
  '--tw-blur': `blur(${value})`,
1995
2456
  '@defaults filter': {},
1996
- filter: 'var(--tw-filter)',
2457
+ filter: cssFilterValue,
1997
2458
  }
1998
2459
  },
1999
2460
  },
@@ -2008,7 +2469,7 @@ export let corePlugins = {
2008
2469
  return {
2009
2470
  '--tw-brightness': `brightness(${value})`,
2010
2471
  '@defaults filter': {},
2011
- filter: 'var(--tw-filter)',
2472
+ filter: cssFilterValue,
2012
2473
  }
2013
2474
  },
2014
2475
  },
@@ -2023,7 +2484,7 @@ export let corePlugins = {
2023
2484
  return {
2024
2485
  '--tw-contrast': `contrast(${value})`,
2025
2486
  '@defaults filter': {},
2026
- filter: 'var(--tw-filter)',
2487
+ filter: cssFilterValue,
2027
2488
  }
2028
2489
  },
2029
2490
  },
@@ -2040,7 +2501,7 @@ export let corePlugins = {
2040
2501
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2041
2502
  : `drop-shadow(${value})`,
2042
2503
  '@defaults filter': {},
2043
- filter: 'var(--tw-filter)',
2504
+ filter: cssFilterValue,
2044
2505
  }
2045
2506
  },
2046
2507
  },
@@ -2055,7 +2516,7 @@ export let corePlugins = {
2055
2516
  return {
2056
2517
  '--tw-grayscale': `grayscale(${value})`,
2057
2518
  '@defaults filter': {},
2058
- filter: 'var(--tw-filter)',
2519
+ filter: cssFilterValue,
2059
2520
  }
2060
2521
  },
2061
2522
  },
@@ -2070,7 +2531,7 @@ export let corePlugins = {
2070
2531
  return {
2071
2532
  '--tw-hue-rotate': `hue-rotate(${value})`,
2072
2533
  '@defaults filter': {},
2073
- filter: 'var(--tw-filter)',
2534
+ filter: cssFilterValue,
2074
2535
  }
2075
2536
  },
2076
2537
  },
@@ -2085,7 +2546,7 @@ export let corePlugins = {
2085
2546
  return {
2086
2547
  '--tw-invert': `invert(${value})`,
2087
2548
  '@defaults filter': {},
2088
- filter: 'var(--tw-filter)',
2549
+ filter: cssFilterValue,
2089
2550
  }
2090
2551
  },
2091
2552
  },
@@ -2100,7 +2561,7 @@ export let corePlugins = {
2100
2561
  return {
2101
2562
  '--tw-saturate': `saturate(${value})`,
2102
2563
  '@defaults filter': {},
2103
- filter: 'var(--tw-filter)',
2564
+ filter: cssFilterValue,
2104
2565
  }
2105
2566
  },
2106
2567
  },
@@ -2115,7 +2576,7 @@ export let corePlugins = {
2115
2576
  return {
2116
2577
  '--tw-sepia': `sepia(${value})`,
2117
2578
  '@defaults filter': {},
2118
- filter: 'var(--tw-filter)',
2579
+ filter: cssFilterValue,
2119
2580
  }
2120
2581
  },
2121
2582
  },
@@ -2125,29 +2586,18 @@ export let corePlugins = {
2125
2586
 
2126
2587
  filter: ({ addDefaults, addUtilities }) => {
2127
2588
  addDefaults('filter', {
2128
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2129
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2130
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2131
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2132
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2133
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2134
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2135
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2136
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2137
- '--tw-filter': [
2138
- 'var(--tw-blur)',
2139
- 'var(--tw-brightness)',
2140
- 'var(--tw-contrast)',
2141
- 'var(--tw-grayscale)',
2142
- 'var(--tw-hue-rotate)',
2143
- 'var(--tw-invert)',
2144
- 'var(--tw-saturate)',
2145
- 'var(--tw-sepia)',
2146
- 'var(--tw-drop-shadow)',
2147
- ].join(' '),
2148
- })
2149
- addUtilities({
2150
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-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 },
2151
2601
  '.filter-none': { filter: 'none' },
2152
2602
  })
2153
2603
  },
@@ -2159,7 +2609,7 @@ export let corePlugins = {
2159
2609
  return {
2160
2610
  '--tw-backdrop-blur': `blur(${value})`,
2161
2611
  '@defaults backdrop-filter': {},
2162
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2612
+ 'backdrop-filter': cssBackdropFilterValue,
2163
2613
  }
2164
2614
  },
2165
2615
  },
@@ -2174,7 +2624,7 @@ export let corePlugins = {
2174
2624
  return {
2175
2625
  '--tw-backdrop-brightness': `brightness(${value})`,
2176
2626
  '@defaults backdrop-filter': {},
2177
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2627
+ 'backdrop-filter': cssBackdropFilterValue,
2178
2628
  }
2179
2629
  },
2180
2630
  },
@@ -2189,7 +2639,7 @@ export let corePlugins = {
2189
2639
  return {
2190
2640
  '--tw-backdrop-contrast': `contrast(${value})`,
2191
2641
  '@defaults backdrop-filter': {},
2192
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2642
+ 'backdrop-filter': cssBackdropFilterValue,
2193
2643
  }
2194
2644
  },
2195
2645
  },
@@ -2204,7 +2654,7 @@ export let corePlugins = {
2204
2654
  return {
2205
2655
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2206
2656
  '@defaults backdrop-filter': {},
2207
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2657
+ 'backdrop-filter': cssBackdropFilterValue,
2208
2658
  }
2209
2659
  },
2210
2660
  },
@@ -2219,7 +2669,7 @@ export let corePlugins = {
2219
2669
  return {
2220
2670
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2221
2671
  '@defaults backdrop-filter': {},
2222
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2672
+ 'backdrop-filter': cssBackdropFilterValue,
2223
2673
  }
2224
2674
  },
2225
2675
  },
@@ -2234,7 +2684,7 @@ export let corePlugins = {
2234
2684
  return {
2235
2685
  '--tw-backdrop-invert': `invert(${value})`,
2236
2686
  '@defaults backdrop-filter': {},
2237
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2687
+ 'backdrop-filter': cssBackdropFilterValue,
2238
2688
  }
2239
2689
  },
2240
2690
  },
@@ -2249,7 +2699,7 @@ export let corePlugins = {
2249
2699
  return {
2250
2700
  '--tw-backdrop-opacity': `opacity(${value})`,
2251
2701
  '@defaults backdrop-filter': {},
2252
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2702
+ 'backdrop-filter': cssBackdropFilterValue,
2253
2703
  }
2254
2704
  },
2255
2705
  },
@@ -2264,7 +2714,7 @@ export let corePlugins = {
2264
2714
  return {
2265
2715
  '--tw-backdrop-saturate': `saturate(${value})`,
2266
2716
  '@defaults backdrop-filter': {},
2267
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2717
+ 'backdrop-filter': cssBackdropFilterValue,
2268
2718
  }
2269
2719
  },
2270
2720
  },
@@ -2279,7 +2729,7 @@ export let corePlugins = {
2279
2729
  return {
2280
2730
  '--tw-backdrop-sepia': `sepia(${value})`,
2281
2731
  '@defaults backdrop-filter': {},
2282
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2732
+ 'backdrop-filter': cssBackdropFilterValue,
2283
2733
  }
2284
2734
  },
2285
2735
  },
@@ -2289,31 +2739,20 @@ export let corePlugins = {
2289
2739
 
2290
2740
  backdropFilter: ({ addDefaults, addUtilities }) => {
2291
2741
  addDefaults('backdrop-filter', {
2292
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2293
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2294
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2295
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2296
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2297
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2298
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2299
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2300
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2301
- '--tw-backdrop-filter': [
2302
- 'var(--tw-backdrop-blur)',
2303
- 'var(--tw-backdrop-brightness)',
2304
- 'var(--tw-backdrop-contrast)',
2305
- 'var(--tw-backdrop-grayscale)',
2306
- 'var(--tw-backdrop-hue-rotate)',
2307
- 'var(--tw-backdrop-invert)',
2308
- 'var(--tw-backdrop-opacity)',
2309
- 'var(--tw-backdrop-saturate)',
2310
- 'var(--tw-backdrop-sepia)',
2311
- ].join(' '),
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': ' ',
2312
2751
  })
2313
2752
  addUtilities({
2314
2753
  '.backdrop-filter': {
2315
2754
  '@defaults backdrop-filter': {},
2316
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2755
+ 'backdrop-filter': cssBackdropFilterValue,
2317
2756
  },
2318
2757
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2319
2758
  })