tailwindcss 0.0.0-insiders.ea139f2 → 0.0.0-insiders.ea4e1cd

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 (236) 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 -1
  5. package/defaultConfig.d.ts +3 -0
  6. package/defaultConfig.js +2 -1
  7. package/defaultTheme.d.ts +4 -0
  8. package/defaultTheme.js +2 -1
  9. package/lib/cli/build/deps.js +62 -0
  10. package/lib/cli/build/index.js +54 -0
  11. package/lib/cli/build/plugin.js +378 -0
  12. package/lib/cli/build/utils.js +88 -0
  13. package/lib/cli/build/watching.js +182 -0
  14. package/lib/cli/help/index.js +73 -0
  15. package/lib/cli/index.js +230 -0
  16. package/lib/cli/init/index.js +63 -0
  17. package/lib/cli-peer-dependencies.js +28 -7
  18. package/lib/cli.js +4 -703
  19. package/lib/corePluginList.js +12 -3
  20. package/lib/corePlugins.js +2373 -1863
  21. package/lib/css/preflight.css +10 -8
  22. package/lib/featureFlags.js +49 -26
  23. package/lib/index.js +1 -31
  24. package/lib/lib/cacheInvalidation.js +92 -0
  25. package/lib/lib/collapseAdjacentRules.js +30 -10
  26. package/lib/lib/collapseDuplicateDeclarations.js +60 -4
  27. package/lib/lib/content.js +181 -0
  28. package/lib/lib/defaultExtractor.js +243 -0
  29. package/lib/lib/detectNesting.js +21 -10
  30. package/lib/lib/evaluateTailwindFunctions.js +115 -50
  31. package/lib/lib/expandApplyAtRules.js +467 -161
  32. package/lib/lib/expandTailwindAtRules.js +160 -133
  33. package/lib/lib/findAtConfigPath.js +46 -0
  34. package/lib/lib/generateRules.js +553 -200
  35. package/lib/lib/getModuleDependencies.js +88 -37
  36. package/lib/lib/load-config.js +42 -0
  37. package/lib/lib/normalizeTailwindDirectives.js +46 -33
  38. package/lib/lib/offsets.js +306 -0
  39. package/lib/lib/partitionApplyAtRules.js +58 -0
  40. package/lib/lib/regex.js +74 -0
  41. package/lib/lib/remap-bitfield.js +89 -0
  42. package/lib/lib/resolveDefaultsAtRules.js +98 -58
  43. package/lib/lib/setupContextUtils.js +773 -321
  44. package/lib/lib/setupTrackingContext.js +70 -75
  45. package/lib/lib/sharedState.js +78 -10
  46. package/lib/lib/substituteScreenAtRules.js +14 -10
  47. package/lib/oxide/cli/build/deps.js +89 -0
  48. package/lib/oxide/cli/build/index.js +53 -0
  49. package/lib/oxide/cli/build/plugin.js +375 -0
  50. package/lib/oxide/cli/build/utils.js +87 -0
  51. package/lib/oxide/cli/build/watching.js +179 -0
  52. package/lib/oxide/cli/help/index.js +72 -0
  53. package/lib/oxide/cli/index.js +214 -0
  54. package/lib/oxide/cli/init/index.js +52 -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 +21 -0
  60. package/lib/postcss-plugins/nesting/plugin.js +89 -0
  61. package/lib/processTailwindFeatures.js +39 -26
  62. package/lib/public/colors.js +272 -246
  63. package/lib/public/create-plugin.js +9 -5
  64. package/lib/public/default-config.js +10 -6
  65. package/lib/public/default-theme.js +10 -6
  66. package/lib/public/load-config.js +12 -0
  67. package/lib/public/resolve-config.js +11 -6
  68. package/lib/util/applyImportantSelector.js +36 -0
  69. package/lib/util/bigSign.js +6 -1
  70. package/lib/util/buildMediaQuery.js +13 -6
  71. package/lib/util/cloneDeep.js +9 -6
  72. package/lib/util/cloneNodes.js +23 -3
  73. package/lib/util/color.js +70 -38
  74. package/lib/util/colorNames.js +752 -0
  75. package/lib/util/configurePlugins.js +7 -2
  76. package/lib/util/createPlugin.js +8 -6
  77. package/lib/util/createUtilityPlugin.js +16 -16
  78. package/lib/util/dataTypes.js +173 -108
  79. package/lib/util/defaults.js +14 -3
  80. package/lib/util/escapeClassName.js +13 -8
  81. package/lib/util/escapeCommas.js +7 -2
  82. package/lib/util/flattenColorPalette.js +11 -12
  83. package/lib/util/formatVariantSelector.js +228 -151
  84. package/lib/util/getAllConfigs.js +33 -12
  85. package/lib/util/hashConfig.js +9 -4
  86. package/lib/util/isKeyframeRule.js +7 -2
  87. package/lib/util/isPlainObject.js +7 -2
  88. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
  89. package/lib/util/log.js +27 -13
  90. package/lib/util/nameClass.js +27 -10
  91. package/lib/util/negateValue.js +25 -8
  92. package/lib/util/normalizeConfig.js +139 -65
  93. package/lib/util/normalizeScreens.js +131 -11
  94. package/lib/util/parseAnimationValue.js +44 -40
  95. package/lib/util/parseBoxShadowValue.js +34 -23
  96. package/lib/util/parseDependency.js +39 -55
  97. package/lib/util/parseGlob.js +36 -0
  98. package/lib/util/parseObjectStyles.js +15 -10
  99. package/lib/util/pluginUtils.js +159 -69
  100. package/lib/util/prefixSelector.js +30 -12
  101. package/lib/util/pseudoElements.js +229 -0
  102. package/lib/util/removeAlphaVariables.js +31 -0
  103. package/lib/util/resolveConfig.js +97 -75
  104. package/lib/util/resolveConfigPath.js +30 -12
  105. package/lib/util/responsive.js +11 -6
  106. package/lib/util/splitAtTopLevelOnly.js +51 -0
  107. package/lib/util/tap.js +6 -1
  108. package/lib/util/toColorValue.js +7 -3
  109. package/lib/util/toPath.js +26 -3
  110. package/lib/util/transformThemeValue.js +40 -30
  111. package/lib/util/validateConfig.js +37 -0
  112. package/lib/util/validateFormalSyntax.js +26 -0
  113. package/lib/util/withAlphaVariable.js +27 -15
  114. package/loadConfig.d.ts +4 -0
  115. package/loadConfig.js +2 -0
  116. package/nesting/index.js +2 -12
  117. package/package.json +66 -57
  118. package/peers/index.js +75964 -55560
  119. package/plugin.d.ts +11 -0
  120. package/plugin.js +2 -1
  121. package/resolveConfig.d.ts +12 -0
  122. package/resolveConfig.js +2 -1
  123. package/scripts/generate-types.js +105 -0
  124. package/scripts/release-channel.js +18 -0
  125. package/scripts/release-notes.js +21 -0
  126. package/scripts/swap-engines.js +40 -0
  127. package/scripts/type-utils.js +27 -0
  128. package/src/cli/build/deps.js +56 -0
  129. package/src/cli/build/index.js +49 -0
  130. package/src/cli/build/plugin.js +444 -0
  131. package/src/cli/build/utils.js +76 -0
  132. package/src/cli/build/watching.js +229 -0
  133. package/src/cli/help/index.js +70 -0
  134. package/src/cli/index.js +216 -0
  135. package/src/cli/init/index.js +79 -0
  136. package/src/cli-peer-dependencies.js +7 -1
  137. package/src/cli.js +4 -765
  138. package/src/corePluginList.js +1 -1
  139. package/src/corePlugins.js +786 -306
  140. package/src/css/preflight.css +10 -8
  141. package/src/featureFlags.js +21 -5
  142. package/src/index.js +1 -34
  143. package/src/lib/cacheInvalidation.js +52 -0
  144. package/src/lib/collapseAdjacentRules.js +21 -2
  145. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  146. package/src/lib/content.js +208 -0
  147. package/src/lib/defaultExtractor.js +217 -0
  148. package/src/lib/detectNesting.js +9 -1
  149. package/src/lib/evaluateTailwindFunctions.js +79 -8
  150. package/src/lib/expandApplyAtRules.js +515 -153
  151. package/src/lib/expandTailwindAtRules.js +115 -86
  152. package/src/lib/findAtConfigPath.js +48 -0
  153. package/src/lib/generateRules.js +545 -147
  154. package/src/lib/getModuleDependencies.js +70 -30
  155. package/src/lib/load-config.ts +31 -0
  156. package/src/lib/normalizeTailwindDirectives.js +7 -1
  157. package/src/lib/offsets.js +373 -0
  158. package/src/lib/partitionApplyAtRules.js +52 -0
  159. package/src/lib/regex.js +74 -0
  160. package/src/lib/remap-bitfield.js +82 -0
  161. package/src/lib/resolveDefaultsAtRules.js +59 -17
  162. package/src/lib/setupContextUtils.js +701 -175
  163. package/src/lib/setupTrackingContext.js +51 -62
  164. package/src/lib/sharedState.js +58 -7
  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 +12 -2
  180. package/src/public/colors.js +22 -0
  181. package/src/public/default-config.js +1 -1
  182. package/src/public/default-theme.js +2 -2
  183. package/src/public/load-config.js +2 -0
  184. package/src/util/applyImportantSelector.js +27 -0
  185. package/src/util/buildMediaQuery.js +5 -3
  186. package/src/util/cloneNodes.js +19 -2
  187. package/src/util/color.js +44 -12
  188. package/src/util/colorNames.js +150 -0
  189. package/src/util/dataTypes.js +51 -16
  190. package/src/util/defaults.js +6 -0
  191. package/src/util/formatVariantSelector.js +264 -144
  192. package/src/util/getAllConfigs.js +21 -2
  193. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  194. package/src/util/log.js +11 -7
  195. package/src/util/nameClass.js +4 -0
  196. package/src/util/negateValue.js +11 -3
  197. package/src/util/normalizeConfig.js +57 -5
  198. package/src/util/normalizeScreens.js +105 -7
  199. package/src/util/parseBoxShadowValue.js +4 -3
  200. package/src/util/parseDependency.js +37 -42
  201. package/src/util/parseGlob.js +24 -0
  202. package/src/util/pluginUtils.js +123 -24
  203. package/src/util/prefixSelector.js +30 -10
  204. package/src/util/pseudoElements.js +170 -0
  205. package/src/util/removeAlphaVariables.js +24 -0
  206. package/src/util/resolveConfig.js +74 -26
  207. package/src/util/resolveConfigPath.js +12 -1
  208. package/src/util/splitAtTopLevelOnly.js +52 -0
  209. package/src/util/toPath.js +23 -1
  210. package/src/util/transformThemeValue.js +13 -3
  211. package/src/util/validateConfig.js +26 -0
  212. package/src/util/validateFormalSyntax.js +34 -0
  213. package/src/util/withAlphaVariable.js +1 -1
  214. package/stubs/.gitignore +1 -0
  215. package/stubs/.prettierrc.json +6 -0
  216. package/stubs/{defaultConfig.stub.js → config.full.js} +206 -166
  217. package/stubs/postcss.config.js +6 -0
  218. package/stubs/tailwind.config.cjs +2 -0
  219. package/stubs/tailwind.config.js +2 -0
  220. package/stubs/tailwind.config.ts +3 -0
  221. package/types/config.d.ts +368 -0
  222. package/types/generated/.gitkeep +0 -0
  223. package/types/generated/colors.d.ts +298 -0
  224. package/types/generated/corePluginList.d.ts +1 -0
  225. package/types/generated/default-theme.d.ts +371 -0
  226. package/types/index.d.ts +7 -0
  227. package/CHANGELOG.md +0 -1843
  228. package/lib/constants.js +0 -37
  229. package/lib/lib/setupWatchingContext.js +0 -288
  230. package/nesting/plugin.js +0 -41
  231. package/scripts/install-integrations.js +0 -27
  232. package/scripts/rebuildFixtures.js +0 -68
  233. package/src/constants.js +0 -17
  234. package/src/lib/setupWatchingContext.js +0 -311
  235. /package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -0
  236. /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
