tailwindcss 0.0.0-insiders.eebf529 → 0.0.0-insiders.ef2ebb2

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 (227) 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/index.css +5 -0
  7. package/lib/cli/build/index.js +57 -0
  8. package/lib/cli/build/plugin.js +433 -0
  9. package/lib/cli/build/utils.js +88 -0
  10. package/lib/cli/build/watching.js +182 -0
  11. package/lib/cli/help/index.js +73 -0
  12. package/lib/cli/index.js +231 -0
  13. package/lib/cli/init/index.js +63 -0
  14. package/lib/cli.js +1 -704
  15. package/lib/corePluginList.js +13 -3
  16. package/lib/corePlugins.js +2399 -1867
  17. package/lib/css/preflight.css +17 -9
  18. package/lib/featureFlags.js +50 -26
  19. package/lib/index.js +1 -31
  20. package/lib/lib/cacheInvalidation.js +92 -0
  21. package/lib/lib/collapseAdjacentRules.js +30 -10
  22. package/lib/lib/collapseDuplicateDeclarations.js +60 -4
  23. package/lib/lib/content.js +207 -0
  24. package/lib/lib/defaultExtractor.js +243 -0
  25. package/lib/lib/detectNesting.js +21 -10
  26. package/lib/lib/evaluateTailwindFunctions.js +117 -50
  27. package/lib/lib/expandApplyAtRules.js +467 -161
  28. package/lib/lib/expandTailwindAtRules.js +200 -133
  29. package/lib/lib/findAtConfigPath.js +46 -0
  30. package/lib/lib/generateRules.js +550 -200
  31. package/lib/lib/getModuleDependencies.js +88 -37
  32. package/lib/lib/handleImportAtRules.js +50 -0
  33. package/lib/lib/load-config.js +42 -0
  34. package/lib/lib/normalizeTailwindDirectives.js +36 -38
  35. package/lib/lib/offsets.js +306 -0
  36. package/lib/lib/partitionApplyAtRules.js +58 -0
  37. package/lib/lib/regex.js +74 -0
  38. package/lib/lib/remap-bitfield.js +89 -0
  39. package/lib/lib/resolveDefaultsAtRules.js +98 -58
  40. package/lib/lib/setupContextUtils.js +767 -325
  41. package/lib/lib/setupTrackingContext.js +71 -75
  42. package/lib/lib/sharedState.js +70 -10
  43. package/lib/lib/substituteScreenAtRules.js +14 -10
  44. package/lib/plugin.js +166 -0
  45. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  46. package/lib/postcss-plugins/nesting/index.js +21 -0
  47. package/lib/postcss-plugins/nesting/plugin.js +89 -0
  48. package/lib/processTailwindFeatures.js +39 -26
  49. package/lib/public/colors.js +272 -246
  50. package/lib/public/create-plugin.js +9 -5
  51. package/lib/public/default-config.js +10 -6
  52. package/lib/public/default-theme.js +10 -6
  53. package/lib/public/load-config.js +12 -0
  54. package/lib/public/resolve-config.js +11 -6
  55. package/lib/util/applyImportantSelector.js +36 -0
  56. package/lib/util/bigSign.js +6 -1
  57. package/lib/util/buildMediaQuery.js +13 -6
  58. package/lib/util/cloneDeep.js +9 -6
  59. package/lib/util/cloneNodes.js +23 -3
  60. package/lib/util/color.js +70 -38
  61. package/lib/util/colorNames.js +752 -0
  62. package/lib/util/configurePlugins.js +7 -2
  63. package/lib/util/createPlugin.js +8 -6
  64. package/lib/util/createUtilityPlugin.js +16 -16
  65. package/lib/util/dataTypes.js +182 -111
  66. package/lib/util/defaults.js +14 -3
  67. package/lib/util/escapeClassName.js +13 -8
  68. package/lib/util/escapeCommas.js +7 -2
  69. package/lib/util/flattenColorPalette.js +11 -12
  70. package/lib/util/formatVariantSelector.js +228 -151
  71. package/lib/util/getAllConfigs.js +33 -12
  72. package/lib/util/hashConfig.js +9 -4
  73. package/lib/util/isKeyframeRule.js +7 -2
  74. package/lib/util/isPlainObject.js +7 -2
  75. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
  76. package/lib/util/log.js +44 -13
  77. package/lib/util/nameClass.js +27 -10
  78. package/lib/util/negateValue.js +25 -8
  79. package/lib/util/normalizeConfig.js +167 -67
  80. package/lib/util/normalizeScreens.js +128 -11
  81. package/lib/util/parseAnimationValue.js +44 -40
  82. package/lib/util/parseBoxShadowValue.js +34 -23
  83. package/lib/util/parseDependency.js +39 -55
  84. package/lib/util/parseGlob.js +36 -0
  85. package/lib/util/parseObjectStyles.js +15 -10
  86. package/lib/util/pluginUtils.js +157 -69
  87. package/lib/util/prefixSelector.js +30 -12
  88. package/lib/util/pseudoElements.js +209 -0
  89. package/lib/util/removeAlphaVariables.js +31 -0
  90. package/lib/util/resolveConfig.js +101 -79
  91. package/lib/util/resolveConfigPath.js +30 -12
  92. package/lib/util/responsive.js +11 -6
  93. package/lib/util/splitAtTopLevelOnly.js +51 -0
  94. package/lib/util/tap.js +6 -1
  95. package/lib/util/toColorValue.js +7 -3
  96. package/lib/util/toPath.js +26 -3
  97. package/lib/util/transformThemeValue.js +40 -30
  98. package/lib/util/validateConfig.js +48 -0
  99. package/lib/util/validateFormalSyntax.js +26 -0
  100. package/lib/util/withAlphaVariable.js +27 -15
  101. package/lib/value-parser/LICENSE +22 -0
  102. package/lib/value-parser/README.md +3 -0
  103. package/lib/value-parser/index.d.js +2 -0
  104. package/lib/value-parser/index.js +22 -0
  105. package/lib/value-parser/parse.js +259 -0
  106. package/lib/value-parser/stringify.js +38 -0
  107. package/lib/value-parser/unit.js +86 -0
  108. package/lib/value-parser/walk.js +16 -0
  109. package/loadConfig.d.ts +4 -0
  110. package/loadConfig.js +2 -0
  111. package/nesting/index.js +2 -12
  112. package/package.json +63 -62
  113. package/plugin.d.ts +11 -0
  114. package/resolveConfig.d.ts +12 -0
  115. package/scripts/generate-types.js +105 -0
  116. package/scripts/release-channel.js +18 -0
  117. package/scripts/release-notes.js +21 -0
  118. package/scripts/type-utils.js +27 -0
  119. package/src/cli/build/index.js +53 -0
  120. package/src/cli/build/plugin.js +476 -0
  121. package/src/cli/build/utils.js +76 -0
  122. package/src/cli/build/watching.js +229 -0
  123. package/src/cli/help/index.js +70 -0
  124. package/src/cli/index.js +217 -0
  125. package/src/cli/init/index.js +79 -0
  126. package/src/cli.js +1 -766
  127. package/src/corePluginList.js +1 -1
  128. package/src/corePlugins.js +800 -296
  129. package/src/css/preflight.css +17 -9
  130. package/src/featureFlags.js +20 -6
  131. package/src/index.js +1 -34
  132. package/src/lib/cacheInvalidation.js +52 -0
  133. package/src/lib/collapseAdjacentRules.js +21 -2
  134. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  135. package/src/lib/content.js +240 -0
  136. package/src/lib/defaultExtractor.js +217 -0
  137. package/src/lib/detectNesting.js +9 -1
  138. package/src/lib/evaluateTailwindFunctions.js +83 -9
  139. package/src/lib/expandApplyAtRules.js +515 -153
  140. package/src/lib/expandTailwindAtRules.js +147 -86
  141. package/src/lib/findAtConfigPath.js +48 -0
  142. package/src/lib/generateRules.js +541 -147
  143. package/src/lib/getModuleDependencies.js +70 -30
  144. package/src/lib/handleImportAtRules.js +34 -0
  145. package/src/lib/load-config.ts +31 -0
  146. package/src/lib/normalizeTailwindDirectives.js +5 -26
  147. package/src/lib/offsets.js +373 -0
  148. package/src/lib/partitionApplyAtRules.js +52 -0
  149. package/src/lib/regex.js +74 -0
  150. package/src/lib/remap-bitfield.js +82 -0
  151. package/src/lib/resolveDefaultsAtRules.js +59 -17
  152. package/src/lib/setupContextUtils.js +693 -176
  153. package/src/lib/setupTrackingContext.js +52 -65
  154. package/src/lib/sharedState.js +54 -7
  155. package/src/plugin.js +141 -0
  156. package/src/postcss-plugins/nesting/README.md +42 -0
  157. package/src/postcss-plugins/nesting/index.js +13 -0
  158. package/src/postcss-plugins/nesting/plugin.js +80 -0
  159. package/src/processTailwindFeatures.js +12 -2
  160. package/src/public/colors.js +22 -0
  161. package/src/public/default-config.js +1 -1
  162. package/src/public/default-theme.js +2 -2
  163. package/src/public/load-config.js +2 -0
  164. package/src/util/applyImportantSelector.js +27 -0
  165. package/src/util/buildMediaQuery.js +5 -3
  166. package/src/util/cloneNodes.js +19 -2
  167. package/src/util/color.js +44 -12
  168. package/src/util/colorNames.js +150 -0
  169. package/src/util/dataTypes.js +67 -23
  170. package/src/util/defaults.js +6 -0
  171. package/src/util/formatVariantSelector.js +264 -144
  172. package/src/util/getAllConfigs.js +21 -2
  173. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  174. package/src/util/log.js +35 -7
  175. package/src/util/nameClass.js +4 -0
  176. package/src/util/negateValue.js +11 -3
  177. package/src/util/normalizeConfig.js +86 -7
  178. package/src/util/normalizeScreens.js +99 -4
  179. package/src/util/parseBoxShadowValue.js +4 -3
  180. package/src/util/parseDependency.js +37 -42
  181. package/src/util/parseGlob.js +24 -0
  182. package/src/util/pluginUtils.js +118 -23
  183. package/src/util/prefixSelector.js +30 -10
  184. package/src/util/pseudoElements.js +167 -0
  185. package/src/util/removeAlphaVariables.js +24 -0
  186. package/src/util/resolveConfig.js +74 -26
  187. package/src/util/resolveConfigPath.js +12 -1
  188. package/src/util/splitAtTopLevelOnly.js +52 -0
  189. package/src/util/toPath.js +23 -1
  190. package/src/util/transformThemeValue.js +13 -3
  191. package/src/util/validateConfig.js +36 -0
  192. package/src/util/validateFormalSyntax.js +34 -0
  193. package/src/util/withAlphaVariable.js +1 -1
  194. package/src/value-parser/LICENSE +22 -0
  195. package/src/value-parser/README.md +3 -0
  196. package/src/value-parser/index.d.ts +177 -0
  197. package/src/value-parser/index.js +28 -0
  198. package/src/value-parser/parse.js +303 -0
  199. package/src/value-parser/stringify.js +41 -0
  200. package/src/value-parser/unit.js +118 -0
  201. package/src/value-parser/walk.js +18 -0
  202. package/stubs/.gitignore +1 -0
  203. package/stubs/.prettierrc.json +6 -0
  204. package/stubs/{defaultConfig.stub.js → config.full.js} +220 -167
  205. package/stubs/{simpleConfig.stub.js → config.simple.js} +1 -1
  206. package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -1
  207. package/stubs/postcss.config.js +5 -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 +369 -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 +372 -0
  216. package/types/index.d.ts +7 -0
  217. package/CHANGELOG.md +0 -1853
  218. package/lib/cli-peer-dependencies.js +0 -15
  219. package/lib/constants.js +0 -37
  220. package/lib/lib/setupWatchingContext.js +0 -288
  221. package/nesting/plugin.js +0 -41
  222. package/peers/index.js +0 -76107
  223. package/scripts/install-integrations.js +0 -27
  224. package/scripts/rebuildFixtures.js +0 -68
  225. package/src/cli-peer-dependencies.js +0 -9
  226. package/src/constants.js +0 -17
  227. package/src/lib/setupWatchingContext.js +0 -311