@@ -3,6 +3,7 @@ import * as path from 'path'
3
3
  import postcss from 'postcss'
4
4
  import createUtilityPlugin from './util/createUtilityPlugin'
5
5
  import buildMediaQuery from './util/buildMediaQuery'
6
+ import escapeClassName from './util/escapeClassName'
6
7
  import parseAnimationValue from './util/parseAnimationValue'
7
8
  import flattenColorPalette from './util/flattenColorPalette'
8
9
  import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
@@ -11,21 +12,43 @@ import isPlainObject from './util/isPlainObject'
11
12
  import transformThemeValue from './util/transformThemeValue'
12
13
  import { version as tailwindVersion } from '../package.json'
13
14
  import log from './util/log'
14
- import { normalizeScreens } from './util/normalizeScreens'
15
+ import {
16
+ normalizeScreens,
17
+ isScreenSortable,
18
+ compareScreens,
19
+ toScreen,
20
+ } from './util/normalizeScreens'
15
21
  import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
22
+ import { removeAlphaVariables } from './util/removeAlphaVariables'
23
+ import { flagEnabled } from './featureFlags'
24
+ import { normalize } from './util/dataTypes'
16
25
 
17
26
  export let variantPlugins = {
18
27
  pseudoElementVariants: ({ addVariant }) => {
19
28
  addVariant('first-letter', '&::first-letter')
20
29
  addVariant('first-line', '&::first-line')
21
30
 
22
- addVariant('marker', ['& *::marker', '&::marker'])
31
+ addVariant('marker', [
32
+ ({ container }) => {
33
+ removeAlphaVariables(container, ['--tw-text-opacity'])
34
+
35
+ return '& *::marker'
36
+ },
37
+ ({ container }) => {
38
+ removeAlphaVariables(container, ['--tw-text-opacity'])
39
+
40
+ return '&::marker'
41
+ },
42
+ ])
43
+
23
44
  addVariant('selection', ['& *::selection', '&::selection'])
24
45
 
25
46
  addVariant('file', '&::file-selector-button')
26
47
 
27
48
  addVariant('placeholder', '&::placeholder')
28
49
 
50
+ addVariant('backdrop', '&::backdrop')
51
+
29
52
  addVariant('before', ({ container }) => {
30
53
  container.walkRules((rule) => {
31
54
  let foundContent = false
@@ -57,22 +80,33 @@ export let variantPlugins = {
57
80
  })
58
81
  },
59
82
 
60
- pseudoClassVariants: ({ addVariant }) => {
83
+ pseudoClassVariants: ({ addVariant, matchVariant, config }) => {
61
84
  let pseudoVariants = [
62
85
  // Positional
63
- ['first', ':first-child'],
64
- ['last', ':last-child'],
65
- ['only', ':only-child'],
66
- ['odd', ':nth-child(odd)'],
67
- ['even', ':nth-child(even)'],
86
+ ['first', '&:first-child'],
87
+ ['last', '&:last-child'],
88
+ ['only', '&:only-child'],
89
+ ['odd', '&:nth-child(odd)'],
90
+ ['even', '&:nth-child(even)'],
68
91
  'first-of-type',
69
92
  'last-of-type',
70
93
  'only-of-type',
71
94
 
72
95
  // State
73
- 'visited',
96
+ [
97
+ 'visited',
98
+ ({ container }) => {
99
+ removeAlphaVariables(container, [
100
+ '--tw-text-opacity',
101
+ '--tw-border-opacity',
102
+ '--tw-bg-opacity',
103
+ ])
104
+
105
+ return '&:visited'
106
+ },
107
+ ],
74
108
  'target',
75
- ['open', '[open]'],
109
+ ['open', '&[open]'],
76
110
 
77
111
  // Forms
78
112
  'default',
@@ -80,6 +114,7 @@ export let variantPlugins = {
80
114
  'indeterminate',
81
115
  'placeholder-shown',
82
116
  'autofill',
117
+ 'optional',
83
118
  'required',
84
119
  'valid',
85
120
  'invalid',
@@ -92,44 +127,79 @@ export let variantPlugins = {
92
127
 
93
128
  // Interactive
94
129
  'focus-within',
95
- 'hover',
130
+ [
131
+ 'hover',
132
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
133
+ ? '&:hover'
134
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
135
+ ],
96
136
  'focus',
97
137
  'focus-visible',
98
138
  'active',
139
+ 'enabled',
99
140
  'disabled',
100
- ].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
141
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
101
142
 
102
143
  for (let [variantName, state] of pseudoVariants) {
103
- addVariant(variantName, `&${state}`)
104
- }
144
+ addVariant(variantName, (ctx) => {
145
+ let result = typeof state === 'function' ? state(ctx) : state
105
146
 
106
- for (let [variantName, state] of pseudoVariants) {
107
- addVariant(`group-${variantName}`, `:merge(.group)${state} &`)
147
+ return result
148
+ })
108
149
  }
109
150
 
110
- for (let [variantName, state] of pseudoVariants) {
111
- addVariant(`peer-${variantName}`, `:merge(.peer)${state} ~ &`)
151
+ let variants = {
152
+ group: (_, { modifier }) =>
153
+ modifier
154
+ ? [`:merge(.group\\/${escapeClassName(modifier)})`, ' &']
155
+ : [`:merge(.group)`, ' &'],
156
+ peer: (_, { modifier }) =>
157
+ modifier
158
+ ? [`:merge(.peer\\/${escapeClassName(modifier)})`, ' ~ &']
159
+ : [`:merge(.peer)`, ' ~ &'],
112
160
  }
113
- },
114
161
 
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
- ])
162
+ for (let [name, fn] of Object.entries(variants)) {
163
+ matchVariant(
164
+ name,
165
+ (value = '', extra) => {
166
+ let result = normalize(typeof value === 'function' ? value(extra) : value)
167
+ if (!result.includes('&')) result = '&' + result
168
+
169
+ let [a, b] = fn('', extra)
170
+
171
+ let start = null
172
+ let end = null
173
+ let quotes = 0
174
+
175
+ for (let i = 0; i < result.length; ++i) {
176
+ let c = result[i]
177
+ if (c === '&') {
178
+ start = i
179
+ } else if (c === "'" || c === '"') {
180
+ quotes += 1
181
+ } else if (start !== null && c === ' ' && !quotes) {
182
+ end = i
183
+ }
184
+ }
121
185
 
122
- return '[dir="ltr"] &'
123
- })
186
+ if (start !== null && end === null) {
187
+ end = result.length
188
+ }
124
189
 
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
- ])
190
+ // Basically this but can handle quotes:
191
+ // result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
130
192
 
131
- return '[dir="rtl"] &'
132
- })
193
+ return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end)
194
+ },
195
+ { values: Object.fromEntries(pseudoVariants) }
196
+ )
197
+ }
198
+ },
199
+
200
+ directionVariants: ({ addVariant }) => {
201
+ addVariant('ltr', ':is([dir="ltr"] &)')
202
+ addVariant('rtl', ':is([dir="rtl"] &)')
133
203
  },
134
204
 
135
205
  reducedMotionVariants: ({ addVariant }) => {
@@ -138,17 +208,19 @@ export let variantPlugins = {
138
208
  },
139
209
 
140
210
  darkVariants: ({ config, addVariant }) => {
141
- let mode = config('darkMode', 'media')
211
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
212
+
142
213
  if (mode === false) {
143
214
  mode = 'media'
144
215
  log.warn('darkmode-false', [
145
216
  'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
146
217
  'Change `darkMode` to `media` or remove it entirely.',
218
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
147
219
  ])
148
220
  }
149
221
 
150
222
  if (mode === 'class') {
151
- addVariant('dark', '.dark &')
223
+ addVariant('dark', `:is(${className} &)`)
152
224
  } else if (mode === 'media') {
153
225
  addVariant('dark', '@media (prefers-color-scheme: dark)')
154
226
  }
@@ -158,20 +230,246 @@ export let variantPlugins = {
158
230
  addVariant('print', '@media print')
159
231
  },
160
232
 
161
- screenVariants: ({ theme, addVariant }) => {
162
- for (let screen of normalizeScreens(theme('screens'))) {
163
- let query = buildMediaQuery(screen)
233
+ screenVariants: ({ theme, addVariant, matchVariant }) => {
234
+ let rawScreens = theme('screens') ?? {}
235
+ let areSimpleScreens = Object.values(rawScreens).every((v) => typeof v === 'string')
236
+ let screens = normalizeScreens(theme('screens'))
237
+
238
+ /** @type {Set<string>} */
239
+ let unitCache = new Set([])
240
+
241
+ /** @param {string} value */
242
+ function units(value) {
243
+ return value.match(/(\D+)$/)?.[1] ?? '(none)'
244
+ }
245
+
246
+ /** @param {string} value */
247
+ function recordUnits(value) {
248
+ if (value !== undefined) {
249
+ unitCache.add(units(value))
250
+ }
251
+ }
252
+
253
+ /** @param {string} value */
254
+ function canUseUnits(value) {
255
+ recordUnits(value)
256
+
257
+ // If the cache was empty it'll become 1 because we've just added the current unit
258
+ // If the cache was not empty and the units are the same the size doesn't change
259
+ // Otherwise, if the units are different from what is already known the size will always be > 1
260
+ return unitCache.size === 1
261
+ }
262
+
263
+ for (const screen of screens) {
264
+ for (const value of screen.values) {
265
+ recordUnits(value.min)
266
+ recordUnits(value.max)
267
+ }
268
+ }
269
+
270
+ let screensUseConsistentUnits = unitCache.size <= 1
271
+
272
+ /**
273
+ * @typedef {import('./util/normalizeScreens').Screen} Screen
274
+ */
275
+
276
+ /**
277
+ * @param {'min' | 'max'} type
278
+ * @returns {Record<string, Screen>}
279
+ */
280
+ function buildScreenValues(type) {
281
+ return Object.fromEntries(
282
+ screens
283
+ .filter((screen) => isScreenSortable(screen).result)
284
+ .map((screen) => {
285
+ let { min, max } = screen.values[0]
286
+
287
+ if (type === 'min' && min !== undefined) {
288
+ return screen
289
+ } else if (type === 'min' && max !== undefined) {
290
+ return { ...screen, not: !screen.not }
291
+ } else if (type === 'max' && max !== undefined) {
292
+ return screen
293
+ } else if (type === 'max' && min !== undefined) {
294
+ return { ...screen, not: !screen.not }
295
+ }
296
+ })
297
+ .map((screen) => [screen.name, screen])
298
+ )
299
+ }
164
300
 
165
- addVariant(screen.name, `@media ${query}`)
301
+ /**
302
+ * @param {'min' | 'max'} type
303
+ * @returns {(a: { value: string | Screen }, z: { value: string | Screen }) => number}
304
+ */
305
+ function buildSort(type) {
306
+ return (a, z) => compareScreens(type, a.value, z.value)
166
307
  }
308
+
309
+ let maxSort = buildSort('max')
310
+ let minSort = buildSort('min')
311
+
312
+ /** @param {'min'|'max'} type */
313
+ function buildScreenVariant(type) {
314
+ return (value) => {
315
+ if (!areSimpleScreens) {
316
+ log.warn('complex-screen-config', [
317
+ 'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects.',
318
+ ])
319
+
320
+ return []
321
+ } else if (!screensUseConsistentUnits) {
322
+ log.warn('mixed-screen-units', [
323
+ 'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
324
+ ])
325
+
326
+ return []
327
+ } else if (typeof value === 'string' && !canUseUnits(value)) {
328
+ log.warn('minmax-have-mixed-units', [
329
+ 'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
330
+ ])
331
+
332
+ return []
333
+ }
334
+
335
+ return [`@media ${buildMediaQuery(toScreen(value, type))}`]
336
+ }
337
+ }
338
+
339
+ matchVariant('max', buildScreenVariant('max'), {
340
+ sort: maxSort,
341
+ values: areSimpleScreens ? buildScreenValues('max') : {},
342
+ })
343
+
344
+ // screens and min-* are sorted together when they can be
345
+ let id = 'min-screens'
346
+ for (let screen of screens) {
347
+ addVariant(screen.name, `@media ${buildMediaQuery(screen)}`, {
348
+ id,
349
+ sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined,
350
+ value: screen,
351
+ })
352
+ }
353
+
354
+ matchVariant('min', buildScreenVariant('min'), {
355
+ id,
356
+ sort: minSort,
357
+ })
358
+ },
359
+
360
+ supportsVariants: ({ matchVariant, theme }) => {
361
+ matchVariant(
362
+ 'supports',
363
+ (value = '') => {
364
+ let check = normalize(value)
365
+ let isRaw = /^\w*\s*\(/.test(check)
366
+
367
+ // Chrome has a bug where `(condtion1)or(condition2)` is not valid
368
+ // But `(condition1) or (condition2)` is supported.
369
+ check = isRaw ? check.replace(/\b(and|or|not)\b/g, ' $1 ') : check
370
+
371
+ if (isRaw) {
372
+ return `@supports ${check}`
373
+ }
374
+
375
+ if (!check.includes(':')) {
376
+ check = `${check}: var(--tw)`
377
+ }
378
+
379
+ if (!(check.startsWith('(') && check.endsWith(')'))) {
380
+ check = `(${check})`
381
+ }
382
+
383
+ return `@supports ${check}`
384
+ },
385
+ { values: theme('supports') ?? {} }
386
+ )
387
+ },
388
+
389
+ ariaVariants: ({ matchVariant, theme }) => {
390
+ matchVariant('aria', (value) => `&[aria-${normalize(value)}]`, { values: theme('aria') ?? {} })
391
+ matchVariant(
392
+ 'group-aria',
393
+ (value, { modifier }) =>
394
+ modifier
395
+ ? `:merge(.group\\/${modifier})[aria-${normalize(value)}] &`
396
+ : `:merge(.group)[aria-${normalize(value)}] &`,
397
+ { values: theme('aria') ?? {} }
398
+ )
399
+ matchVariant(
400
+ 'peer-aria',
401
+ (value, { modifier }) =>
402
+ modifier
403
+ ? `:merge(.peer\\/${modifier})[aria-${normalize(value)}] ~ &`
404
+ : `:merge(.peer)[aria-${normalize(value)}] ~ &`,
405
+ { values: theme('aria') ?? {} }
406
+ )
407
+ },
408
+
409
+ dataVariants: ({ matchVariant, theme }) => {
410
+ matchVariant('data', (value) => `&[data-${normalize(value)}]`, { values: theme('data') ?? {} })
411
+ matchVariant(
412
+ 'group-data',
413
+ (value, { modifier }) =>
414
+ modifier
415
+ ? `:merge(.group\\/${modifier})[data-${normalize(value)}] &`
416
+ : `:merge(.group)[data-${normalize(value)}] &`,
417
+ { values: theme('data') ?? {} }
418
+ )
419
+ matchVariant(
420
+ 'peer-data',
421
+ (value, { modifier }) =>
422
+ modifier
423
+ ? `:merge(.peer\\/${modifier})[data-${normalize(value)}] ~ &`
424
+ : `:merge(.peer)[data-${normalize(value)}] ~ &`,
425
+ { values: theme('data') ?? {} }
426
+ )
167
427
  },
168
428
 
169
429
  orientationVariants: ({ addVariant }) => {
170
430
  addVariant('portrait', '@media (orientation: portrait)')
171
431
  addVariant('landscape', '@media (orientation: landscape)')
172
432
  },
433
+
434
+ prefersContrastVariants: ({ addVariant }) => {
435
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
436
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
437
+ },
173
438
  }
174
439
 
440
+ let cssTransformValue = [
441
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
442
+ 'rotate(var(--tw-rotate))',
443
+ 'skewX(var(--tw-skew-x))',
444
+ 'skewY(var(--tw-skew-y))',
445
+ 'scaleX(var(--tw-scale-x))',
446
+ 'scaleY(var(--tw-scale-y))',
447
+ ].join(' ')
448
+
449
+ let cssFilterValue = [
450
+ 'var(--tw-blur)',
451
+ 'var(--tw-brightness)',
452
+ 'var(--tw-contrast)',
453
+ 'var(--tw-grayscale)',
454
+ 'var(--tw-hue-rotate)',
455
+ 'var(--tw-invert)',
456
+ 'var(--tw-saturate)',
457
+ 'var(--tw-sepia)',
458
+ 'var(--tw-drop-shadow)',
459
+ ].join(' ')
460
+
461
+ let cssBackdropFilterValue = [
462
+ 'var(--tw-backdrop-blur)',
463
+ 'var(--tw-backdrop-brightness)',
464
+ 'var(--tw-backdrop-contrast)',
465
+ 'var(--tw-backdrop-grayscale)',
466
+ 'var(--tw-backdrop-hue-rotate)',
467
+ 'var(--tw-backdrop-invert)',
468
+ 'var(--tw-backdrop-opacity)',
469
+ 'var(--tw-backdrop-saturate)',
470
+ 'var(--tw-backdrop-sepia)',
471
+ ].join(' ')
472
+
175
473
  export let corePlugins = {
176
474
  preflight: ({ addBase }) => {
177
475
  let preflightStyles = postcss.parse(
@@ -310,6 +608,7 @@ export let corePlugins = {
310
608
  addUtilities({
311
609
  '.visible': { visibility: 'visible' },
312
610
  '.invisible': { visibility: 'hidden' },
611
+ '.collapse': { visibility: 'collapse' },
313
612
  })
314
613
  },
315
614
 
@@ -326,12 +625,14 @@ export let corePlugins = {
326
625
  inset: createUtilityPlugin(
327
626
  'inset',
328
627
  [
329
- ['inset', ['top', 'right', 'bottom', 'left']],
628
+ ['inset', ['inset']],
330
629
  [
331
630
  ['inset-x', ['left', 'right']],
332
631
  ['inset-y', ['top', 'bottom']],
333
632
  ],
334
633
  [
634
+ ['start', ['inset-inline-start']],
635
+ ['end', ['inset-inline-end']],
335
636
  ['top', ['top']],
336
637
  ['right', ['right']],
337
638
  ['bottom', ['bottom']],
@@ -383,6 +684,8 @@ export let corePlugins = {
383
684
  ['my', ['margin-top', 'margin-bottom']],
384
685
  ],
385
686
  [
687
+ ['ms', ['margin-inline-start']],
688
+ ['me', ['margin-inline-end']],
386
689
  ['mt', ['margin-top']],
387
690
  ['mr', ['margin-right']],
388
691
  ['mb', ['margin-bottom']],
@@ -399,6 +702,29 @@ export let corePlugins = {
399
702
  })
400
703
  },
401
704
 
705
+ lineClamp: ({ matchUtilities, addUtilities, theme }) => {
706
+ matchUtilities(
707
+ {
708
+ 'line-clamp': (value) => ({
709
+ overflow: 'hidden',
710
+ display: '-webkit-box',
711
+ '-webkit-box-orient': 'vertical',
712
+ '-webkit-line-clamp': `${value}`,
713
+ }),
714
+ },
715
+ { values: theme('lineClamp') }
716
+ )
717
+
718
+ addUtilities({
719
+ '.line-clamp-none': {
720
+ overflow: 'visible',
721
+ display: 'block',
722
+ '-webkit-box-orient': 'horizontal',
723
+ '-webkit-line-clamp': 'none',
724
+ },
725
+ })
726
+ },
727
+
402
728
  display: ({ addUtilities }) => {
403
729
  addUtilities({
404
730
  '.block': { display: 'block' },
@@ -453,6 +779,13 @@ export let corePlugins = {
453
779
  })
454
780
  },
455
781
 
782
+ captionSide: ({ addUtilities }) => {
783
+ addUtilities({
784
+ '.caption-top': { 'caption-side': 'top' },
785
+ '.caption-bottom': { 'caption-side': 'bottom' },
786
+ })
787
+ },
788
+
456
789
  borderCollapse: ({ addUtilities }) => {
457
790
  addUtilities({
458
791
  '.border-collapse': { 'border-collapse': 'collapse' },
@@ -460,6 +793,41 @@ export let corePlugins = {
460
793
  })
461
794
  },
462
795
 
796
+ borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
797
+ addDefaults('border-spacing', {
798
+ '--tw-border-spacing-x': 0,
799
+ '--tw-border-spacing-y': 0,
800
+ })
801
+
802
+ matchUtilities(
803
+ {
804
+ 'border-spacing': (value) => {
805
+ return {
806
+ '--tw-border-spacing-x': value,
807
+ '--tw-border-spacing-y': value,
808
+ '@defaults border-spacing': {},
809
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
810
+ }
811
+ },
812
+ 'border-spacing-x': (value) => {
813
+ return {
814
+ '--tw-border-spacing-x': value,
815
+ '@defaults border-spacing': {},
816
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
817
+ }
818
+ },
819
+ 'border-spacing-y': (value) => {
820
+ return {
821
+ '--tw-border-spacing-y': value,
822
+ '@defaults border-spacing': {},
823
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
824
+ }
825
+ },
826
+ },
827
+ { values: theme('borderSpacing') }
828
+ )
829
+ },
830
+
463
831
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
464
832
  translate: createUtilityPlugin(
465
833
  'translate',
@@ -467,11 +835,11 @@ export let corePlugins = {
467
835
  [
468
836
  [
469
837
  'translate-x',
470
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
838
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
471
839
  ],
472
840
  [
473
841
  'translate-y',
474
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
842
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
475
843
  ],
476
844
  ],
477
845
  ],
@@ -479,102 +847,73 @@ export let corePlugins = {
479
847
  ),
480
848
  rotate: createUtilityPlugin(
481
849
  'rotate',
482
- [
483
- [
484
- 'rotate',
485
- [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
486
- ],
487
- ],
850
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
488
851
  { supportsNegativeValues: true }
489
852
  ),
490
853
  skew: createUtilityPlugin(
491
854
  'skew',
492
855
  [
493
856
  [
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
- ],
857
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
858
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
502
859
  ],
503
860
  ],
504
861
  { supportsNegativeValues: true }
505
862
  ),
506
- scale: createUtilityPlugin('scale', [
863
+ scale: createUtilityPlugin(
864
+ 'scale',
507
865
  [
508
- 'scale',
509
866
  [
510
- ['@defaults transform', {}],
511
- '--tw-scale-x',
512
- '--tw-scale-y',
513
- ['transform', 'var(--tw-transform)'],
514
- ],
515
- ],
516
- [
517
- [
518
- 'scale-x',
519
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
867
+ 'scale',
868
+ [
869
+ ['@defaults transform', {}],
870
+ '--tw-scale-x',
871
+ '--tw-scale-y',
872
+ ['transform', cssTransformValue],
873
+ ],
520
874
  ],
521
875
  [
522
- 'scale-y',
523
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
876
+ [
877
+ 'scale-x',
878
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
879
+ ],
880
+ [
881
+ 'scale-y',
882
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
883
+ ],
524
884
  ],
525
885
  ],
526
- ]),
886
+ { supportsNegativeValues: true }
887
+ ),
888
+
889
+ transform: ({ addDefaults, addUtilities }) => {
890
+ addDefaults('transform', {
891
+ '--tw-translate-x': '0',
892
+ '--tw-translate-y': '0',
893
+ '--tw-rotate': '0',
894
+ '--tw-skew-x': '0',
895
+ '--tw-skew-y': '0',
896
+ '--tw-scale-x': '1',
897
+ '--tw-scale-y': '1',
898
+ })
527
899
 
528
- transform: ({ addBase, addUtilities }) => {
529
- addBase({
530
- '@defaults transform': {
531
- '--tw-translate-x': '0',
532
- '--tw-translate-y': '0',
533
- '--tw-rotate': '0',
534
- '--tw-skew-x': '0',
535
- '--tw-skew-y': '0',
536
- '--tw-scale-x': '1',
537
- '--tw-scale-y': '1',
538
- '--tw-transform': [
539
- 'translateX(var(--tw-translate-x))',
540
- 'translateY(var(--tw-translate-y))',
541
- 'rotate(var(--tw-rotate))',
542
- 'skewX(var(--tw-skew-x))',
543
- 'skewY(var(--tw-skew-y))',
544
- 'scaleX(var(--tw-scale-x))',
545
- 'scaleY(var(--tw-scale-y))',
546
- ].join(' '),
547
- },
548
- })
549
- addUtilities({
550
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
900
+ addUtilities({
901
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
551
902
  '.transform-cpu': {
552
- '--tw-transform': [
553
- 'translateX(var(--tw-translate-x))',
554
- 'translateY(var(--tw-translate-y))',
555
- 'rotate(var(--tw-rotate))',
556
- 'skewX(var(--tw-skew-x))',
557
- 'skewY(var(--tw-skew-y))',
558
- 'scaleX(var(--tw-scale-x))',
559
- 'scaleY(var(--tw-scale-y))',
560
- ].join(' '),
903
+ transform: cssTransformValue,
561
904
  },
562
905
  '.transform-gpu': {
563
- '--tw-transform': [
564
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
565
- 'rotate(var(--tw-rotate))',
566
- 'skewX(var(--tw-skew-x))',
567
- 'skewY(var(--tw-skew-y))',
568
- 'scaleX(var(--tw-scale-x))',
569
- 'scaleY(var(--tw-scale-y))',
570
- ].join(' '),
906
+ transform: cssTransformValue.replace(
907
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
908
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
909
+ ),
571
910
  },
572
911
  '.transform-none': { transform: 'none' },
573
912
  })
574
913
  },
575
914
 
576
- animation: ({ matchUtilities, theme, prefix }) => {
577
- let prefixName = (name) => prefix(`.${name}`).slice(1)
915
+ animation: ({ matchUtilities, theme, config }) => {
916
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
578
917
  let keyframes = Object.fromEntries(
579
918
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
580
919
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -607,53 +946,52 @@ export let corePlugins = {
607
946
 
608
947
  cursor: createUtilityPlugin('cursor'),
609
948
 
610
- touchAction: ({ addBase, addUtilities }) => {
611
- addBase({
612
- '@defaults touch-action': {
613
- '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
614
- '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
615
- '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
616
- '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
617
- },
949
+ touchAction: ({ addDefaults, addUtilities }) => {
950
+ addDefaults('touch-action', {
951
+ '--tw-pan-x': ' ',
952
+ '--tw-pan-y': ' ',
953
+ '--tw-pinch-zoom': ' ',
618
954
  })
619
955
 
956
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
957
+
620
958
  addUtilities({
621
959
  '.touch-auto': { 'touch-action': 'auto' },
622
960
  '.touch-none': { 'touch-action': 'none' },
623
961
  '.touch-pan-x': {
624
962
  '@defaults touch-action': {},
625
963
  '--tw-pan-x': 'pan-x',
626
- 'touch-action': 'var(--tw-touch-action)',
964
+ 'touch-action': cssTouchActionValue,
627
965
  },
628
966
  '.touch-pan-left': {
629
967
  '@defaults touch-action': {},
630
968
  '--tw-pan-x': 'pan-left',
631
- 'touch-action': 'var(--tw-touch-action)',
969
+ 'touch-action': cssTouchActionValue,
632
970
  },
633
971
  '.touch-pan-right': {
634
972
  '@defaults touch-action': {},
635
973
  '--tw-pan-x': 'pan-right',
636
- 'touch-action': 'var(--tw-touch-action)',
974
+ 'touch-action': cssTouchActionValue,
637
975
  },
638
976
  '.touch-pan-y': {
639
977
  '@defaults touch-action': {},
640
978
  '--tw-pan-y': 'pan-y',
641
- 'touch-action': 'var(--tw-touch-action)',
979
+ 'touch-action': cssTouchActionValue,
642
980
  },
643
981
  '.touch-pan-up': {
644
982
  '@defaults touch-action': {},
645
983
  '--tw-pan-y': 'pan-up',
646
- 'touch-action': 'var(--tw-touch-action)',
984
+ 'touch-action': cssTouchActionValue,
647
985
  },
648
986
  '.touch-pan-down': {
649
987
  '@defaults touch-action': {},
650
988
  '--tw-pan-y': 'pan-down',
651
- 'touch-action': 'var(--tw-touch-action)',
989
+ 'touch-action': cssTouchActionValue,
652
990
  },
653
991
  '.touch-pinch-zoom': {
654
992
  '@defaults touch-action': {},
655
993
  '--tw-pinch-zoom': 'pinch-zoom',
656
- 'touch-action': 'var(--tw-touch-action)',
994
+ 'touch-action': cssTouchActionValue,
657
995
  },
658
996
  '.touch-manipulation': { 'touch-action': 'manipulation' },
659
997
  })
@@ -677,11 +1015,9 @@ export let corePlugins = {
677
1015
  })
678
1016
  },
679
1017
 
680
- scrollSnapType: ({ addUtilities, addBase }) => {
681
- addBase({
682
- '@defaults scroll-snap-type': {
683
- '--tw-scroll-snap-strictness': 'proximity',
684
- },
1018
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
1019
+ addDefaults('scroll-snap-type', {
1020
+ '--tw-scroll-snap-strictness': 'proximity',
685
1021
  })
686
1022
 
687
1023
  addUtilities({
@@ -728,6 +1064,8 @@ export let corePlugins = {
728
1064
  ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
729
1065
  ],
730
1066
  [
1067
+ ['scroll-ms', ['scroll-margin-inline-start']],
1068
+ ['scroll-me', ['scroll-margin-inline-end']],
731
1069
  ['scroll-mt', ['scroll-margin-top']],
732
1070
  ['scroll-mr', ['scroll-margin-right']],
733
1071
  ['scroll-mb', ['scroll-margin-bottom']],
@@ -744,6 +1082,8 @@ export let corePlugins = {
744
1082
  ['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
745
1083
  ],
746
1084
  [
1085
+ ['scroll-ps', ['scroll-padding-inline-start']],
1086
+ ['scroll-pe', ['scroll-padding-inline-end']],
747
1087
  ['scroll-pt', ['scroll-padding-top']],
748
1088
  ['scroll-pr', ['scroll-padding-right']],
749
1089
  ['scroll-pb', ['scroll-padding-bottom']],
@@ -757,8 +1097,8 @@ export let corePlugins = {
757
1097
  '.list-outside': { 'list-style-position': 'outside' },
758
1098
  })
759
1099
  },
760
-
761
1100
  listStyleType: createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]),
1101
+ listStyleImage: createUtilityPlugin('listStyleImage', [['list-image', ['listStyleImage']]]),
762
1102
 
763
1103
  appearance: ({ addUtilities }) => {
764
1104
  addUtilities({
@@ -809,6 +1149,7 @@ export let corePlugins = {
809
1149
  addUtilities({
810
1150
  '.grid-flow-row': { gridAutoFlow: 'row' },
811
1151
  '.grid-flow-col': { gridAutoFlow: 'column' },
1152
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
812
1153
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
813
1154
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
814
1155
  })
@@ -845,6 +1186,7 @@ export let corePlugins = {
845
1186
  '.place-content-between': { 'place-content': 'space-between' },
846
1187
  '.place-content-around': { 'place-content': 'space-around' },
847
1188
  '.place-content-evenly': { 'place-content': 'space-evenly' },
1189
+ '.place-content-baseline': { 'place-content': 'baseline' },
848
1190
  '.place-content-stretch': { 'place-content': 'stretch' },
849
1191
  })
850
1192
  },
@@ -854,18 +1196,22 @@ export let corePlugins = {
854
1196
  '.place-items-start': { 'place-items': 'start' },
855
1197
  '.place-items-end': { 'place-items': 'end' },
856
1198
  '.place-items-center': { 'place-items': 'center' },
1199
+ '.place-items-baseline': { 'place-items': 'baseline' },
857
1200
  '.place-items-stretch': { 'place-items': 'stretch' },
858
1201
  })
859
1202
  },
860
1203
 
861
1204
  alignContent: ({ addUtilities }) => {
862
1205
  addUtilities({
1206
+ '.content-normal': { 'align-content': 'normal' },
863
1207
  '.content-center': { 'align-content': 'center' },
864
1208
  '.content-start': { 'align-content': 'flex-start' },
865
1209
  '.content-end': { 'align-content': 'flex-end' },
866
1210
  '.content-between': { 'align-content': 'space-between' },
867
1211
  '.content-around': { 'align-content': 'space-around' },
868
1212
  '.content-evenly': { 'align-content': 'space-evenly' },
1213
+ '.content-baseline': { 'align-content': 'baseline' },
1214
+ '.content-stretch': { 'align-content': 'stretch' },
869
1215
  })
870
1216
  },
871
1217
 
@@ -881,12 +1227,14 @@ export let corePlugins = {
881
1227
 
882
1228
  justifyContent: ({ addUtilities }) => {
883
1229
  addUtilities({
1230
+ '.justify-normal': { 'justify-content': 'normal' },
884
1231
  '.justify-start': { 'justify-content': 'flex-start' },
885
1232
  '.justify-end': { 'justify-content': 'flex-end' },
886
1233
  '.justify-center': { 'justify-content': 'center' },
887
1234
  '.justify-between': { 'justify-content': 'space-between' },
888
1235
  '.justify-around': { 'justify-content': 'space-around' },
889
1236
  '.justify-evenly': { 'justify-content': 'space-evenly' },
1237
+ '.justify-stretch': { 'justify-content': 'stretch' },
890
1238
  })
891
1239
  },
892
1240
 
@@ -913,6 +1261,16 @@ export let corePlugins = {
913
1261
  'space-x': (value) => {
914
1262
  value = value === '0' ? '0px' : value
915
1263
 
1264
+ if (__OXIDE__) {
1265
+ return {
1266
+ '& > :not([hidden]) ~ :not([hidden])': {
1267
+ '--tw-space-x-reverse': '0',
1268
+ 'margin-inline-end': `calc(${value} * var(--tw-space-x-reverse))`,
1269
+ 'margin-inline-start': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`,
1270
+ },
1271
+ }
1272
+ }
1273
+
916
1274
  return {
917
1275
  '& > :not([hidden]) ~ :not([hidden])': {
918
1276
  '--tw-space-x-reverse': '0',
@@ -948,6 +1306,17 @@ export let corePlugins = {
948
1306
  'divide-x': (value) => {
949
1307
  value = value === '0' ? '0px' : value
950
1308
 
1309
+ if (__OXIDE__) {
1310
+ return {
1311
+ '& > :not([hidden]) ~ :not([hidden])': {
1312
+ '@defaults border-width': {},
1313
+ '--tw-divide-x-reverse': '0',
1314
+ 'border-inline-end-width': `calc(${value} * var(--tw-divide-x-reverse))`,
1315
+ 'border-inline-start-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`,
1316
+ },
1317
+ }
1318
+ }
1319
+
951
1320
  return {
952
1321
  '& > :not([hidden]) ~ :not([hidden])': {
953
1322
  '@defaults border-width': {},
@@ -970,7 +1339,7 @@ export let corePlugins = {
970
1339
  }
971
1340
  },
972
1341
  },
973
- { values: theme('divideWidth'), type: ['line-width', 'length'] }
1342
+ { values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
974
1343
  )
975
1344
 
976
1345
  addUtilities({
@@ -1018,7 +1387,7 @@ export let corePlugins = {
1018
1387
  },
1019
1388
  {
1020
1389
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1021
- type: 'color',
1390
+ type: ['color', 'any'],
1022
1391
  }
1023
1392
  )
1024
1393
  },
@@ -1115,6 +1484,14 @@ export let corePlugins = {
1115
1484
  })
1116
1485
  },
1117
1486
 
1487
+ hyphens: ({ addUtilities }) => {
1488
+ addUtilities({
1489
+ '.hyphens-none': { hyphens: 'none' },
1490
+ '.hyphens-manual': { hyphens: 'manual' },
1491
+ '.hyphens-auto': { hyphens: 'auto' },
1492
+ })
1493
+ },
1494
+
1118
1495
  whitespace: ({ addUtilities }) => {
1119
1496
  addUtilities({
1120
1497
  '.whitespace-normal': { 'white-space': 'normal' },
@@ -1122,6 +1499,7 @@ export let corePlugins = {
1122
1499
  '.whitespace-pre': { 'white-space': 'pre' },
1123
1500
  '.whitespace-pre-line': { 'white-space': 'pre-line' },
1124
1501
  '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
1502
+ '.whitespace-break-spaces': { 'white-space': 'break-spaces' },
1125
1503
  })
1126
1504
  },
1127
1505
 
@@ -1130,18 +1508,25 @@ export let corePlugins = {
1130
1508
  '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1131
1509
  '.break-words': { 'overflow-wrap': 'break-word' },
1132
1510
  '.break-all': { 'word-break': 'break-all' },
1511
+ '.break-keep': { 'word-break': 'keep-all' },
1133
1512
  })
1134
1513
  },
1135
1514
 
1136
1515
  borderRadius: createUtilityPlugin('borderRadius', [
1137
1516
  ['rounded', ['border-radius']],
1138
1517
  [
1518
+ ['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
1519
+ ['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
1139
1520
  ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
1140
1521
  ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
1141
1522
  ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
1142
1523
  ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
1143
1524
  ],
1144
1525
  [
1526
+ ['rounded-ss', ['border-start-start-radius']],
1527
+ ['rounded-se', ['border-start-end-radius']],
1528
+ ['rounded-ee', ['border-end-end-radius']],
1529
+ ['rounded-es', ['border-end-start-radius']],
1145
1530
  ['rounded-tl', ['border-top-left-radius']],
1146
1531
  ['rounded-tr', ['border-top-right-radius']],
1147
1532
  ['rounded-br', ['border-bottom-right-radius']],
@@ -1158,6 +1543,8 @@ export let corePlugins = {
1158
1543
  ['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
1159
1544
  ],
1160
1545
  [
1546
+ ['border-s', [['@defaults border-width', {}], 'border-inline-start-width']],
1547
+ ['border-e', [['@defaults border-width', {}], 'border-inline-end-width']],
1161
1548
  ['border-t', [['@defaults border-width', {}], 'border-top-width']],
1162
1549
  ['border-r', [['@defaults border-width', {}], 'border-right-width']],
1163
1550
  ['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
@@ -1178,24 +1565,7 @@ export let corePlugins = {
1178
1565
  })
1179
1566
  },
1180
1567
 
1181
- borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1182
- if (!corePlugins('borderOpacity')) {
1183
- let value = theme('borderColor.DEFAULT', 'currentColor')
1184
- addBase({
1185
- '@defaults border-width': {
1186
- 'border-color': toColorValue(value),
1187
- },
1188
- })
1189
- } else {
1190
- addBase({
1191
- '@defaults border-width': withAlphaVariable({
1192
- color: theme('borderColor.DEFAULT', 'currentColor'),
1193
- property: 'border-color',
1194
- variable: '--tw-border-opacity',
1195
- }),
1196
- })
1197
- }
1198
-
1568
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1199
1569
  matchUtilities(
1200
1570
  {
1201
1571
  border: (value) => {
@@ -1214,7 +1584,7 @@ export let corePlugins = {
1214
1584
  },
1215
1585
  {
1216
1586
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1217
- type: ['color'],
1587
+ type: ['color', 'any'],
1218
1588
  }
1219
1589
  )
1220
1590
 
@@ -1251,12 +1621,38 @@ export let corePlugins = {
1251
1621
  },
1252
1622
  {
1253
1623
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1254
- type: 'color',
1624
+ type: ['color', 'any'],
1255
1625
  }
1256
1626
  )
1257
1627
 
1258
1628
  matchUtilities(
1259
1629
  {
1630
+ 'border-s': (value) => {
1631
+ if (!corePlugins('borderOpacity')) {
1632
+ return {
1633
+ 'border-inline-start-color': toColorValue(value),
1634
+ }
1635
+ }
1636
+
1637
+ return withAlphaVariable({
1638
+ color: value,
1639
+ property: 'border-inline-start-color',
1640
+ variable: '--tw-border-opacity',
1641
+ })
1642
+ },
1643
+ 'border-e': (value) => {
1644
+ if (!corePlugins('borderOpacity')) {
1645
+ return {
1646
+ 'border-inline-end-color': toColorValue(value),
1647
+ }
1648
+ }
1649
+
1650
+ return withAlphaVariable({
1651
+ color: value,
1652
+ property: 'border-inline-end-color',
1653
+ variable: '--tw-border-opacity',
1654
+ })
1655
+ },
1260
1656
  'border-t': (value) => {
1261
1657
  if (!corePlugins('borderOpacity')) {
1262
1658
  return {
@@ -1312,7 +1708,7 @@ export let corePlugins = {
1312
1708
  },
1313
1709
  {
1314
1710
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1315
- type: 'color',
1711
+ type: ['color', 'any'],
1316
1712
  }
1317
1713
  )
1318
1714
  },
@@ -1338,7 +1734,7 @@ export let corePlugins = {
1338
1734
  })
1339
1735
  },
1340
1736
  },
1341
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1737
+ { values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
1342
1738
  )
1343
1739
  },
1344
1740
 
@@ -1353,44 +1749,98 @@ export let corePlugins = {
1353
1749
  return withAlphaValue(value, 0, 'rgb(255 255 255 / 0)')
1354
1750
  }
1355
1751
 
1356
- return function ({ matchUtilities, theme }) {
1752
+ return function ({ matchUtilities, theme, addDefaults }) {
1753
+ addDefaults('gradient-color-stops', {
1754
+ '--tw-gradient-from-position': ' ',
1755
+ '--tw-gradient-via-position': ' ',
1756
+ '--tw-gradient-to-position': ' ',
1757
+ })
1758
+
1357
1759
  let options = {
1358
1760
  values: flattenColorPalette(theme('gradientColorStops')),
1359
1761
  type: ['color', 'any'],
1360
1762
  }
1361
1763
 
1764
+ let positionOptions = {
1765
+ values: theme('gradientColorStopPositions'),
1766
+ type: ['length', 'percentage'],
1767
+ }
1768
+
1362
1769
  matchUtilities(
1363
1770
  {
1364
1771
  from: (value) => {
1365
1772
  let transparentToValue = transparentTo(value)
1366
1773
 
1367
1774
  return {
1368
- '--tw-gradient-from': toColorValue(value, 'from'),
1369
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1775
+ '@defaults gradient-color-stops': {},
1776
+ '--tw-gradient-from': `${toColorValue(value)} var(--tw-gradient-from-position)`,
1777
+ '--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
1778
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
1370
1779
  }
1371
1780
  },
1372
1781
  },
1373
1782
  options
1374
1783
  )
1784
+
1785
+ matchUtilities(
1786
+ {
1787
+ from: (value) => {
1788
+ return {
1789
+ '--tw-gradient-from-position': value,
1790
+ }
1791
+ },
1792
+ },
1793
+ positionOptions
1794
+ )
1795
+
1375
1796
  matchUtilities(
1376
1797
  {
1377
1798
  via: (value) => {
1378
1799
  let transparentToValue = transparentTo(value)
1379
1800
 
1380
1801
  return {
1802
+ '@defaults gradient-color-stops': {},
1803
+ '--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
1381
1804
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1382
- value,
1383
- 'via'
1384
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1805
+ value
1806
+ )} var(--tw-gradient-via-position), var(--tw-gradient-to)`,
1385
1807
  }
1386
1808
  },
1387
1809
  },
1388
1810
  options
1389
1811
  )
1812
+
1390
1813
  matchUtilities(
1391
- { to: (value) => ({ '--tw-gradient-to': toColorValue(value, 'to') }) },
1814
+ {
1815
+ via: (value) => {
1816
+ return {
1817
+ '--tw-gradient-via-position': value,
1818
+ }
1819
+ },
1820
+ },
1821
+ positionOptions
1822
+ )
1823
+
1824
+ matchUtilities(
1825
+ {
1826
+ to: (value) => ({
1827
+ '@defaults gradient-color-stops': {},
1828
+ '--tw-gradient-to': `${toColorValue(value)} var(--tw-gradient-to-position)`,
1829
+ }),
1830
+ },
1392
1831
  options
1393
1832
  )
1833
+
1834
+ matchUtilities(
1835
+ {
1836
+ to: (value) => {
1837
+ return {
1838
+ '--tw-gradient-to-position': value,
1839
+ }
1840
+ },
1841
+ },
1842
+ positionOptions
1843
+ )
1394
1844
  }
1395
1845
  })(),
1396
1846
 
@@ -1404,7 +1854,7 @@ export let corePlugins = {
1404
1854
  },
1405
1855
 
1406
1856
  backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1407
- type: ['lookup', 'length', 'percentage'],
1857
+ type: ['lookup', 'length', 'percentage', 'size'],
1408
1858
  }),
1409
1859
 
1410
1860
  backgroundAttachment: ({ addUtilities }) => {
@@ -1425,7 +1875,7 @@ export let corePlugins = {
1425
1875
  },
1426
1876
 
1427
1877
  backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1428
- type: ['lookup', 'position'],
1878
+ type: ['lookup', ['position', { preferOnConflict: true }]],
1429
1879
  }),
1430
1880
 
1431
1881
  backgroundRepeat: ({ addUtilities }) => {
@@ -1465,7 +1915,7 @@ export let corePlugins = {
1465
1915
  return { stroke: toColorValue(value) }
1466
1916
  },
1467
1917
  },
1468
- { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1918
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
1469
1919
  )
1470
1920
  },
1471
1921
 
@@ -1491,6 +1941,8 @@ export let corePlugins = {
1491
1941
  ['py', ['padding-top', 'padding-bottom']],
1492
1942
  ],
1493
1943
  [
1944
+ ['ps', ['padding-inline-start']],
1945
+ ['pe', ['padding-inline-end']],
1494
1946
  ['pt', ['padding-top']],
1495
1947
  ['pr', ['padding-right']],
1496
1948
  ['pb', ['padding-bottom']],
@@ -1504,6 +1956,8 @@ export let corePlugins = {
1504
1956
  '.text-center': { 'text-align': 'center' },
1505
1957
  '.text-right': { 'text-align': 'right' },
1506
1958
  '.text-justify': { 'text-align': 'justify' },
1959
+ '.text-start': { 'text-align': 'start' },
1960
+ '.text-end': { 'text-align': 'end' },
1507
1961
  })
1508
1962
  },
1509
1963
 
@@ -1526,16 +1980,46 @@ export let corePlugins = {
1526
1980
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1527
1981
  },
1528
1982
 
1529
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1530
- type: ['lookup', 'generic-name', 'family-name'],
1531
- }),
1983
+ fontFamily: ({ matchUtilities, theme }) => {
1984
+ matchUtilities(
1985
+ {
1986
+ font: (value) => {
1987
+ let [families, options = {}] =
1988
+ Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
1989
+ let { fontFeatureSettings, fontVariationSettings } = options
1990
+
1991
+ return {
1992
+ 'font-family': Array.isArray(families) ? families.join(', ') : families,
1993
+ ...(fontFeatureSettings === undefined
1994
+ ? {}
1995
+ : { 'font-feature-settings': fontFeatureSettings }),
1996
+ ...(fontVariationSettings === undefined
1997
+ ? {}
1998
+ : { 'font-variation-settings': fontVariationSettings }),
1999
+ }
2000
+ },
2001
+ },
2002
+ {
2003
+ values: theme('fontFamily'),
2004
+ type: ['lookup', 'generic-name', 'family-name'],
2005
+ }
2006
+ )
2007
+ },
1532
2008
 
1533
2009
  fontSize: ({ matchUtilities, theme }) => {
1534
2010
  matchUtilities(
1535
2011
  {
1536
- text: (value) => {
2012
+ text: (value, { modifier }) => {
1537
2013
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1538
- let { lineHeight, letterSpacing } = isPlainObject(options)
2014
+
2015
+ if (modifier) {
2016
+ return {
2017
+ 'font-size': fontSize,
2018
+ 'line-height': modifier,
2019
+ }
2020
+ }
2021
+
2022
+ let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1539
2023
  ? options
1540
2024
  : { lineHeight: options }
1541
2025
 
@@ -1543,18 +2027,20 @@ export let corePlugins = {
1543
2027
  'font-size': fontSize,
1544
2028
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1545
2029
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
2030
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1546
2031
  }
1547
2032
  },
1548
2033
  },
1549
2034
  {
1550
2035
  values: theme('fontSize'),
2036
+ modifiers: theme('lineHeight'),
1551
2037
  type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1552
2038
  }
1553
2039
  )
1554
2040
  },
1555
2041
 
1556
2042
  fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1557
- type: ['lookup', 'number'],
2043
+ type: ['lookup', 'number', 'any'],
1558
2044
  }),
1559
2045
 
1560
2046
  textTransform: ({ addUtilities }) => {
@@ -1573,57 +2059,59 @@ export let corePlugins = {
1573
2059
  })
1574
2060
  },
1575
2061
 
1576
- fontVariantNumeric: ({ addUtilities }) => {
2062
+ fontVariantNumeric: ({ addDefaults, addUtilities }) => {
2063
+ let cssFontVariantNumericValue =
2064
+ 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
2065
+
2066
+ addDefaults('font-variant-numeric', {
2067
+ '--tw-ordinal': ' ',
2068
+ '--tw-slashed-zero': ' ',
2069
+ '--tw-numeric-figure': ' ',
2070
+ '--tw-numeric-spacing': ' ',
2071
+ '--tw-numeric-fraction': ' ',
2072
+ })
2073
+
1577
2074
  addUtilities({
1578
- '@defaults font-variant-numeric': {
1579
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1580
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1581
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1582
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1583
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1584
- '--tw-font-variant-numeric':
1585
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1586
- },
1587
2075
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1588
2076
  '.ordinal': {
1589
2077
  '@defaults font-variant-numeric': {},
1590
2078
  '--tw-ordinal': 'ordinal',
1591
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2079
+ 'font-variant-numeric': cssFontVariantNumericValue,
1592
2080
  },
1593
2081
  '.slashed-zero': {
1594
2082
  '@defaults font-variant-numeric': {},
1595
2083
  '--tw-slashed-zero': 'slashed-zero',
1596
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2084
+ 'font-variant-numeric': cssFontVariantNumericValue,
1597
2085
  },
1598
2086
  '.lining-nums': {
1599
2087
  '@defaults font-variant-numeric': {},
1600
2088
  '--tw-numeric-figure': 'lining-nums',
1601
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2089
+ 'font-variant-numeric': cssFontVariantNumericValue,
1602
2090
  },
1603
2091
  '.oldstyle-nums': {
1604
2092
  '@defaults font-variant-numeric': {},
1605
2093
  '--tw-numeric-figure': 'oldstyle-nums',
1606
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2094
+ 'font-variant-numeric': cssFontVariantNumericValue,
1607
2095
  },
1608
2096
  '.proportional-nums': {
1609
2097
  '@defaults font-variant-numeric': {},
1610
2098
  '--tw-numeric-spacing': 'proportional-nums',
1611
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2099
+ 'font-variant-numeric': cssFontVariantNumericValue,
1612
2100
  },
1613
2101
  '.tabular-nums': {
1614
2102
  '@defaults font-variant-numeric': {},
1615
2103
  '--tw-numeric-spacing': 'tabular-nums',
1616
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2104
+ 'font-variant-numeric': cssFontVariantNumericValue,
1617
2105
  },
1618
2106
  '.diagonal-fractions': {
1619
2107
  '@defaults font-variant-numeric': {},
1620
2108
  '--tw-numeric-fraction': 'diagonal-fractions',
1621
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2109
+ 'font-variant-numeric': cssFontVariantNumericValue,
1622
2110
  },
1623
2111
  '.stacked-fractions': {
1624
2112
  '@defaults font-variant-numeric': {},
1625
2113
  '--tw-numeric-fraction': 'stacked-fractions',
1626
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2114
+ 'font-variant-numeric': cssFontVariantNumericValue,
1627
2115
  },
1628
2116
  })
1629
2117
  },
@@ -1648,7 +2136,7 @@ export let corePlugins = {
1648
2136
  })
1649
2137
  },
1650
2138
  },
1651
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
2139
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
1652
2140
  )
1653
2141
  },
1654
2142
 
@@ -1656,10 +2144,10 @@ export let corePlugins = {
1656
2144
 
1657
2145
  textDecoration: ({ addUtilities }) => {
1658
2146
  addUtilities({
1659
- '.underline': { 'text-decoration': 'underline' },
1660
- '.overline': { 'text-decoration': 'overline' },
1661
- '.line-through': { 'text-decoration': 'line-through' },
1662
- '.no-underline': { 'text-decoration': 'none' },
2147
+ '.underline': { 'text-decoration-line': 'underline' },
2148
+ '.overline': { 'text-decoration-line': 'overline' },
2149
+ '.line-through': { 'text-decoration-line': 'line-through' },
2150
+ '.no-underline': { 'text-decoration-line': 'none' },
1663
2151
  })
1664
2152
  },
1665
2153
 
@@ -1670,7 +2158,7 @@ export let corePlugins = {
1670
2158
  return { 'text-decoration-color': toColorValue(value) }
1671
2159
  },
1672
2160
  },
1673
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
2161
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1674
2162
  )
1675
2163
  },
1676
2164
 
@@ -1693,7 +2181,7 @@ export let corePlugins = {
1693
2181
  textUnderlineOffset: createUtilityPlugin(
1694
2182
  'textUnderlineOffset',
1695
2183
  [['underline-offset', ['text-underline-offset']]],
1696
- { type: ['length', 'percentage'] }
2184
+ { type: ['length', 'percentage', 'any'] }
1697
2185
  ),
1698
2186
 
1699
2187
  fontSmoothing: ({ addUtilities }) => {
@@ -1808,6 +2296,7 @@ export let corePlugins = {
1808
2296
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1809
2297
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1810
2298
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
2299
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1811
2300
  })
1812
2301
  },
1813
2302
 
@@ -1819,14 +2308,12 @@ export let corePlugins = {
1819
2308
  `var(--tw-shadow)`,
1820
2309
  ].join(', ')
1821
2310
 
1822
- return function ({ matchUtilities, addBase, theme }) {
1823
- addBase({
1824
- '@defaults box-shadow': {
1825
- '--tw-ring-offset-shadow': '0 0 #0000',
1826
- '--tw-ring-shadow': '0 0 #0000',
1827
- '--tw-shadow': '0 0 #0000',
1828
- '--tw-shadow-colored': '0 0 #0000',
1829
- },
2311
+ return function ({ matchUtilities, addDefaults, theme }) {
2312
+ addDefaults(' box-shadow', {
2313
+ '--tw-ring-offset-shadow': '0 0 #0000',
2314
+ '--tw-ring-shadow': '0 0 #0000',
2315
+ '--tw-shadow': '0 0 #0000',
2316
+ '--tw-shadow-colored': '0 0 #0000',
1830
2317
  })
1831
2318
 
1832
2319
  matchUtilities(
@@ -1867,7 +2354,7 @@ export let corePlugins = {
1867
2354
  }
1868
2355
  },
1869
2356
  },
1870
- { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
2357
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
1871
2358
  )
1872
2359
  },
1873
2360
 
@@ -1881,7 +2368,6 @@ export let corePlugins = {
1881
2368
  '.outline-dashed': { 'outline-style': 'dashed' },
1882
2369
  '.outline-dotted': { 'outline-style': 'dotted' },
1883
2370
  '.outline-double': { 'outline-style': 'double' },
1884
- '.outline-hidden': { 'outline-style': 'hidden' },
1885
2371
  })
1886
2372
  },
1887
2373
 
@@ -1890,7 +2376,8 @@ export let corePlugins = {
1890
2376
  }),
1891
2377
 
1892
2378
  outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1893
- type: ['length', 'number', 'percentage'],
2379
+ type: ['length', 'number', 'percentage', 'any'],
2380
+ supportsNegativeValues: true,
1894
2381
  }),
1895
2382
 
1896
2383
  outlineColor: ({ matchUtilities, theme }) => {
@@ -1900,29 +2387,38 @@ export let corePlugins = {
1900
2387
  return { 'outline-color': toColorValue(value) }
1901
2388
  },
1902
2389
  },
1903
- { values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
2390
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
1904
2391
  )
1905
2392
  },
1906
2393
 
1907
- ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1908
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1909
- let ringColorDefault = withAlphaValue(
1910
- theme('ringColor.DEFAULT'),
1911
- ringOpacityDefault,
1912
- `rgb(147 197 253 / ${ringOpacityDefault})`
1913
- )
2394
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
2395
+ let ringColorDefault = (() => {
2396
+ if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
2397
+ return theme('ringColor.DEFAULT')
2398
+ }
1914
2399
 
1915
- addBase({
1916
- '@defaults ring-width': {
1917
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1918
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1919
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1920
- '--tw-ring-color': ringColorDefault,
1921
- '--tw-ring-offset-shadow': '0 0 #0000',
1922
- '--tw-ring-shadow': '0 0 #0000',
1923
- '--tw-shadow': '0 0 #0000',
1924
- '--tw-shadow-colored': '0 0 #0000',
1925
- },
2400
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
2401
+
2402
+ if (!theme('ringColor')?.DEFAULT) {
2403
+ return `rgb(147 197 253 / ${ringOpacityDefault})`
2404
+ }
2405
+
2406
+ return withAlphaValue(
2407
+ theme('ringColor')?.DEFAULT,
2408
+ ringOpacityDefault,
2409
+ `rgb(147 197 253 / ${ringOpacityDefault})`
2410
+ )
2411
+ })()
2412
+
2413
+ addDefaults('ring-width', {
2414
+ '--tw-ring-inset': ' ',
2415
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
2416
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
2417
+ '--tw-ring-color': ringColorDefault,
2418
+ '--tw-ring-offset-shadow': '0 0 #0000',
2419
+ '--tw-ring-shadow': '0 0 #0000',
2420
+ '--tw-shadow': '0 0 #0000',
2421
+ '--tw-shadow-colored': '0 0 #0000',
1926
2422
  })
1927
2423
 
1928
2424
  matchUtilities(
@@ -1948,10 +2444,16 @@ export let corePlugins = {
1948
2444
  })
1949
2445
  },
1950
2446
 
1951
- ringColor: ({ matchUtilities, theme }) => {
2447
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1952
2448
  matchUtilities(
1953
2449
  {
1954
2450
  ring: (value) => {
2451
+ if (!corePlugins('ringOpacity')) {
2452
+ return {
2453
+ '--tw-ring-color': toColorValue(value),
2454
+ }
2455
+ }
2456
+
1955
2457
  return withAlphaVariable({
1956
2458
  color: value,
1957
2459
  property: '--tw-ring-color',
@@ -1965,14 +2467,18 @@ export let corePlugins = {
1965
2467
  ([modifier]) => modifier !== 'DEFAULT'
1966
2468
  )
1967
2469
  ),
1968
- type: 'color',
2470
+ type: ['color', 'any'],
1969
2471
  }
1970
2472
  )
1971
2473
  },
1972
2474
 
1973
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1974
- filterDefault: true,
1975
- }),
2475
+ ringOpacity: (helpers) => {
2476
+ let { config } = helpers
2477
+
2478
+ return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
2479
+ filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
2480
+ })(helpers)
2481
+ },
1976
2482
  ringOffsetWidth: createUtilityPlugin(
1977
2483
  'ringOffsetWidth',
1978
2484
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -1988,7 +2494,7 @@ export let corePlugins = {
1988
2494
  }
1989
2495
  },
1990
2496
  },
1991
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
2497
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
1992
2498
  )
1993
2499
  },
1994
2500
 
@@ -1999,7 +2505,7 @@ export let corePlugins = {
1999
2505
  return {
2000
2506
  '--tw-blur': `blur(${value})`,
2001
2507
  '@defaults filter': {},
2002
- filter: 'var(--tw-filter)',
2508
+ filter: cssFilterValue,
2003
2509
  }
2004
2510
  },
2005
2511
  },
@@ -2014,7 +2520,7 @@ export let corePlugins = {
2014
2520
  return {
2015
2521
  '--tw-brightness': `brightness(${value})`,
2016
2522
  '@defaults filter': {},
2017
- filter: 'var(--tw-filter)',
2523
+ filter: cssFilterValue,
2018
2524
  }
2019
2525
  },
2020
2526
  },
@@ -2029,7 +2535,7 @@ export let corePlugins = {
2029
2535
  return {
2030
2536
  '--tw-contrast': `contrast(${value})`,
2031
2537
  '@defaults filter': {},
2032
- filter: 'var(--tw-filter)',
2538
+ filter: cssFilterValue,
2033
2539
  }
2034
2540
  },
2035
2541
  },
@@ -2046,7 +2552,7 @@ export let corePlugins = {
2046
2552
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2047
2553
  : `drop-shadow(${value})`,
2048
2554
  '@defaults filter': {},
2049
- filter: 'var(--tw-filter)',
2555
+ filter: cssFilterValue,
2050
2556
  }
2051
2557
  },
2052
2558
  },
@@ -2061,7 +2567,7 @@ export let corePlugins = {
2061
2567
  return {
2062
2568
  '--tw-grayscale': `grayscale(${value})`,
2063
2569
  '@defaults filter': {},
2064
- filter: 'var(--tw-filter)',
2570
+ filter: cssFilterValue,
2065
2571
  }
2066
2572
  },
2067
2573
  },
@@ -2076,7 +2582,7 @@ export let corePlugins = {
2076
2582
  return {
2077
2583
  '--tw-hue-rotate': `hue-rotate(${value})`,
2078
2584
  '@defaults filter': {},
2079
- filter: 'var(--tw-filter)',
2585
+ filter: cssFilterValue,
2080
2586
  }
2081
2587
  },
2082
2588
  },
@@ -2091,7 +2597,7 @@ export let corePlugins = {
2091
2597
  return {
2092
2598
  '--tw-invert': `invert(${value})`,
2093
2599
  '@defaults filter': {},
2094
- filter: 'var(--tw-filter)',
2600
+ filter: cssFilterValue,
2095
2601
  }
2096
2602
  },
2097
2603
  },
@@ -2106,7 +2612,7 @@ export let corePlugins = {
2106
2612
  return {
2107
2613
  '--tw-saturate': `saturate(${value})`,
2108
2614
  '@defaults filter': {},
2109
- filter: 'var(--tw-filter)',
2615
+ filter: cssFilterValue,
2110
2616
  }
2111
2617
  },
2112
2618
  },
@@ -2121,7 +2627,7 @@ export let corePlugins = {
2121
2627
  return {
2122
2628
  '--tw-sepia': `sepia(${value})`,
2123
2629
  '@defaults filter': {},
2124
- filter: 'var(--tw-filter)',
2630
+ filter: cssFilterValue,
2125
2631
  }
2126
2632
  },
2127
2633
  },
@@ -2129,33 +2635,20 @@ export let corePlugins = {
2129
2635
  )
2130
2636
  },
2131
2637
 
2132
- filter: ({ addBase, addUtilities }) => {
2133
- addBase({
2134
- '@defaults filter': {
2135
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2136
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2137
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2138
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2139
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2140
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2141
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2142
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2143
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2144
- '--tw-filter': [
2145
- 'var(--tw-blur)',
2146
- 'var(--tw-brightness)',
2147
- 'var(--tw-contrast)',
2148
- 'var(--tw-grayscale)',
2149
- 'var(--tw-hue-rotate)',
2150
- 'var(--tw-invert)',
2151
- 'var(--tw-saturate)',
2152
- 'var(--tw-sepia)',
2153
- 'var(--tw-drop-shadow)',
2154
- ].join(' '),
2155
- },
2156
- })
2157
- addUtilities({
2158
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2638
+ filter: ({ addDefaults, addUtilities }) => {
2639
+ addDefaults('filter', {
2640
+ '--tw-blur': ' ',
2641
+ '--tw-brightness': ' ',
2642
+ '--tw-contrast': ' ',
2643
+ '--tw-grayscale': ' ',
2644
+ '--tw-hue-rotate': ' ',
2645
+ '--tw-invert': ' ',
2646
+ '--tw-saturate': ' ',
2647
+ '--tw-sepia': ' ',
2648
+ '--tw-drop-shadow': ' ',
2649
+ })
2650
+ addUtilities({
2651
+ '.filter': { '@defaults filter': {}, filter: cssFilterValue },
2159
2652
  '.filter-none': { filter: 'none' },
2160
2653
  })
2161
2654
  },
@@ -2167,7 +2660,7 @@ export let corePlugins = {
2167
2660
  return {
2168
2661
  '--tw-backdrop-blur': `blur(${value})`,
2169
2662
  '@defaults backdrop-filter': {},
2170
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2663
+ 'backdrop-filter': cssBackdropFilterValue,
2171
2664
  }
2172
2665
  },
2173
2666
  },
@@ -2182,7 +2675,7 @@ export let corePlugins = {
2182
2675
  return {
2183
2676
  '--tw-backdrop-brightness': `brightness(${value})`,
2184
2677
  '@defaults backdrop-filter': {},
2185
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2678
+ 'backdrop-filter': cssBackdropFilterValue,
2186
2679
  }
2187
2680
  },
2188
2681
  },
@@ -2197,7 +2690,7 @@ export let corePlugins = {
2197
2690
  return {
2198
2691
  '--tw-backdrop-contrast': `contrast(${value})`,
2199
2692
  '@defaults backdrop-filter': {},
2200
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2693
+ 'backdrop-filter': cssBackdropFilterValue,
2201
2694
  }
2202
2695
  },
2203
2696
  },
@@ -2212,7 +2705,7 @@ export let corePlugins = {
2212
2705
  return {
2213
2706
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2214
2707
  '@defaults backdrop-filter': {},
2215
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2708
+ 'backdrop-filter': cssBackdropFilterValue,
2216
2709
  }
2217
2710
  },
2218
2711
  },
@@ -2227,7 +2720,7 @@ export let corePlugins = {
2227
2720
  return {
2228
2721
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2229
2722
  '@defaults backdrop-filter': {},
2230
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2723
+ 'backdrop-filter': cssBackdropFilterValue,
2231
2724
  }
2232
2725
  },
2233
2726
  },
@@ -2242,7 +2735,7 @@ export let corePlugins = {
2242
2735
  return {
2243
2736
  '--tw-backdrop-invert': `invert(${value})`,
2244
2737
  '@defaults backdrop-filter': {},
2245
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2738
+ 'backdrop-filter': cssBackdropFilterValue,
2246
2739
  }
2247
2740
  },
2248
2741
  },
@@ -2257,7 +2750,7 @@ export let corePlugins = {
2257
2750
  return {
2258
2751
  '--tw-backdrop-opacity': `opacity(${value})`,
2259
2752
  '@defaults backdrop-filter': {},
2260
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2753
+ 'backdrop-filter': cssBackdropFilterValue,
2261
2754
  }
2262
2755
  },
2263
2756
  },
@@ -2272,7 +2765,7 @@ export let corePlugins = {
2272
2765
  return {
2273
2766
  '--tw-backdrop-saturate': `saturate(${value})`,
2274
2767
  '@defaults backdrop-filter': {},
2275
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2768
+ 'backdrop-filter': cssBackdropFilterValue,
2276
2769
  }
2277
2770
  },
2278
2771
  },
@@ -2287,7 +2780,7 @@ export let corePlugins = {
2287
2780
  return {
2288
2781
  '--tw-backdrop-sepia': `sepia(${value})`,
2289
2782
  '@defaults backdrop-filter': {},
2290
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2783
+ 'backdrop-filter': cssBackdropFilterValue,
2291
2784
  }
2292
2785
  },
2293
2786
  },
@@ -2295,35 +2788,22 @@ export let corePlugins = {
2295
2788
  )
2296
2789
  },
2297
2790
 
2298
- backdropFilter: ({ addBase, addUtilities }) => {
2299
- addBase({
2300
- '@defaults backdrop-filter': {
2301
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2302
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2303
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2304
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2305
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2306
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2307
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2308
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2309
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2310
- '--tw-backdrop-filter': [
2311
- 'var(--tw-backdrop-blur)',
2312
- 'var(--tw-backdrop-brightness)',
2313
- 'var(--tw-backdrop-contrast)',
2314
- 'var(--tw-backdrop-grayscale)',
2315
- 'var(--tw-backdrop-hue-rotate)',
2316
- 'var(--tw-backdrop-invert)',
2317
- 'var(--tw-backdrop-opacity)',
2318
- 'var(--tw-backdrop-saturate)',
2319
- 'var(--tw-backdrop-sepia)',
2320
- ].join(' '),
2321
- },
2791
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2792
+ addDefaults('backdrop-filter', {
2793
+ '--tw-backdrop-blur': ' ',
2794
+ '--tw-backdrop-brightness': ' ',
2795
+ '--tw-backdrop-contrast': ' ',
2796
+ '--tw-backdrop-grayscale': ' ',
2797
+ '--tw-backdrop-hue-rotate': ' ',
2798
+ '--tw-backdrop-invert': ' ',
2799
+ '--tw-backdrop-opacity': ' ',
2800
+ '--tw-backdrop-saturate': ' ',
2801
+ '--tw-backdrop-sepia': ' ',
2322
2802
  })
2323
2803
  addUtilities({
2324
2804
  '.backdrop-filter': {
2325
2805
  '@defaults backdrop-filter': {},
2326
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2806
+ 'backdrop-filter': cssBackdropFilterValue,
2327
2807
  },
2328
2808
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2329
2809
  })