@@ -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,266 @@ 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([])
164
240
 
165
- addVariant(screen.name, `@media ${query}`)
241
+ /** @param {string} value */
242
+ function units(value) {
243
+ return value.match(/(\D+)$/)?.[1] ?? '(none)'
166
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
+ }
300
+
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)
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
+ hasVariants: ({ matchVariant }) => {
390
+ matchVariant('has', (value) => `&:has(${normalize(value)})`, { values: {} })
391
+ matchVariant(
392
+ 'group-has',
393
+ (value, { modifier }) =>
394
+ modifier
395
+ ? `:merge(.group\\/${modifier}):has(${normalize(value)}) &`
396
+ : `:merge(.group):has(${normalize(value)}) &`,
397
+ { values: {} }
398
+ )
399
+ matchVariant(
400
+ 'peer-has',
401
+ (value, { modifier }) =>
402
+ modifier
403
+ ? `:merge(.peer\\/${modifier}):has(${normalize(value)}) ~ &`
404
+ : `:merge(.peer):has(${normalize(value)}) ~ &`,
405
+ { values: {} }
406
+ )
407
+ },
408
+
409
+ ariaVariants: ({ matchVariant, theme }) => {
410
+ matchVariant('aria', (value) => `&[aria-${normalize(value)}]`, { values: theme('aria') ?? {} })
411
+ matchVariant(
412
+ 'group-aria',
413
+ (value, { modifier }) =>
414
+ modifier
415
+ ? `:merge(.group\\/${modifier})[aria-${normalize(value)}] &`
416
+ : `:merge(.group)[aria-${normalize(value)}] &`,
417
+ { values: theme('aria') ?? {} }
418
+ )
419
+ matchVariant(
420
+ 'peer-aria',
421
+ (value, { modifier }) =>
422
+ modifier
423
+ ? `:merge(.peer\\/${modifier})[aria-${normalize(value)}] ~ &`
424
+ : `:merge(.peer)[aria-${normalize(value)}] ~ &`,
425
+ { values: theme('aria') ?? {} }
426
+ )
427
+ },
428
+
429
+ dataVariants: ({ matchVariant, theme }) => {
430
+ matchVariant('data', (value) => `&[data-${normalize(value)}]`, { values: theme('data') ?? {} })
431
+ matchVariant(
432
+ 'group-data',
433
+ (value, { modifier }) =>
434
+ modifier
435
+ ? `:merge(.group\\/${modifier})[data-${normalize(value)}] &`
436
+ : `:merge(.group)[data-${normalize(value)}] &`,
437
+ { values: theme('data') ?? {} }
438
+ )
439
+ matchVariant(
440
+ 'peer-data',
441
+ (value, { modifier }) =>
442
+ modifier
443
+ ? `:merge(.peer\\/${modifier})[data-${normalize(value)}] ~ &`
444
+ : `:merge(.peer)[data-${normalize(value)}] ~ &`,
445
+ { values: theme('data') ?? {} }
446
+ )
167
447
  },
168
448
 
169
449
  orientationVariants: ({ addVariant }) => {
170
450
  addVariant('portrait', '@media (orientation: portrait)')
171
451
  addVariant('landscape', '@media (orientation: landscape)')
172
452
  },
453
+
454
+ prefersContrastVariants: ({ addVariant }) => {
455
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
456
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
457
+ },
173
458
  }
174
459
 
460
+ let cssTransformValue = [
461
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
462
+ 'rotate(var(--tw-rotate))',
463
+ 'skewX(var(--tw-skew-x))',
464
+ 'skewY(var(--tw-skew-y))',
465
+ 'scaleX(var(--tw-scale-x))',
466
+ 'scaleY(var(--tw-scale-y))',
467
+ ].join(' ')
468
+
469
+ let cssFilterValue = [
470
+ 'var(--tw-blur)',
471
+ 'var(--tw-brightness)',
472
+ 'var(--tw-contrast)',
473
+ 'var(--tw-grayscale)',
474
+ 'var(--tw-hue-rotate)',
475
+ 'var(--tw-invert)',
476
+ 'var(--tw-saturate)',
477
+ 'var(--tw-sepia)',
478
+ 'var(--tw-drop-shadow)',
479
+ ].join(' ')
480
+
481
+ let cssBackdropFilterValue = [
482
+ 'var(--tw-backdrop-blur)',
483
+ 'var(--tw-backdrop-brightness)',
484
+ 'var(--tw-backdrop-contrast)',
485
+ 'var(--tw-backdrop-grayscale)',
486
+ 'var(--tw-backdrop-hue-rotate)',
487
+ 'var(--tw-backdrop-invert)',
488
+ 'var(--tw-backdrop-opacity)',
489
+ 'var(--tw-backdrop-saturate)',
490
+ 'var(--tw-backdrop-sepia)',
491
+ ].join(' ')
492
+
175
493
  export let corePlugins = {
176
494
  preflight: ({ addBase }) => {
177
495
  let preflightStyles = postcss.parse(
@@ -310,6 +628,7 @@ export let corePlugins = {
310
628
  addUtilities({
311
629
  '.visible': { visibility: 'visible' },
312
630
  '.invisible': { visibility: 'hidden' },
631
+ '.collapse': { visibility: 'collapse' },
313
632
  })
314
633
  },
315
634
 
@@ -326,12 +645,14 @@ export let corePlugins = {
326
645
  inset: createUtilityPlugin(
327
646
  'inset',
328
647
  [
329
- ['inset', ['top', 'right', 'bottom', 'left']],
648
+ ['inset', ['inset']],
330
649
  [
331
650
  ['inset-x', ['left', 'right']],
332
651
  ['inset-y', ['top', 'bottom']],
333
652
  ],
334
653
  [
654
+ ['start', ['inset-inline-start']],
655
+ ['end', ['inset-inline-end']],
335
656
  ['top', ['top']],
336
657
  ['right', ['right']],
337
658
  ['bottom', ['bottom']],
@@ -383,6 +704,8 @@ export let corePlugins = {
383
704
  ['my', ['margin-top', 'margin-bottom']],
384
705
  ],
385
706
  [
707
+ ['ms', ['margin-inline-start']],
708
+ ['me', ['margin-inline-end']],
386
709
  ['mt', ['margin-top']],
387
710
  ['mr', ['margin-right']],
388
711
  ['mb', ['margin-bottom']],
@@ -399,6 +722,29 @@ export let corePlugins = {
399
722
  })
400
723
  },
401
724
 
725
+ lineClamp: ({ matchUtilities, addUtilities, theme }) => {
726
+ matchUtilities(
727
+ {
728
+ 'line-clamp': (value) => ({
729
+ overflow: 'hidden',
730
+ display: '-webkit-box',
731
+ '-webkit-box-orient': 'vertical',
732
+ '-webkit-line-clamp': `${value}`,
733
+ }),
734
+ },
735
+ { values: theme('lineClamp') }
736
+ )
737
+
738
+ addUtilities({
739
+ '.line-clamp-none': {
740
+ overflow: 'visible',
741
+ display: 'block',
742
+ '-webkit-box-orient': 'horizontal',
743
+ '-webkit-line-clamp': 'none',
744
+ },
745
+ })
746
+ },
747
+
402
748
  display: ({ addUtilities }) => {
403
749
  addUtilities({
404
750
  '.block': { display: 'block' },
@@ -453,6 +799,13 @@ export let corePlugins = {
453
799
  })
454
800
  },
455
801
 
802
+ captionSide: ({ addUtilities }) => {
803
+ addUtilities({
804
+ '.caption-top': { 'caption-side': 'top' },
805
+ '.caption-bottom': { 'caption-side': 'bottom' },
806
+ })
807
+ },
808
+
456
809
  borderCollapse: ({ addUtilities }) => {
457
810
  addUtilities({
458
811
  '.border-collapse': { 'border-collapse': 'collapse' },
@@ -460,6 +813,41 @@ export let corePlugins = {
460
813
  })
461
814
  },
462
815
 
816
+ borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
817
+ addDefaults('border-spacing', {
818
+ '--tw-border-spacing-x': 0,
819
+ '--tw-border-spacing-y': 0,
820
+ })
821
+
822
+ matchUtilities(
823
+ {
824
+ 'border-spacing': (value) => {
825
+ return {
826
+ '--tw-border-spacing-x': value,
827
+ '--tw-border-spacing-y': value,
828
+ '@defaults border-spacing': {},
829
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
830
+ }
831
+ },
832
+ 'border-spacing-x': (value) => {
833
+ return {
834
+ '--tw-border-spacing-x': value,
835
+ '@defaults border-spacing': {},
836
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
837
+ }
838
+ },
839
+ 'border-spacing-y': (value) => {
840
+ return {
841
+ '--tw-border-spacing-y': value,
842
+ '@defaults border-spacing': {},
843
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
844
+ }
845
+ },
846
+ },
847
+ { values: theme('borderSpacing') }
848
+ )
849
+ },
850
+
463
851
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
464
852
  translate: createUtilityPlugin(
465
853
  'translate',
@@ -467,11 +855,11 @@ export let corePlugins = {
467
855
  [
468
856
  [
469
857
  'translate-x',
470
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
858
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
471
859
  ],
472
860
  [
473
861
  'translate-y',
474
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
862
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
475
863
  ],
476
864
  ],
477
865
  ],
@@ -479,26 +867,15 @@ export let corePlugins = {
479
867
  ),
480
868
  rotate: createUtilityPlugin(
481
869
  'rotate',
482
- [
483
- [
484
- 'rotate',
485
- [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
486
- ],
487
- ],
870
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
488
871
  { supportsNegativeValues: true }
489
872
  ),
490
873
  skew: createUtilityPlugin(
491
874
  'skew',
492
875
  [
493
876
  [
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
- ],
877
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
878
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
502
879
  ],
503
880
  ],
504
881
  { supportsNegativeValues: true }
@@ -512,73 +889,51 @@ export let corePlugins = {
512
889
  ['@defaults transform', {}],
513
890
  '--tw-scale-x',
514
891
  '--tw-scale-y',
515
- ['transform', 'var(--tw-transform)'],
892
+ ['transform', cssTransformValue],
516
893
  ],
517
894
  ],
518
895
  [
519
896
  [
520
897
  'scale-x',
521
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
898
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
522
899
  ],
523
900
  [
524
901
  'scale-y',
525
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
902
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
526
903
  ],
527
904
  ],
528
905
  ],
529
906
  { supportsNegativeValues: true }
530
907
  ),
531
908
 
532
- transform: ({ addBase, addUtilities }) => {
533
- addBase({
534
- '@defaults transform': {
535
- '--tw-translate-x': '0',
536
- '--tw-translate-y': '0',
537
- '--tw-rotate': '0',
538
- '--tw-skew-x': '0',
539
- '--tw-skew-y': '0',
540
- '--tw-scale-x': '1',
541
- '--tw-scale-y': '1',
542
- '--tw-transform': [
543
- 'translateX(var(--tw-translate-x))',
544
- 'translateY(var(--tw-translate-y))',
545
- 'rotate(var(--tw-rotate))',
546
- 'skewX(var(--tw-skew-x))',
547
- 'skewY(var(--tw-skew-y))',
548
- 'scaleX(var(--tw-scale-x))',
549
- 'scaleY(var(--tw-scale-y))',
550
- ].join(' '),
551
- },
552
- })
553
- addUtilities({
554
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
909
+ transform: ({ addDefaults, addUtilities }) => {
910
+ addDefaults('transform', {
911
+ '--tw-translate-x': '0',
912
+ '--tw-translate-y': '0',
913
+ '--tw-rotate': '0',
914
+ '--tw-skew-x': '0',
915
+ '--tw-skew-y': '0',
916
+ '--tw-scale-x': '1',
917
+ '--tw-scale-y': '1',
918
+ })
919
+
920
+ addUtilities({
921
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
555
922
  '.transform-cpu': {
556
- '--tw-transform': [
557
- 'translateX(var(--tw-translate-x))',
558
- 'translateY(var(--tw-translate-y))',
559
- 'rotate(var(--tw-rotate))',
560
- 'skewX(var(--tw-skew-x))',
561
- 'skewY(var(--tw-skew-y))',
562
- 'scaleX(var(--tw-scale-x))',
563
- 'scaleY(var(--tw-scale-y))',
564
- ].join(' '),
923
+ transform: cssTransformValue,
565
924
  },
566
925
  '.transform-gpu': {
567
- '--tw-transform': [
568
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
569
- 'rotate(var(--tw-rotate))',
570
- 'skewX(var(--tw-skew-x))',
571
- 'skewY(var(--tw-skew-y))',
572
- 'scaleX(var(--tw-scale-x))',
573
- 'scaleY(var(--tw-scale-y))',
574
- ].join(' '),
926
+ transform: cssTransformValue.replace(
927
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
928
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
929
+ ),
575
930
  },
576
931
  '.transform-none': { transform: 'none' },
577
932
  })
578
933
  },
579
934
 
580
- animation: ({ matchUtilities, theme, prefix }) => {
581
- let prefixName = (name) => prefix(`.${name}`).slice(1)
935
+ animation: ({ matchUtilities, theme, config }) => {
936
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
582
937
  let keyframes = Object.fromEntries(
583
938
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
584
939
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -611,53 +966,52 @@ export let corePlugins = {
611
966
 
612
967
  cursor: createUtilityPlugin('cursor'),
613
968
 
614
- touchAction: ({ addBase, addUtilities }) => {
615
- addBase({
616
- '@defaults touch-action': {
617
- '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
618
- '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
619
- '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
620
- '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
621
- },
969
+ touchAction: ({ addDefaults, addUtilities }) => {
970
+ addDefaults('touch-action', {
971
+ '--tw-pan-x': ' ',
972
+ '--tw-pan-y': ' ',
973
+ '--tw-pinch-zoom': ' ',
622
974
  })
623
975
 
976
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
977
+
624
978
  addUtilities({
625
979
  '.touch-auto': { 'touch-action': 'auto' },
626
980
  '.touch-none': { 'touch-action': 'none' },
627
981
  '.touch-pan-x': {
628
982
  '@defaults touch-action': {},
629
983
  '--tw-pan-x': 'pan-x',
630
- 'touch-action': 'var(--tw-touch-action)',
984
+ 'touch-action': cssTouchActionValue,
631
985
  },
632
986
  '.touch-pan-left': {
633
987
  '@defaults touch-action': {},
634
988
  '--tw-pan-x': 'pan-left',
635
- 'touch-action': 'var(--tw-touch-action)',
989
+ 'touch-action': cssTouchActionValue,
636
990
  },
637
991
  '.touch-pan-right': {
638
992
  '@defaults touch-action': {},
639
993
  '--tw-pan-x': 'pan-right',
640
- 'touch-action': 'var(--tw-touch-action)',
994
+ 'touch-action': cssTouchActionValue,
641
995
  },
642
996
  '.touch-pan-y': {
643
997
  '@defaults touch-action': {},
644
998
  '--tw-pan-y': 'pan-y',
645
- 'touch-action': 'var(--tw-touch-action)',
999
+ 'touch-action': cssTouchActionValue,
646
1000
  },
647
1001
  '.touch-pan-up': {
648
1002
  '@defaults touch-action': {},
649
1003
  '--tw-pan-y': 'pan-up',
650
- 'touch-action': 'var(--tw-touch-action)',
1004
+ 'touch-action': cssTouchActionValue,
651
1005
  },
652
1006
  '.touch-pan-down': {
653
1007
  '@defaults touch-action': {},
654
1008
  '--tw-pan-y': 'pan-down',
655
- 'touch-action': 'var(--tw-touch-action)',
1009
+ 'touch-action': cssTouchActionValue,
656
1010
  },
657
1011
  '.touch-pinch-zoom': {
658
1012
  '@defaults touch-action': {},
659
1013
  '--tw-pinch-zoom': 'pinch-zoom',
660
- 'touch-action': 'var(--tw-touch-action)',
1014
+ 'touch-action': cssTouchActionValue,
661
1015
  },
662
1016
  '.touch-manipulation': { 'touch-action': 'manipulation' },
663
1017
  })
@@ -681,11 +1035,9 @@ export let corePlugins = {
681
1035
  })
682
1036
  },
683
1037
 
684
- scrollSnapType: ({ addUtilities, addBase }) => {
685
- addBase({
686
- '@defaults scroll-snap-type': {
687
- '--tw-scroll-snap-strictness': 'proximity',
688
- },
1038
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
1039
+ addDefaults('scroll-snap-type', {
1040
+ '--tw-scroll-snap-strictness': 'proximity',
689
1041
  })
690
1042
 
691
1043
  addUtilities({
@@ -732,6 +1084,8 @@ export let corePlugins = {
732
1084
  ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
733
1085
  ],
734
1086
  [
1087
+ ['scroll-ms', ['scroll-margin-inline-start']],
1088
+ ['scroll-me', ['scroll-margin-inline-end']],
735
1089
  ['scroll-mt', ['scroll-margin-top']],
736
1090
  ['scroll-mr', ['scroll-margin-right']],
737
1091
  ['scroll-mb', ['scroll-margin-bottom']],
@@ -748,6 +1102,8 @@ export let corePlugins = {
748
1102
  ['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
749
1103
  ],
750
1104
  [
1105
+ ['scroll-ps', ['scroll-padding-inline-start']],
1106
+ ['scroll-pe', ['scroll-padding-inline-end']],
751
1107
  ['scroll-pt', ['scroll-padding-top']],
752
1108
  ['scroll-pr', ['scroll-padding-right']],
753
1109
  ['scroll-pb', ['scroll-padding-bottom']],
@@ -761,8 +1117,8 @@ export let corePlugins = {
761
1117
  '.list-outside': { 'list-style-position': 'outside' },
762
1118
  })
763
1119
  },
764
-
765
1120
  listStyleType: createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]),
1121
+ listStyleImage: createUtilityPlugin('listStyleImage', [['list-image', ['listStyleImage']]]),
766
1122
 
767
1123
  appearance: ({ addUtilities }) => {
768
1124
  addUtilities({
@@ -813,6 +1169,7 @@ export let corePlugins = {
813
1169
  addUtilities({
814
1170
  '.grid-flow-row': { gridAutoFlow: 'row' },
815
1171
  '.grid-flow-col': { gridAutoFlow: 'column' },
1172
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
816
1173
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
817
1174
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
818
1175
  })
@@ -849,6 +1206,7 @@ export let corePlugins = {
849
1206
  '.place-content-between': { 'place-content': 'space-between' },
850
1207
  '.place-content-around': { 'place-content': 'space-around' },
851
1208
  '.place-content-evenly': { 'place-content': 'space-evenly' },
1209
+ '.place-content-baseline': { 'place-content': 'baseline' },
852
1210
  '.place-content-stretch': { 'place-content': 'stretch' },
853
1211
  })
854
1212
  },
@@ -858,18 +1216,22 @@ export let corePlugins = {
858
1216
  '.place-items-start': { 'place-items': 'start' },
859
1217
  '.place-items-end': { 'place-items': 'end' },
860
1218
  '.place-items-center': { 'place-items': 'center' },
1219
+ '.place-items-baseline': { 'place-items': 'baseline' },
861
1220
  '.place-items-stretch': { 'place-items': 'stretch' },
862
1221
  })
863
1222
  },
864
1223
 
865
1224
  alignContent: ({ addUtilities }) => {
866
1225
  addUtilities({
1226
+ '.content-normal': { 'align-content': 'normal' },
867
1227
  '.content-center': { 'align-content': 'center' },
868
1228
  '.content-start': { 'align-content': 'flex-start' },
869
1229
  '.content-end': { 'align-content': 'flex-end' },
870
1230
  '.content-between': { 'align-content': 'space-between' },
871
1231
  '.content-around': { 'align-content': 'space-around' },
872
1232
  '.content-evenly': { 'align-content': 'space-evenly' },
1233
+ '.content-baseline': { 'align-content': 'baseline' },
1234
+ '.content-stretch': { 'align-content': 'stretch' },
873
1235
  })
874
1236
  },
875
1237
 
@@ -885,12 +1247,14 @@ export let corePlugins = {
885
1247
 
886
1248
  justifyContent: ({ addUtilities }) => {
887
1249
  addUtilities({
1250
+ '.justify-normal': { 'justify-content': 'normal' },
888
1251
  '.justify-start': { 'justify-content': 'flex-start' },
889
1252
  '.justify-end': { 'justify-content': 'flex-end' },
890
1253
  '.justify-center': { 'justify-content': 'center' },
891
1254
  '.justify-between': { 'justify-content': 'space-between' },
892
1255
  '.justify-around': { 'justify-content': 'space-around' },
893
1256
  '.justify-evenly': { 'justify-content': 'space-evenly' },
1257
+ '.justify-stretch': { 'justify-content': 'stretch' },
894
1258
  })
895
1259
  },
896
1260
 
@@ -911,12 +1275,22 @@ export let corePlugins = {
911
1275
  ],
912
1276
  ]),
913
1277
 
914
- space: ({ matchUtilities, addUtilities, theme }) => {
1278
+ space: ({ matchUtilities, addUtilities, theme, config }) => {
915
1279
  matchUtilities(
916
1280
  {
917
1281
  'space-x': (value) => {
918
1282
  value = value === '0' ? '0px' : value
919
1283
 
1284
+ if (flagEnabled(config(), 'logicalSiblingUtilities')) {
1285
+ return {
1286
+ '& > :not([hidden]) ~ :not([hidden])': {
1287
+ '--tw-space-x-reverse': '0',
1288
+ 'margin-inline-end': `calc(${value} * var(--tw-space-x-reverse))`,
1289
+ 'margin-inline-start': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`,
1290
+ },
1291
+ }
1292
+ }
1293
+
920
1294
  return {
921
1295
  '& > :not([hidden]) ~ :not([hidden])': {
922
1296
  '--tw-space-x-reverse': '0',
@@ -946,12 +1320,23 @@ export let corePlugins = {
946
1320
  })
947
1321
  },
948
1322
 
949
- divideWidth: ({ matchUtilities, addUtilities, theme }) => {
1323
+ divideWidth: ({ matchUtilities, addUtilities, theme, config }) => {
950
1324
  matchUtilities(
951
1325
  {
952
1326
  'divide-x': (value) => {
953
1327
  value = value === '0' ? '0px' : value
954
1328
 
1329
+ if (flagEnabled(config(), 'logicalSiblingUtilities')) {
1330
+ return {
1331
+ '& > :not([hidden]) ~ :not([hidden])': {
1332
+ '@defaults border-width': {},
1333
+ '--tw-divide-x-reverse': '0',
1334
+ 'border-inline-end-width': `calc(${value} * var(--tw-divide-x-reverse))`,
1335
+ 'border-inline-start-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`,
1336
+ },
1337
+ }
1338
+ }
1339
+
955
1340
  return {
956
1341
  '& > :not([hidden]) ~ :not([hidden])': {
957
1342
  '@defaults border-width': {},
@@ -974,7 +1359,7 @@ export let corePlugins = {
974
1359
  }
975
1360
  },
976
1361
  },
977
- { values: theme('divideWidth'), type: ['line-width', 'length'] }
1362
+ { values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
978
1363
  )
979
1364
 
980
1365
  addUtilities({
@@ -1022,7 +1407,7 @@ export let corePlugins = {
1022
1407
  },
1023
1408
  {
1024
1409
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
1025
- type: 'color',
1410
+ type: ['color', 'any'],
1026
1411
  }
1027
1412
  )
1028
1413
  },
@@ -1119,6 +1504,14 @@ export let corePlugins = {
1119
1504
  })
1120
1505
  },
1121
1506
 
1507
+ hyphens: ({ addUtilities }) => {
1508
+ addUtilities({
1509
+ '.hyphens-none': { hyphens: 'none' },
1510
+ '.hyphens-manual': { hyphens: 'manual' },
1511
+ '.hyphens-auto': { hyphens: 'auto' },
1512
+ })
1513
+ },
1514
+
1122
1515
  whitespace: ({ addUtilities }) => {
1123
1516
  addUtilities({
1124
1517
  '.whitespace-normal': { 'white-space': 'normal' },
@@ -1126,6 +1519,15 @@ export let corePlugins = {
1126
1519
  '.whitespace-pre': { 'white-space': 'pre' },
1127
1520
  '.whitespace-pre-line': { 'white-space': 'pre-line' },
1128
1521
  '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
1522
+ '.whitespace-break-spaces': { 'white-space': 'break-spaces' },
1523
+ })
1524
+ },
1525
+
1526
+ textWrap: ({ addUtilities }) => {
1527
+ addUtilities({
1528
+ '.text-wrap': { 'text-wrap': 'wrap' },
1529
+ '.text-nowrap': { 'text-wrap': 'nowrap' },
1530
+ '.text-balance': { 'text-wrap': 'balance' },
1129
1531
  })
1130
1532
  },
1131
1533
 
@@ -1134,18 +1536,25 @@ export let corePlugins = {
1134
1536
  '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
1135
1537
  '.break-words': { 'overflow-wrap': 'break-word' },
1136
1538
  '.break-all': { 'word-break': 'break-all' },
1539
+ '.break-keep': { 'word-break': 'keep-all' },
1137
1540
  })
1138
1541
  },
1139
1542
 
1140
1543
  borderRadius: createUtilityPlugin('borderRadius', [
1141
1544
  ['rounded', ['border-radius']],
1142
1545
  [
1546
+ ['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
1547
+ ['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
1143
1548
  ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
1144
1549
  ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
1145
1550
  ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
1146
1551
  ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
1147
1552
  ],
1148
1553
  [
1554
+ ['rounded-ss', ['border-start-start-radius']],
1555
+ ['rounded-se', ['border-start-end-radius']],
1556
+ ['rounded-ee', ['border-end-end-radius']],
1557
+ ['rounded-es', ['border-end-start-radius']],
1149
1558
  ['rounded-tl', ['border-top-left-radius']],
1150
1559
  ['rounded-tr', ['border-top-right-radius']],
1151
1560
  ['rounded-br', ['border-bottom-right-radius']],
@@ -1162,6 +1571,8 @@ export let corePlugins = {
1162
1571
  ['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
1163
1572
  ],
1164
1573
  [
1574
+ ['border-s', [['@defaults border-width', {}], 'border-inline-start-width']],
1575
+ ['border-e', [['@defaults border-width', {}], 'border-inline-end-width']],
1165
1576
  ['border-t', [['@defaults border-width', {}], 'border-top-width']],
1166
1577
  ['border-r', [['@defaults border-width', {}], 'border-right-width']],
1167
1578
  ['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
@@ -1182,24 +1593,7 @@ export let corePlugins = {
1182
1593
  })
1183
1594
  },
1184
1595
 
1185
- borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1186
- if (!corePlugins('borderOpacity')) {
1187
- let value = theme('borderColor.DEFAULT', 'currentColor')
1188
- addBase({
1189
- '@defaults border-width': {
1190
- 'border-color': toColorValue(value),
1191
- },
1192
- })
1193
- } else {
1194
- addBase({
1195
- '@defaults border-width': withAlphaVariable({
1196
- color: theme('borderColor.DEFAULT', 'currentColor'),
1197
- property: 'border-color',
1198
- variable: '--tw-border-opacity',
1199
- }),
1200
- })
1201
- }
1202
-
1596
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1203
1597
  matchUtilities(
1204
1598
  {
1205
1599
  border: (value) => {
@@ -1218,7 +1612,7 @@ export let corePlugins = {
1218
1612
  },
1219
1613
  {
1220
1614
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1221
- type: ['color'],
1615
+ type: ['color', 'any'],
1222
1616
  }
1223
1617
  )
1224
1618
 
@@ -1255,12 +1649,38 @@ export let corePlugins = {
1255
1649
  },
1256
1650
  {
1257
1651
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1258
- type: 'color',
1652
+ type: ['color', 'any'],
1259
1653
  }
1260
1654
  )
1261
1655
 
1262
1656
  matchUtilities(
1263
1657
  {
1658
+ 'border-s': (value) => {
1659
+ if (!corePlugins('borderOpacity')) {
1660
+ return {
1661
+ 'border-inline-start-color': toColorValue(value),
1662
+ }
1663
+ }
1664
+
1665
+ return withAlphaVariable({
1666
+ color: value,
1667
+ property: 'border-inline-start-color',
1668
+ variable: '--tw-border-opacity',
1669
+ })
1670
+ },
1671
+ 'border-e': (value) => {
1672
+ if (!corePlugins('borderOpacity')) {
1673
+ return {
1674
+ 'border-inline-end-color': toColorValue(value),
1675
+ }
1676
+ }
1677
+
1678
+ return withAlphaVariable({
1679
+ color: value,
1680
+ property: 'border-inline-end-color',
1681
+ variable: '--tw-border-opacity',
1682
+ })
1683
+ },
1264
1684
  'border-t': (value) => {
1265
1685
  if (!corePlugins('borderOpacity')) {
1266
1686
  return {
@@ -1316,7 +1736,7 @@ export let corePlugins = {
1316
1736
  },
1317
1737
  {
1318
1738
  values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
1319
- type: 'color',
1739
+ type: ['color', 'any'],
1320
1740
  }
1321
1741
  )
1322
1742
  },
@@ -1342,7 +1762,7 @@ export let corePlugins = {
1342
1762
  })
1343
1763
  },
1344
1764
  },
1345
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
1765
+ { values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
1346
1766
  )
1347
1767
  },
1348
1768
 
@@ -1357,44 +1777,98 @@ export let corePlugins = {
1357
1777
  return withAlphaValue(value, 0, 'rgb(255 255 255 / 0)')
1358
1778
  }
1359
1779
 
1360
- return function ({ matchUtilities, theme }) {
1780
+ return function ({ matchUtilities, theme, addDefaults }) {
1781
+ addDefaults('gradient-color-stops', {
1782
+ '--tw-gradient-from-position': ' ',
1783
+ '--tw-gradient-via-position': ' ',
1784
+ '--tw-gradient-to-position': ' ',
1785
+ })
1786
+
1361
1787
  let options = {
1362
1788
  values: flattenColorPalette(theme('gradientColorStops')),
1363
1789
  type: ['color', 'any'],
1364
1790
  }
1365
1791
 
1792
+ let positionOptions = {
1793
+ values: theme('gradientColorStopPositions'),
1794
+ type: ['length', 'percentage'],
1795
+ }
1796
+
1366
1797
  matchUtilities(
1367
1798
  {
1368
1799
  from: (value) => {
1369
1800
  let transparentToValue = transparentTo(value)
1370
1801
 
1371
1802
  return {
1372
- '--tw-gradient-from': toColorValue(value, 'from'),
1373
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1803
+ '@defaults gradient-color-stops': {},
1804
+ '--tw-gradient-from': `${toColorValue(value)} var(--tw-gradient-from-position)`,
1805
+ '--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
1806
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
1374
1807
  }
1375
1808
  },
1376
1809
  },
1377
1810
  options
1378
1811
  )
1812
+
1813
+ matchUtilities(
1814
+ {
1815
+ from: (value) => {
1816
+ return {
1817
+ '--tw-gradient-from-position': value,
1818
+ }
1819
+ },
1820
+ },
1821
+ positionOptions
1822
+ )
1823
+
1379
1824
  matchUtilities(
1380
1825
  {
1381
1826
  via: (value) => {
1382
1827
  let transparentToValue = transparentTo(value)
1383
1828
 
1384
1829
  return {
1830
+ '@defaults gradient-color-stops': {},
1831
+ '--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
1385
1832
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1386
- value,
1387
- 'via'
1388
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1833
+ value
1834
+ )} var(--tw-gradient-via-position), var(--tw-gradient-to)`,
1389
1835
  }
1390
1836
  },
1391
1837
  },
1392
1838
  options
1393
1839
  )
1840
+
1394
1841
  matchUtilities(
1395
- { to: (value) => ({ '--tw-gradient-to': toColorValue(value, 'to') }) },
1842
+ {
1843
+ via: (value) => {
1844
+ return {
1845
+ '--tw-gradient-via-position': value,
1846
+ }
1847
+ },
1848
+ },
1849
+ positionOptions
1850
+ )
1851
+
1852
+ matchUtilities(
1853
+ {
1854
+ to: (value) => ({
1855
+ '@defaults gradient-color-stops': {},
1856
+ '--tw-gradient-to': `${toColorValue(value)} var(--tw-gradient-to-position)`,
1857
+ }),
1858
+ },
1396
1859
  options
1397
1860
  )
1861
+
1862
+ matchUtilities(
1863
+ {
1864
+ to: (value) => {
1865
+ return {
1866
+ '--tw-gradient-to-position': value,
1867
+ }
1868
+ },
1869
+ },
1870
+ positionOptions
1871
+ )
1398
1872
  }
1399
1873
  })(),
1400
1874
 
@@ -1408,7 +1882,7 @@ export let corePlugins = {
1408
1882
  },
1409
1883
 
1410
1884
  backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
1411
- type: ['lookup', 'length', 'percentage'],
1885
+ type: ['lookup', 'length', 'percentage', 'size'],
1412
1886
  }),
1413
1887
 
1414
1888
  backgroundAttachment: ({ addUtilities }) => {
@@ -1429,7 +1903,7 @@ export let corePlugins = {
1429
1903
  },
1430
1904
 
1431
1905
  backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
1432
- type: ['lookup', 'position'],
1906
+ type: ['lookup', ['position', { preferOnConflict: true }]],
1433
1907
  }),
1434
1908
 
1435
1909
  backgroundRepeat: ({ addUtilities }) => {
@@ -1469,7 +1943,7 @@ export let corePlugins = {
1469
1943
  return { stroke: toColorValue(value) }
1470
1944
  },
1471
1945
  },
1472
- { values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
1946
+ { values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
1473
1947
  )
1474
1948
  },
1475
1949
 
@@ -1495,6 +1969,8 @@ export let corePlugins = {
1495
1969
  ['py', ['padding-top', 'padding-bottom']],
1496
1970
  ],
1497
1971
  [
1972
+ ['ps', ['padding-inline-start']],
1973
+ ['pe', ['padding-inline-end']],
1498
1974
  ['pt', ['padding-top']],
1499
1975
  ['pr', ['padding-right']],
1500
1976
  ['pb', ['padding-bottom']],
@@ -1508,6 +1984,8 @@ export let corePlugins = {
1508
1984
  '.text-center': { 'text-align': 'center' },
1509
1985
  '.text-right': { 'text-align': 'right' },
1510
1986
  '.text-justify': { 'text-align': 'justify' },
1987
+ '.text-start': { 'text-align': 'start' },
1988
+ '.text-end': { 'text-align': 'end' },
1511
1989
  })
1512
1990
  },
1513
1991
 
@@ -1530,16 +2008,46 @@ export let corePlugins = {
1530
2008
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1531
2009
  },
1532
2010
 
1533
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1534
- type: ['lookup', 'generic-name', 'family-name'],
1535
- }),
2011
+ fontFamily: ({ matchUtilities, theme }) => {
2012
+ matchUtilities(
2013
+ {
2014
+ font: (value) => {
2015
+ let [families, options = {}] =
2016
+ Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
2017
+ let { fontFeatureSettings, fontVariationSettings } = options
2018
+
2019
+ return {
2020
+ 'font-family': Array.isArray(families) ? families.join(', ') : families,
2021
+ ...(fontFeatureSettings === undefined
2022
+ ? {}
2023
+ : { 'font-feature-settings': fontFeatureSettings }),
2024
+ ...(fontVariationSettings === undefined
2025
+ ? {}
2026
+ : { 'font-variation-settings': fontVariationSettings }),
2027
+ }
2028
+ },
2029
+ },
2030
+ {
2031
+ values: theme('fontFamily'),
2032
+ type: ['lookup', 'generic-name', 'family-name'],
2033
+ }
2034
+ )
2035
+ },
1536
2036
 
1537
2037
  fontSize: ({ matchUtilities, theme }) => {
1538
2038
  matchUtilities(
1539
2039
  {
1540
- text: (value) => {
2040
+ text: (value, { modifier }) => {
1541
2041
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1542
- let { lineHeight, letterSpacing } = isPlainObject(options)
2042
+
2043
+ if (modifier) {
2044
+ return {
2045
+ 'font-size': fontSize,
2046
+ 'line-height': modifier,
2047
+ }
2048
+ }
2049
+
2050
+ let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1543
2051
  ? options
1544
2052
  : { lineHeight: options }
1545
2053
 
@@ -1547,18 +2055,20 @@ export let corePlugins = {
1547
2055
  'font-size': fontSize,
1548
2056
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1549
2057
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
2058
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1550
2059
  }
1551
2060
  },
1552
2061
  },
1553
2062
  {
1554
2063
  values: theme('fontSize'),
2064
+ modifiers: theme('lineHeight'),
1555
2065
  type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1556
2066
  }
1557
2067
  )
1558
2068
  },
1559
2069
 
1560
2070
  fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
1561
- type: ['lookup', 'number'],
2071
+ type: ['lookup', 'number', 'any'],
1562
2072
  }),
1563
2073
 
1564
2074
  textTransform: ({ addUtilities }) => {
@@ -1577,57 +2087,59 @@ export let corePlugins = {
1577
2087
  })
1578
2088
  },
1579
2089
 
1580
- fontVariantNumeric: ({ addUtilities }) => {
2090
+ fontVariantNumeric: ({ addDefaults, addUtilities }) => {
2091
+ let cssFontVariantNumericValue =
2092
+ 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
2093
+
2094
+ addDefaults('font-variant-numeric', {
2095
+ '--tw-ordinal': ' ',
2096
+ '--tw-slashed-zero': ' ',
2097
+ '--tw-numeric-figure': ' ',
2098
+ '--tw-numeric-spacing': ' ',
2099
+ '--tw-numeric-fraction': ' ',
2100
+ })
2101
+
1581
2102
  addUtilities({
1582
- '@defaults font-variant-numeric': {
1583
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1584
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1585
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1586
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1587
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1588
- '--tw-font-variant-numeric':
1589
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1590
- },
1591
2103
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1592
2104
  '.ordinal': {
1593
2105
  '@defaults font-variant-numeric': {},
1594
2106
  '--tw-ordinal': 'ordinal',
1595
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2107
+ 'font-variant-numeric': cssFontVariantNumericValue,
1596
2108
  },
1597
2109
  '.slashed-zero': {
1598
2110
  '@defaults font-variant-numeric': {},
1599
2111
  '--tw-slashed-zero': 'slashed-zero',
1600
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2112
+ 'font-variant-numeric': cssFontVariantNumericValue,
1601
2113
  },
1602
2114
  '.lining-nums': {
1603
2115
  '@defaults font-variant-numeric': {},
1604
2116
  '--tw-numeric-figure': 'lining-nums',
1605
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2117
+ 'font-variant-numeric': cssFontVariantNumericValue,
1606
2118
  },
1607
2119
  '.oldstyle-nums': {
1608
2120
  '@defaults font-variant-numeric': {},
1609
2121
  '--tw-numeric-figure': 'oldstyle-nums',
1610
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2122
+ 'font-variant-numeric': cssFontVariantNumericValue,
1611
2123
  },
1612
2124
  '.proportional-nums': {
1613
2125
  '@defaults font-variant-numeric': {},
1614
2126
  '--tw-numeric-spacing': 'proportional-nums',
1615
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2127
+ 'font-variant-numeric': cssFontVariantNumericValue,
1616
2128
  },
1617
2129
  '.tabular-nums': {
1618
2130
  '@defaults font-variant-numeric': {},
1619
2131
  '--tw-numeric-spacing': 'tabular-nums',
1620
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2132
+ 'font-variant-numeric': cssFontVariantNumericValue,
1621
2133
  },
1622
2134
  '.diagonal-fractions': {
1623
2135
  '@defaults font-variant-numeric': {},
1624
2136
  '--tw-numeric-fraction': 'diagonal-fractions',
1625
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2137
+ 'font-variant-numeric': cssFontVariantNumericValue,
1626
2138
  },
1627
2139
  '.stacked-fractions': {
1628
2140
  '@defaults font-variant-numeric': {},
1629
2141
  '--tw-numeric-fraction': 'stacked-fractions',
1630
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
2142
+ 'font-variant-numeric': cssFontVariantNumericValue,
1631
2143
  },
1632
2144
  })
1633
2145
  },
@@ -1652,7 +2164,7 @@ export let corePlugins = {
1652
2164
  })
1653
2165
  },
1654
2166
  },
1655
- { values: flattenColorPalette(theme('textColor')), type: 'color' }
2167
+ { values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
1656
2168
  )
1657
2169
  },
1658
2170
 
@@ -1660,10 +2172,10 @@ export let corePlugins = {
1660
2172
 
1661
2173
  textDecoration: ({ addUtilities }) => {
1662
2174
  addUtilities({
1663
- '.underline': { 'text-decoration': 'underline' },
1664
- '.overline': { 'text-decoration': 'overline' },
1665
- '.line-through': { 'text-decoration': 'line-through' },
1666
- '.no-underline': { 'text-decoration': 'none' },
2175
+ '.underline': { 'text-decoration-line': 'underline' },
2176
+ '.overline': { 'text-decoration-line': 'overline' },
2177
+ '.line-through': { 'text-decoration-line': 'line-through' },
2178
+ '.no-underline': { 'text-decoration-line': 'none' },
1667
2179
  })
1668
2180
  },
1669
2181
 
@@ -1674,7 +2186,7 @@ export let corePlugins = {
1674
2186
  return { 'text-decoration-color': toColorValue(value) }
1675
2187
  },
1676
2188
  },
1677
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
2189
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1678
2190
  )
1679
2191
  },
1680
2192
 
@@ -1697,7 +2209,7 @@ export let corePlugins = {
1697
2209
  textUnderlineOffset: createUtilityPlugin(
1698
2210
  'textUnderlineOffset',
1699
2211
  [['underline-offset', ['text-underline-offset']]],
1700
- { type: ['length', 'percentage'] }
2212
+ { type: ['length', 'percentage', 'any'] }
1701
2213
  ),
1702
2214
 
1703
2215
  fontSmoothing: ({ addUtilities }) => {
@@ -1812,6 +2324,7 @@ export let corePlugins = {
1812
2324
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1813
2325
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1814
2326
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
2327
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1815
2328
  })
1816
2329
  },
1817
2330
 
@@ -1823,14 +2336,12 @@ export let corePlugins = {
1823
2336
  `var(--tw-shadow)`,
1824
2337
  ].join(', ')
1825
2338
 
1826
- return function ({ matchUtilities, addBase, theme }) {
1827
- addBase({
1828
- '@defaults box-shadow': {
1829
- '--tw-ring-offset-shadow': '0 0 #0000',
1830
- '--tw-ring-shadow': '0 0 #0000',
1831
- '--tw-shadow': '0 0 #0000',
1832
- '--tw-shadow-colored': '0 0 #0000',
1833
- },
2339
+ return function ({ matchUtilities, addDefaults, theme }) {
2340
+ addDefaults(' box-shadow', {
2341
+ '--tw-ring-offset-shadow': '0 0 #0000',
2342
+ '--tw-ring-shadow': '0 0 #0000',
2343
+ '--tw-shadow': '0 0 #0000',
2344
+ '--tw-shadow-colored': '0 0 #0000',
1834
2345
  })
1835
2346
 
1836
2347
  matchUtilities(
@@ -1871,7 +2382,7 @@ export let corePlugins = {
1871
2382
  }
1872
2383
  },
1873
2384
  },
1874
- { values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
2385
+ { values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
1875
2386
  )
1876
2387
  },
1877
2388
 
@@ -1885,7 +2396,6 @@ export let corePlugins = {
1885
2396
  '.outline-dashed': { 'outline-style': 'dashed' },
1886
2397
  '.outline-dotted': { 'outline-style': 'dotted' },
1887
2398
  '.outline-double': { 'outline-style': 'double' },
1888
- '.outline-hidden': { 'outline-style': 'hidden' },
1889
2399
  })
1890
2400
  },
1891
2401
 
@@ -1894,7 +2404,8 @@ export let corePlugins = {
1894
2404
  }),
1895
2405
 
1896
2406
  outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1897
- type: ['length', 'number', 'percentage'],
2407
+ type: ['length', 'number', 'percentage', 'any'],
2408
+ supportsNegativeValues: true,
1898
2409
  }),
1899
2410
 
1900
2411
  outlineColor: ({ matchUtilities, theme }) => {
@@ -1904,29 +2415,38 @@ export let corePlugins = {
1904
2415
  return { 'outline-color': toColorValue(value) }
1905
2416
  },
1906
2417
  },
1907
- { values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
2418
+ { values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
1908
2419
  )
1909
2420
  },
1910
2421
 
1911
- ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1912
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1913
- let ringColorDefault = withAlphaValue(
1914
- theme('ringColor.DEFAULT'),
1915
- ringOpacityDefault,
1916
- `rgb(147 197 253 / ${ringOpacityDefault})`
1917
- )
2422
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
2423
+ let ringColorDefault = (() => {
2424
+ if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
2425
+ return theme('ringColor.DEFAULT')
2426
+ }
1918
2427
 
1919
- addBase({
1920
- '@defaults ring-width': {
1921
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1922
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1923
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1924
- '--tw-ring-color': ringColorDefault,
1925
- '--tw-ring-offset-shadow': '0 0 #0000',
1926
- '--tw-ring-shadow': '0 0 #0000',
1927
- '--tw-shadow': '0 0 #0000',
1928
- '--tw-shadow-colored': '0 0 #0000',
1929
- },
2428
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
2429
+
2430
+ if (!theme('ringColor')?.DEFAULT) {
2431
+ return `rgb(147 197 253 / ${ringOpacityDefault})`
2432
+ }
2433
+
2434
+ return withAlphaValue(
2435
+ theme('ringColor')?.DEFAULT,
2436
+ ringOpacityDefault,
2437
+ `rgb(147 197 253 / ${ringOpacityDefault})`
2438
+ )
2439
+ })()
2440
+
2441
+ addDefaults('ring-width', {
2442
+ '--tw-ring-inset': ' ',
2443
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
2444
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
2445
+ '--tw-ring-color': ringColorDefault,
2446
+ '--tw-ring-offset-shadow': '0 0 #0000',
2447
+ '--tw-ring-shadow': '0 0 #0000',
2448
+ '--tw-shadow': '0 0 #0000',
2449
+ '--tw-shadow-colored': '0 0 #0000',
1930
2450
  })
1931
2451
 
1932
2452
  matchUtilities(
@@ -1952,10 +2472,16 @@ export let corePlugins = {
1952
2472
  })
1953
2473
  },
1954
2474
 
1955
- ringColor: ({ matchUtilities, theme }) => {
2475
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1956
2476
  matchUtilities(
1957
2477
  {
1958
2478
  ring: (value) => {
2479
+ if (!corePlugins('ringOpacity')) {
2480
+ return {
2481
+ '--tw-ring-color': toColorValue(value),
2482
+ }
2483
+ }
2484
+
1959
2485
  return withAlphaVariable({
1960
2486
  color: value,
1961
2487
  property: '--tw-ring-color',
@@ -1969,14 +2495,18 @@ export let corePlugins = {
1969
2495
  ([modifier]) => modifier !== 'DEFAULT'
1970
2496
  )
1971
2497
  ),
1972
- type: 'color',
2498
+ type: ['color', 'any'],
1973
2499
  }
1974
2500
  )
1975
2501
  },
1976
2502
 
1977
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1978
- filterDefault: true,
1979
- }),
2503
+ ringOpacity: (helpers) => {
2504
+ let { config } = helpers
2505
+
2506
+ return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
2507
+ filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
2508
+ })(helpers)
2509
+ },
1980
2510
  ringOffsetWidth: createUtilityPlugin(
1981
2511
  'ringOffsetWidth',
1982
2512
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -1992,7 +2522,7 @@ export let corePlugins = {
1992
2522
  }
1993
2523
  },
1994
2524
  },
1995
- { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
2525
+ { values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
1996
2526
  )
1997
2527
  },
1998
2528
 
@@ -2003,7 +2533,7 @@ export let corePlugins = {
2003
2533
  return {
2004
2534
  '--tw-blur': `blur(${value})`,
2005
2535
  '@defaults filter': {},
2006
- filter: 'var(--tw-filter)',
2536
+ filter: cssFilterValue,
2007
2537
  }
2008
2538
  },
2009
2539
  },
@@ -2018,7 +2548,7 @@ export let corePlugins = {
2018
2548
  return {
2019
2549
  '--tw-brightness': `brightness(${value})`,
2020
2550
  '@defaults filter': {},
2021
- filter: 'var(--tw-filter)',
2551
+ filter: cssFilterValue,
2022
2552
  }
2023
2553
  },
2024
2554
  },
@@ -2033,7 +2563,7 @@ export let corePlugins = {
2033
2563
  return {
2034
2564
  '--tw-contrast': `contrast(${value})`,
2035
2565
  '@defaults filter': {},
2036
- filter: 'var(--tw-filter)',
2566
+ filter: cssFilterValue,
2037
2567
  }
2038
2568
  },
2039
2569
  },
@@ -2050,7 +2580,7 @@ export let corePlugins = {
2050
2580
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
2051
2581
  : `drop-shadow(${value})`,
2052
2582
  '@defaults filter': {},
2053
- filter: 'var(--tw-filter)',
2583
+ filter: cssFilterValue,
2054
2584
  }
2055
2585
  },
2056
2586
  },
@@ -2065,7 +2595,7 @@ export let corePlugins = {
2065
2595
  return {
2066
2596
  '--tw-grayscale': `grayscale(${value})`,
2067
2597
  '@defaults filter': {},
2068
- filter: 'var(--tw-filter)',
2598
+ filter: cssFilterValue,
2069
2599
  }
2070
2600
  },
2071
2601
  },
@@ -2080,7 +2610,7 @@ export let corePlugins = {
2080
2610
  return {
2081
2611
  '--tw-hue-rotate': `hue-rotate(${value})`,
2082
2612
  '@defaults filter': {},
2083
- filter: 'var(--tw-filter)',
2613
+ filter: cssFilterValue,
2084
2614
  }
2085
2615
  },
2086
2616
  },
@@ -2095,7 +2625,7 @@ export let corePlugins = {
2095
2625
  return {
2096
2626
  '--tw-invert': `invert(${value})`,
2097
2627
  '@defaults filter': {},
2098
- filter: 'var(--tw-filter)',
2628
+ filter: cssFilterValue,
2099
2629
  }
2100
2630
  },
2101
2631
  },
@@ -2110,7 +2640,7 @@ export let corePlugins = {
2110
2640
  return {
2111
2641
  '--tw-saturate': `saturate(${value})`,
2112
2642
  '@defaults filter': {},
2113
- filter: 'var(--tw-filter)',
2643
+ filter: cssFilterValue,
2114
2644
  }
2115
2645
  },
2116
2646
  },
@@ -2125,7 +2655,7 @@ export let corePlugins = {
2125
2655
  return {
2126
2656
  '--tw-sepia': `sepia(${value})`,
2127
2657
  '@defaults filter': {},
2128
- filter: 'var(--tw-filter)',
2658
+ filter: cssFilterValue,
2129
2659
  }
2130
2660
  },
2131
2661
  },
@@ -2133,33 +2663,20 @@ export let corePlugins = {
2133
2663
  )
2134
2664
  },
2135
2665
 
2136
- filter: ({ addBase, addUtilities }) => {
2137
- addBase({
2138
- '@defaults filter': {
2139
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2140
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2141
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2142
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2143
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2144
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2145
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2146
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2147
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2148
- '--tw-filter': [
2149
- 'var(--tw-blur)',
2150
- 'var(--tw-brightness)',
2151
- 'var(--tw-contrast)',
2152
- 'var(--tw-grayscale)',
2153
- 'var(--tw-hue-rotate)',
2154
- 'var(--tw-invert)',
2155
- 'var(--tw-saturate)',
2156
- 'var(--tw-sepia)',
2157
- 'var(--tw-drop-shadow)',
2158
- ].join(' '),
2159
- },
2160
- })
2161
- addUtilities({
2162
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2666
+ filter: ({ addDefaults, addUtilities }) => {
2667
+ addDefaults('filter', {
2668
+ '--tw-blur': ' ',
2669
+ '--tw-brightness': ' ',
2670
+ '--tw-contrast': ' ',
2671
+ '--tw-grayscale': ' ',
2672
+ '--tw-hue-rotate': ' ',
2673
+ '--tw-invert': ' ',
2674
+ '--tw-saturate': ' ',
2675
+ '--tw-sepia': ' ',
2676
+ '--tw-drop-shadow': ' ',
2677
+ })
2678
+ addUtilities({
2679
+ '.filter': { '@defaults filter': {}, filter: cssFilterValue },
2163
2680
  '.filter-none': { filter: 'none' },
2164
2681
  })
2165
2682
  },
@@ -2171,7 +2688,7 @@ export let corePlugins = {
2171
2688
  return {
2172
2689
  '--tw-backdrop-blur': `blur(${value})`,
2173
2690
  '@defaults backdrop-filter': {},
2174
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2691
+ 'backdrop-filter': cssBackdropFilterValue,
2175
2692
  }
2176
2693
  },
2177
2694
  },
@@ -2186,7 +2703,7 @@ export let corePlugins = {
2186
2703
  return {
2187
2704
  '--tw-backdrop-brightness': `brightness(${value})`,
2188
2705
  '@defaults backdrop-filter': {},
2189
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2706
+ 'backdrop-filter': cssBackdropFilterValue,
2190
2707
  }
2191
2708
  },
2192
2709
  },
@@ -2201,7 +2718,7 @@ export let corePlugins = {
2201
2718
  return {
2202
2719
  '--tw-backdrop-contrast': `contrast(${value})`,
2203
2720
  '@defaults backdrop-filter': {},
2204
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2721
+ 'backdrop-filter': cssBackdropFilterValue,
2205
2722
  }
2206
2723
  },
2207
2724
  },
@@ -2216,7 +2733,7 @@ export let corePlugins = {
2216
2733
  return {
2217
2734
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2218
2735
  '@defaults backdrop-filter': {},
2219
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2736
+ 'backdrop-filter': cssBackdropFilterValue,
2220
2737
  }
2221
2738
  },
2222
2739
  },
@@ -2231,7 +2748,7 @@ export let corePlugins = {
2231
2748
  return {
2232
2749
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2233
2750
  '@defaults backdrop-filter': {},
2234
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2751
+ 'backdrop-filter': cssBackdropFilterValue,
2235
2752
  }
2236
2753
  },
2237
2754
  },
@@ -2246,7 +2763,7 @@ export let corePlugins = {
2246
2763
  return {
2247
2764
  '--tw-backdrop-invert': `invert(${value})`,
2248
2765
  '@defaults backdrop-filter': {},
2249
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2766
+ 'backdrop-filter': cssBackdropFilterValue,
2250
2767
  }
2251
2768
  },
2252
2769
  },
@@ -2261,7 +2778,7 @@ export let corePlugins = {
2261
2778
  return {
2262
2779
  '--tw-backdrop-opacity': `opacity(${value})`,
2263
2780
  '@defaults backdrop-filter': {},
2264
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2781
+ 'backdrop-filter': cssBackdropFilterValue,
2265
2782
  }
2266
2783
  },
2267
2784
  },
@@ -2276,7 +2793,7 @@ export let corePlugins = {
2276
2793
  return {
2277
2794
  '--tw-backdrop-saturate': `saturate(${value})`,
2278
2795
  '@defaults backdrop-filter': {},
2279
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2796
+ 'backdrop-filter': cssBackdropFilterValue,
2280
2797
  }
2281
2798
  },
2282
2799
  },
@@ -2291,7 +2808,7 @@ export let corePlugins = {
2291
2808
  return {
2292
2809
  '--tw-backdrop-sepia': `sepia(${value})`,
2293
2810
  '@defaults backdrop-filter': {},
2294
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2811
+ 'backdrop-filter': cssBackdropFilterValue,
2295
2812
  }
2296
2813
  },
2297
2814
  },
@@ -2299,35 +2816,22 @@ export let corePlugins = {
2299
2816
  )
2300
2817
  },
2301
2818
 
2302
- backdropFilter: ({ addBase, addUtilities }) => {
2303
- addBase({
2304
- '@defaults backdrop-filter': {
2305
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2306
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2307
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2308
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2309
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2310
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2311
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2312
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2313
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2314
- '--tw-backdrop-filter': [
2315
- 'var(--tw-backdrop-blur)',
2316
- 'var(--tw-backdrop-brightness)',
2317
- 'var(--tw-backdrop-contrast)',
2318
- 'var(--tw-backdrop-grayscale)',
2319
- 'var(--tw-backdrop-hue-rotate)',
2320
- 'var(--tw-backdrop-invert)',
2321
- 'var(--tw-backdrop-opacity)',
2322
- 'var(--tw-backdrop-saturate)',
2323
- 'var(--tw-backdrop-sepia)',
2324
- ].join(' '),
2325
- },
2819
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2820
+ addDefaults('backdrop-filter', {
2821
+ '--tw-backdrop-blur': ' ',
2822
+ '--tw-backdrop-brightness': ' ',
2823
+ '--tw-backdrop-contrast': ' ',
2824
+ '--tw-backdrop-grayscale': ' ',
2825
+ '--tw-backdrop-hue-rotate': ' ',
2826
+ '--tw-backdrop-invert': ' ',
2827
+ '--tw-backdrop-opacity': ' ',
2828
+ '--tw-backdrop-saturate': ' ',
2829
+ '--tw-backdrop-sepia': ' ',
2326
2830
  })
2327
2831
  addUtilities({
2328
2832
  '.backdrop-filter': {
2329
2833
  '@defaults backdrop-filter': {},
2330
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2834
+ 'backdrop-filter': cssBackdropFilterValue,
2331
2835
  },
2332
2836
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2333
2837
  })