tailwindcss 0.0.0-insiders.4e21639 → 0.0.0-insiders.4e62334

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 (157) hide show
  1. package/CHANGELOG.md +435 -3
  2. package/LICENSE +1 -2
  3. package/README.md +13 -6
  4. package/colors.d.ts +3 -0
  5. package/colors.js +2 -1
  6. package/defaultConfig.d.ts +3 -0
  7. package/defaultConfig.js +2 -1
  8. package/defaultTheme.d.ts +4 -0
  9. package/defaultTheme.js +2 -1
  10. package/lib/cli-peer-dependencies.js +20 -7
  11. package/lib/cli.js +460 -259
  12. package/lib/constants.js +27 -20
  13. package/lib/corePluginList.js +9 -3
  14. package/lib/corePlugins.js +1840 -1753
  15. package/lib/css/preflight.css +8 -9
  16. package/lib/featureFlags.js +29 -20
  17. package/lib/index.js +22 -11
  18. package/lib/lib/cacheInvalidation.js +90 -0
  19. package/lib/lib/collapseAdjacentRules.js +27 -9
  20. package/lib/lib/collapseDuplicateDeclarations.js +58 -4
  21. package/lib/lib/defaultExtractor.js +231 -0
  22. package/lib/lib/detectNesting.js +13 -10
  23. package/lib/lib/evaluateTailwindFunctions.js +119 -52
  24. package/lib/lib/expandApplyAtRules.js +440 -161
  25. package/lib/lib/expandTailwindAtRules.js +130 -128
  26. package/lib/lib/generateRules.js +410 -171
  27. package/lib/lib/getModuleDependencies.js +11 -8
  28. package/lib/lib/normalizeTailwindDirectives.js +43 -32
  29. package/lib/lib/offsets.js +199 -0
  30. package/lib/lib/partitionApplyAtRules.js +56 -0
  31. package/lib/lib/regex.js +60 -0
  32. package/lib/lib/resolveDefaultsAtRules.js +91 -55
  33. package/lib/lib/setupContextUtils.js +453 -347
  34. package/lib/lib/setupTrackingContext.js +52 -44
  35. package/lib/lib/sharedState.js +48 -9
  36. package/lib/lib/substituteScreenAtRules.js +13 -8
  37. package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
  38. package/lib/postcss-plugins/nesting/index.js +19 -0
  39. package/lib/postcss-plugins/nesting/plugin.js +87 -0
  40. package/lib/processTailwindFeatures.js +36 -25
  41. package/lib/public/colors.js +247 -245
  42. package/lib/public/create-plugin.js +6 -4
  43. package/lib/public/default-config.js +7 -5
  44. package/lib/public/default-theme.js +7 -5
  45. package/lib/public/resolve-config.js +8 -5
  46. package/lib/util/bigSign.js +4 -1
  47. package/lib/util/buildMediaQuery.js +16 -25
  48. package/lib/util/cloneDeep.js +7 -6
  49. package/lib/util/cloneNodes.js +21 -3
  50. package/lib/util/color.js +54 -40
  51. package/lib/util/configurePlugins.js +4 -1
  52. package/lib/util/createPlugin.js +6 -6
  53. package/lib/util/createUtilityPlugin.js +12 -14
  54. package/lib/util/dataTypes.js +119 -102
  55. package/lib/util/defaults.js +10 -1
  56. package/lib/util/escapeClassName.js +7 -4
  57. package/lib/util/escapeCommas.js +5 -2
  58. package/lib/util/flattenColorPalette.js +9 -12
  59. package/lib/util/formatVariantSelector.js +223 -40
  60. package/lib/util/getAllConfigs.js +27 -8
  61. package/lib/util/hashConfig.js +6 -3
  62. package/lib/util/isKeyframeRule.js +5 -2
  63. package/lib/util/isPlainObject.js +5 -2
  64. package/lib/util/isValidArbitraryValue.js +72 -0
  65. package/lib/util/log.js +22 -12
  66. package/lib/util/nameClass.js +17 -8
  67. package/lib/util/negateValue.js +22 -7
  68. package/lib/util/normalizeConfig.js +99 -54
  69. package/lib/util/normalizeScreens.js +73 -0
  70. package/lib/util/parseAnimationValue.js +42 -40
  71. package/lib/util/parseBoxShadowValue.js +30 -23
  72. package/lib/util/parseDependency.js +18 -15
  73. package/lib/util/parseObjectStyles.js +10 -7
  74. package/lib/util/pluginUtils.js +51 -42
  75. package/lib/util/prefixSelector.js +10 -8
  76. package/lib/util/removeAlphaVariables.js +29 -0
  77. package/lib/util/resolveConfig.js +91 -66
  78. package/lib/util/resolveConfigPath.js +11 -9
  79. package/lib/util/responsive.js +8 -5
  80. package/lib/util/splitAtTopLevelOnly.js +43 -0
  81. package/lib/util/tap.js +4 -1
  82. package/lib/util/toColorValue.js +5 -3
  83. package/lib/util/toPath.js +24 -3
  84. package/lib/util/transformThemeValue.js +37 -29
  85. package/lib/util/validateConfig.js +24 -0
  86. package/lib/util/withAlphaVariable.js +23 -15
  87. package/nesting/index.js +2 -12
  88. package/package.json +43 -43
  89. package/peers/index.js +11543 -8114
  90. package/plugin.d.ts +11 -0
  91. package/plugin.js +2 -1
  92. package/resolveConfig.d.ts +3 -0
  93. package/resolveConfig.js +2 -1
  94. package/scripts/generate-types.js +105 -0
  95. package/scripts/type-utils.js +27 -0
  96. package/src/cli-peer-dependencies.js +7 -1
  97. package/src/cli.js +293 -36
  98. package/src/corePluginList.js +1 -1
  99. package/src/corePlugins.js +428 -285
  100. package/src/css/preflight.css +8 -9
  101. package/src/featureFlags.js +9 -5
  102. package/src/index.js +14 -6
  103. package/src/lib/cacheInvalidation.js +52 -0
  104. package/src/lib/collapseAdjacentRules.js +21 -2
  105. package/src/lib/collapseDuplicateDeclarations.js +66 -1
  106. package/src/lib/defaultExtractor.js +208 -0
  107. package/src/lib/evaluateTailwindFunctions.js +84 -10
  108. package/src/lib/expandApplyAtRules.js +488 -153
  109. package/src/lib/expandTailwindAtRules.js +82 -80
  110. package/src/lib/generateRules.js +352 -120
  111. package/src/lib/normalizeTailwindDirectives.js +7 -1
  112. package/src/lib/offsets.js +239 -0
  113. package/src/lib/partitionApplyAtRules.js +52 -0
  114. package/src/lib/regex.js +74 -0
  115. package/src/lib/resolveDefaultsAtRules.js +59 -17
  116. package/src/lib/setupContextUtils.js +337 -174
  117. package/src/lib/setupTrackingContext.js +13 -8
  118. package/src/lib/sharedState.js +42 -4
  119. package/src/lib/substituteScreenAtRules.js +6 -3
  120. package/src/postcss-plugins/nesting/README.md +42 -0
  121. package/src/postcss-plugins/nesting/index.js +13 -0
  122. package/src/postcss-plugins/nesting/plugin.js +80 -0
  123. package/src/processTailwindFeatures.js +12 -2
  124. package/src/util/buildMediaQuery.js +14 -18
  125. package/src/util/cloneNodes.js +19 -2
  126. package/src/util/color.js +31 -14
  127. package/src/util/dataTypes.js +28 -19
  128. package/src/util/defaults.js +6 -0
  129. package/src/util/formatVariantSelector.js +237 -23
  130. package/src/util/getAllConfigs.js +19 -0
  131. package/src/util/isValidArbitraryValue.js +61 -0
  132. package/src/util/log.js +11 -7
  133. package/src/util/nameClass.js +1 -1
  134. package/src/util/negateValue.js +10 -2
  135. package/src/util/normalizeConfig.js +16 -3
  136. package/src/util/normalizeScreens.js +45 -0
  137. package/src/util/parseBoxShadowValue.js +4 -3
  138. package/src/util/pluginUtils.js +14 -2
  139. package/src/util/prefixSelector.js +7 -5
  140. package/src/util/removeAlphaVariables.js +24 -0
  141. package/src/util/resolveConfig.js +71 -17
  142. package/src/util/splitAtTopLevelOnly.js +45 -0
  143. package/src/util/toPath.js +23 -1
  144. package/src/util/transformThemeValue.js +13 -3
  145. package/src/util/validateConfig.js +13 -0
  146. package/src/util/withAlphaVariable.js +1 -1
  147. package/stubs/defaultConfig.stub.js +24 -3
  148. package/stubs/simpleConfig.stub.js +1 -0
  149. package/types/config.d.ts +334 -0
  150. package/types/generated/.gitkeep +0 -0
  151. package/types/generated/colors.d.ts +276 -0
  152. package/types/generated/corePluginList.d.ts +1 -0
  153. package/types/generated/default-theme.d.ts +331 -0
  154. package/types/index.d.ts +7 -0
  155. package/lib/lib/setupWatchingContext.js +0 -288
  156. package/nesting/plugin.js +0 -41
  157. 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,18 +12,37 @@ 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'
15
+ import { normalizeScreens } from './util/normalizeScreens'
14
16
  import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
17
+ import { removeAlphaVariables } from './util/removeAlphaVariables'
18
+ import { flagEnabled } from './featureFlags'
15
19
 
16
20
  export let variantPlugins = {
17
21
  pseudoElementVariants: ({ addVariant }) => {
18
22
  addVariant('first-letter', '&::first-letter')
19
23
  addVariant('first-line', '&::first-line')
20
24
 
21
- addVariant('marker', ['& *::marker', '&::marker'])
25
+ addVariant('marker', [
26
+ ({ container }) => {
27
+ removeAlphaVariables(container, ['--tw-text-opacity'])
28
+
29
+ return '& *::marker'
30
+ },
31
+ ({ container }) => {
32
+ removeAlphaVariables(container, ['--tw-text-opacity'])
33
+
34
+ return '&::marker'
35
+ },
36
+ ])
37
+
22
38
  addVariant('selection', ['& *::selection', '&::selection'])
23
39
 
24
40
  addVariant('file', '&::file-selector-button')
25
41
 
42
+ addVariant('placeholder', '&::placeholder')
43
+
44
+ addVariant('backdrop', '&::backdrop')
45
+
26
46
  addVariant('before', ({ container }) => {
27
47
  container.walkRules((rule) => {
28
48
  let foundContent = false
@@ -54,22 +74,33 @@ export let variantPlugins = {
54
74
  })
55
75
  },
56
76
 
57
- pseudoClassVariants: ({ addVariant }) => {
77
+ pseudoClassVariants: ({ addVariant, config }) => {
58
78
  let pseudoVariants = [
59
79
  // Positional
60
- ['first', ':first-child'],
61
- ['last', ':last-child'],
62
- ['only', ':only-child'],
63
- ['odd', ':nth-child(odd)'],
64
- ['even', ':nth-child(even)'],
80
+ ['first', '&:first-child'],
81
+ ['last', '&:last-child'],
82
+ ['only', '&:only-child'],
83
+ ['odd', '&:nth-child(odd)'],
84
+ ['even', '&:nth-child(even)'],
65
85
  'first-of-type',
66
86
  'last-of-type',
67
87
  'only-of-type',
68
88
 
69
89
  // State
70
- 'visited',
90
+ [
91
+ 'visited',
92
+ ({ container }) => {
93
+ removeAlphaVariables(container, [
94
+ '--tw-text-opacity',
95
+ '--tw-border-opacity',
96
+ '--tw-bg-opacity',
97
+ ])
98
+
99
+ return '&:visited'
100
+ },
101
+ ],
71
102
  'target',
72
- ['open', '[open]'],
103
+ ['open', '&[open]'],
73
104
 
74
105
  // Forms
75
106
  'default',
@@ -77,6 +108,7 @@ export let variantPlugins = {
77
108
  'indeterminate',
78
109
  'placeholder-shown',
79
110
  'autofill',
111
+ 'optional',
80
112
  'required',
81
113
  'valid',
82
114
  'invalid',
@@ -89,23 +121,41 @@ export let variantPlugins = {
89
121
 
90
122
  // Interactive
91
123
  'focus-within',
92
- 'hover',
124
+ [
125
+ 'hover',
126
+ !flagEnabled(config(), 'hoverOnlyWhenSupported')
127
+ ? '&:hover'
128
+ : '@media (hover: hover) and (pointer: fine) { &:hover }',
129
+ ],
93
130
  'focus',
94
131
  'focus-visible',
95
132
  'active',
133
+ 'enabled',
96
134
  'disabled',
97
- ].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
135
+ ].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
98
136
 
99
137
  for (let [variantName, state] of pseudoVariants) {
100
- addVariant(variantName, `&${state}`)
138
+ addVariant(variantName, (ctx) => {
139
+ let result = typeof state === 'function' ? state(ctx) : state
140
+
141
+ return result
142
+ })
101
143
  }
102
144
 
103
145
  for (let [variantName, state] of pseudoVariants) {
104
- addVariant(`group-${variantName}`, `:merge(.group)${state} &`)
146
+ addVariant(`group-${variantName}`, (ctx) => {
147
+ let result = typeof state === 'function' ? state(ctx) : state
148
+
149
+ return result.replace(/&(\S+)/, ':merge(.group)$1 &')
150
+ })
105
151
  }
106
152
 
107
153
  for (let [variantName, state] of pseudoVariants) {
108
- addVariant(`peer-${variantName}`, `:merge(.peer)${state} ~ &`)
154
+ addVariant(`peer-${variantName}`, (ctx) => {
155
+ let result = typeof state === 'function' ? state(ctx) : state
156
+
157
+ return result.replace(/&(\S+)/, ':merge(.peer)$1 ~ &')
158
+ })
109
159
  }
110
160
  },
111
161
 
@@ -135,17 +185,19 @@ export let variantPlugins = {
135
185
  },
136
186
 
137
187
  darkVariants: ({ config, addVariant }) => {
138
- let mode = config('darkMode', 'media')
188
+ let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
189
+
139
190
  if (mode === false) {
140
191
  mode = 'media'
141
192
  log.warn('darkmode-false', [
142
193
  'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
143
194
  'Change `darkMode` to `media` or remove it entirely.',
195
+ 'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
144
196
  ])
145
197
  }
146
198
 
147
199
  if (mode === 'class') {
148
- addVariant('dark', '.dark &')
200
+ addVariant('dark', `${className} &`)
149
201
  } else if (mode === 'media') {
150
202
  addVariant('dark', '@media (prefers-color-scheme: dark)')
151
203
  }
@@ -156,15 +208,57 @@ export let variantPlugins = {
156
208
  },
157
209
 
158
210
  screenVariants: ({ theme, addVariant }) => {
159
- for (let screen in theme('screens')) {
160
- let size = theme('screens')[screen]
161
- let query = buildMediaQuery(size)
211
+ for (let screen of normalizeScreens(theme('screens'))) {
212
+ let query = buildMediaQuery(screen)
162
213
 
163
- addVariant(screen, `@media ${query}`)
214
+ addVariant(screen.name, `@media ${query}`)
164
215
  }
165
216
  },
217
+
218
+ orientationVariants: ({ addVariant }) => {
219
+ addVariant('portrait', '@media (orientation: portrait)')
220
+ addVariant('landscape', '@media (orientation: landscape)')
221
+ },
222
+
223
+ prefersContrastVariants: ({ addVariant }) => {
224
+ addVariant('contrast-more', '@media (prefers-contrast: more)')
225
+ addVariant('contrast-less', '@media (prefers-contrast: less)')
226
+ },
166
227
  }
167
228
 
229
+ let cssTransformValue = [
230
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
231
+ 'rotate(var(--tw-rotate))',
232
+ 'skewX(var(--tw-skew-x))',
233
+ 'skewY(var(--tw-skew-y))',
234
+ 'scaleX(var(--tw-scale-x))',
235
+ 'scaleY(var(--tw-scale-y))',
236
+ ].join(' ')
237
+
238
+ let cssFilterValue = [
239
+ 'var(--tw-blur)',
240
+ 'var(--tw-brightness)',
241
+ 'var(--tw-contrast)',
242
+ 'var(--tw-grayscale)',
243
+ 'var(--tw-hue-rotate)',
244
+ 'var(--tw-invert)',
245
+ 'var(--tw-saturate)',
246
+ 'var(--tw-sepia)',
247
+ 'var(--tw-drop-shadow)',
248
+ ].join(' ')
249
+
250
+ let cssBackdropFilterValue = [
251
+ 'var(--tw-backdrop-blur)',
252
+ 'var(--tw-backdrop-brightness)',
253
+ 'var(--tw-backdrop-contrast)',
254
+ 'var(--tw-backdrop-grayscale)',
255
+ 'var(--tw-backdrop-hue-rotate)',
256
+ 'var(--tw-backdrop-invert)',
257
+ 'var(--tw-backdrop-opacity)',
258
+ 'var(--tw-backdrop-saturate)',
259
+ 'var(--tw-backdrop-sepia)',
260
+ ].join(' ')
261
+
168
262
  export let corePlugins = {
169
263
  preflight: ({ addBase }) => {
170
264
  let preflightStyles = postcss.parse(
@@ -180,24 +274,10 @@ export let corePlugins = {
180
274
  },
181
275
 
182
276
  container: (() => {
183
- function extractMinWidths(breakpoints) {
184
- return Object.values(breakpoints ?? {}).flatMap((breakpoints) => {
185
- if (typeof breakpoints === 'string') {
186
- breakpoints = { min: breakpoints }
187
- }
188
-
189
- if (!Array.isArray(breakpoints)) {
190
- breakpoints = [breakpoints]
191
- }
192
-
193
- return breakpoints
194
- .filter((breakpoint) => {
195
- return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
196
- })
197
- .map((breakpoint) => {
198
- return breakpoint['min-width'] ?? breakpoint.min
199
- })
200
- })
277
+ function extractMinWidths(breakpoints = []) {
278
+ return breakpoints
279
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
280
+ .filter((v) => v !== undefined)
201
281
  }
202
282
 
203
283
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
@@ -226,16 +306,11 @@ export let corePlugins = {
226
306
  }
227
307
 
228
308
  for (let minWidth of minWidths) {
229
- for (let [screen, value] of Object.entries(screens)) {
230
- let screenMinWidth =
231
- typeof value === 'object' && value !== null ? value.min || value['min-width'] : value
232
-
233
- if (`${screenMinWidth}` === `${minWidth}`) {
234
- mapping.push({
235
- screen,
236
- minWidth,
237
- padding: paddings[screen],
238
- })
309
+ for (let screen of screens) {
310
+ for (let { min } of screen.values) {
311
+ if (min === minWidth) {
312
+ mapping.push({ minWidth, padding: paddings[screen.name] })
313
+ }
239
314
  }
240
315
  }
241
316
  }
@@ -244,12 +319,12 @@ export let corePlugins = {
244
319
  }
245
320
 
246
321
  return function ({ addComponents, theme }) {
247
- let screens = theme('container.screens', theme('screens'))
322
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
248
323
  let minWidths = extractMinWidths(screens)
249
324
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
250
325
 
251
326
  let generatePaddingFor = (minWidth) => {
252
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
327
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
253
328
 
254
329
  if (!paddingConfig) {
255
330
  return {}
@@ -322,6 +397,7 @@ export let corePlugins = {
322
397
  addUtilities({
323
398
  '.visible': { visibility: 'visible' },
324
399
  '.invisible': { visibility: 'hidden' },
400
+ '.collapse': { visibility: 'collapse' },
325
401
  })
326
402
  },
327
403
 
@@ -472,6 +548,41 @@ export let corePlugins = {
472
548
  })
473
549
  },
474
550
 
551
+ borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
552
+ addDefaults('border-spacing', {
553
+ '--tw-border-spacing-x': 0,
554
+ '--tw-border-spacing-y': 0,
555
+ })
556
+
557
+ matchUtilities(
558
+ {
559
+ 'border-spacing': (value) => {
560
+ return {
561
+ '--tw-border-spacing-x': value,
562
+ '--tw-border-spacing-y': value,
563
+ '@defaults border-spacing': {},
564
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
565
+ }
566
+ },
567
+ 'border-spacing-x': (value) => {
568
+ return {
569
+ '--tw-border-spacing-x': value,
570
+ '@defaults border-spacing': {},
571
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
572
+ }
573
+ },
574
+ 'border-spacing-y': (value) => {
575
+ return {
576
+ '--tw-border-spacing-y': value,
577
+ '@defaults border-spacing': {},
578
+ 'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
579
+ }
580
+ },
581
+ },
582
+ { values: theme('borderSpacing') }
583
+ )
584
+ },
585
+
475
586
  transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
476
587
  translate: createUtilityPlugin(
477
588
  'translate',
@@ -479,11 +590,11 @@ export let corePlugins = {
479
590
  [
480
591
  [
481
592
  'translate-x',
482
- [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']],
593
+ [['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
483
594
  ],
484
595
  [
485
596
  'translate-y',
486
- [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']],
597
+ [['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
487
598
  ],
488
599
  ],
489
600
  ],
@@ -491,102 +602,73 @@ export let corePlugins = {
491
602
  ),
492
603
  rotate: createUtilityPlugin(
493
604
  'rotate',
494
- [
495
- [
496
- 'rotate',
497
- [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
498
- ],
499
- ],
605
+ [['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
500
606
  { supportsNegativeValues: true }
501
607
  ),
502
608
  skew: createUtilityPlugin(
503
609
  'skew',
504
610
  [
505
611
  [
506
- [
507
- 'skew-x',
508
- [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
509
- ],
510
- [
511
- 'skew-y',
512
- [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
513
- ],
612
+ ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
613
+ ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
514
614
  ],
515
615
  ],
516
616
  { supportsNegativeValues: true }
517
617
  ),
518
- scale: createUtilityPlugin('scale', [
618
+ scale: createUtilityPlugin(
619
+ 'scale',
519
620
  [
520
- 'scale',
521
621
  [
522
- ['@defaults transform', {}],
523
- '--tw-scale-x',
524
- '--tw-scale-y',
525
- ['transform', 'var(--tw-transform)'],
526
- ],
527
- ],
528
- [
529
- [
530
- 'scale-x',
531
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
622
+ 'scale',
623
+ [
624
+ ['@defaults transform', {}],
625
+ '--tw-scale-x',
626
+ '--tw-scale-y',
627
+ ['transform', cssTransformValue],
628
+ ],
532
629
  ],
533
630
  [
534
- 'scale-y',
535
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
631
+ [
632
+ 'scale-x',
633
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
634
+ ],
635
+ [
636
+ 'scale-y',
637
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
638
+ ],
536
639
  ],
537
640
  ],
538
- ]),
641
+ { supportsNegativeValues: true }
642
+ ),
539
643
 
540
- transform: ({ addBase, addUtilities }) => {
541
- addBase({
542
- '@defaults transform': {
543
- '--tw-translate-x': '0',
544
- '--tw-translate-y': '0',
545
- '--tw-rotate': '0',
546
- '--tw-skew-x': '0',
547
- '--tw-skew-y': '0',
548
- '--tw-scale-x': '1',
549
- '--tw-scale-y': '1',
550
- '--tw-transform': [
551
- 'translateX(var(--tw-translate-x))',
552
- 'translateY(var(--tw-translate-y))',
553
- 'rotate(var(--tw-rotate))',
554
- 'skewX(var(--tw-skew-x))',
555
- 'skewY(var(--tw-skew-y))',
556
- 'scaleX(var(--tw-scale-x))',
557
- 'scaleY(var(--tw-scale-y))',
558
- ].join(' '),
559
- },
560
- })
561
- addUtilities({
562
- '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
644
+ transform: ({ addDefaults, addUtilities }) => {
645
+ addDefaults('transform', {
646
+ '--tw-translate-x': '0',
647
+ '--tw-translate-y': '0',
648
+ '--tw-rotate': '0',
649
+ '--tw-skew-x': '0',
650
+ '--tw-skew-y': '0',
651
+ '--tw-scale-x': '1',
652
+ '--tw-scale-y': '1',
653
+ })
654
+
655
+ addUtilities({
656
+ '.transform': { '@defaults transform': {}, transform: cssTransformValue },
563
657
  '.transform-cpu': {
564
- '--tw-transform': [
565
- 'translateX(var(--tw-translate-x))',
566
- 'translateY(var(--tw-translate-y))',
567
- 'rotate(var(--tw-rotate))',
568
- 'skewX(var(--tw-skew-x))',
569
- 'skewY(var(--tw-skew-y))',
570
- 'scaleX(var(--tw-scale-x))',
571
- 'scaleY(var(--tw-scale-y))',
572
- ].join(' '),
658
+ transform: cssTransformValue,
573
659
  },
574
660
  '.transform-gpu': {
575
- '--tw-transform': [
576
- 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)',
577
- 'rotate(var(--tw-rotate))',
578
- 'skewX(var(--tw-skew-x))',
579
- 'skewY(var(--tw-skew-y))',
580
- 'scaleX(var(--tw-scale-x))',
581
- 'scaleY(var(--tw-scale-y))',
582
- ].join(' '),
661
+ transform: cssTransformValue.replace(
662
+ 'translate(var(--tw-translate-x), var(--tw-translate-y))',
663
+ 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
664
+ ),
583
665
  },
584
666
  '.transform-none': { transform: 'none' },
585
667
  })
586
668
  },
587
669
 
588
- animation: ({ matchUtilities, theme, prefix }) => {
589
- let prefixName = (name) => prefix(`.${name}`).slice(1)
670
+ animation: ({ matchUtilities, theme, config }) => {
671
+ let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
590
672
  let keyframes = Object.fromEntries(
591
673
  Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
592
674
  return [key, { [`@keyframes ${prefixName(key)}`]: value }]
@@ -619,17 +701,53 @@ export let corePlugins = {
619
701
 
620
702
  cursor: createUtilityPlugin('cursor'),
621
703
 
622
- touchAction: ({ addUtilities }) => {
704
+ touchAction: ({ addDefaults, addUtilities }) => {
705
+ addDefaults('touch-action', {
706
+ '--tw-pan-x': ' ',
707
+ '--tw-pan-y': ' ',
708
+ '--tw-pinch-zoom': ' ',
709
+ })
710
+
711
+ let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
712
+
623
713
  addUtilities({
624
714
  '.touch-auto': { 'touch-action': 'auto' },
625
715
  '.touch-none': { 'touch-action': 'none' },
626
- '.touch-pan-x': { 'touch-action': 'pan-x' },
627
- '.touch-pan-left': { 'touch-action': 'pan-left' },
628
- '.touch-pan-right': { 'touch-action': 'pan-right' },
629
- '.touch-pan-y': { 'touch-action': 'pan-y' },
630
- '.touch-pan-up': { 'touch-action': 'pan-up' },
631
- '.touch-pan-down': { 'touch-action': 'pan-down' },
632
- '.touch-pinch-zoom': { 'touch-action': 'pinch-zoom' },
716
+ '.touch-pan-x': {
717
+ '@defaults touch-action': {},
718
+ '--tw-pan-x': 'pan-x',
719
+ 'touch-action': cssTouchActionValue,
720
+ },
721
+ '.touch-pan-left': {
722
+ '@defaults touch-action': {},
723
+ '--tw-pan-x': 'pan-left',
724
+ 'touch-action': cssTouchActionValue,
725
+ },
726
+ '.touch-pan-right': {
727
+ '@defaults touch-action': {},
728
+ '--tw-pan-x': 'pan-right',
729
+ 'touch-action': cssTouchActionValue,
730
+ },
731
+ '.touch-pan-y': {
732
+ '@defaults touch-action': {},
733
+ '--tw-pan-y': 'pan-y',
734
+ 'touch-action': cssTouchActionValue,
735
+ },
736
+ '.touch-pan-up': {
737
+ '@defaults touch-action': {},
738
+ '--tw-pan-y': 'pan-up',
739
+ 'touch-action': cssTouchActionValue,
740
+ },
741
+ '.touch-pan-down': {
742
+ '@defaults touch-action': {},
743
+ '--tw-pan-y': 'pan-down',
744
+ 'touch-action': cssTouchActionValue,
745
+ },
746
+ '.touch-pinch-zoom': {
747
+ '@defaults touch-action': {},
748
+ '--tw-pinch-zoom': 'pinch-zoom',
749
+ 'touch-action': cssTouchActionValue,
750
+ },
633
751
  '.touch-manipulation': { 'touch-action': 'manipulation' },
634
752
  })
635
753
  },
@@ -652,11 +770,9 @@ export let corePlugins = {
652
770
  })
653
771
  },
654
772
 
655
- scrollSnapType: ({ addUtilities, addBase }) => {
656
- addBase({
657
- '@defaults scroll-snap-type': {
658
- '--tw-scroll-snap-strictness': 'proximity',
659
- },
773
+ scrollSnapType: ({ addDefaults, addUtilities }) => {
774
+ addDefaults('scroll-snap-type', {
775
+ '--tw-scroll-snap-strictness': 'proximity',
660
776
  })
661
777
 
662
778
  addUtilities({
@@ -784,6 +900,7 @@ export let corePlugins = {
784
900
  addUtilities({
785
901
  '.grid-flow-row': { gridAutoFlow: 'row' },
786
902
  '.grid-flow-col': { gridAutoFlow: 'column' },
903
+ '.grid-flow-dense': { gridAutoFlow: 'dense' },
787
904
  '.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
788
905
  '.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
789
906
  })
@@ -1153,24 +1270,7 @@ export let corePlugins = {
1153
1270
  })
1154
1271
  },
1155
1272
 
1156
- borderColor: ({ addBase, matchUtilities, theme, corePlugins }) => {
1157
- if (!corePlugins('borderOpacity')) {
1158
- let value = theme('borderColor.DEFAULT', 'currentColor')
1159
- addBase({
1160
- '@defaults border-width': {
1161
- 'border-color': toColorValue(value),
1162
- },
1163
- })
1164
- } else {
1165
- addBase({
1166
- '@defaults border-width': withAlphaVariable({
1167
- color: theme('borderColor.DEFAULT', 'currentColor'),
1168
- property: 'border-color',
1169
- variable: '--tw-border-opacity',
1170
- }),
1171
- })
1172
- }
1173
-
1273
+ borderColor: ({ matchUtilities, theme, corePlugins }) => {
1174
1274
  matchUtilities(
1175
1275
  {
1176
1276
  border: (value) => {
@@ -1341,7 +1441,8 @@ export let corePlugins = {
1341
1441
 
1342
1442
  return {
1343
1443
  '--tw-gradient-from': toColorValue(value, 'from'),
1344
- '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`,
1444
+ '--tw-gradient-to': transparentToValue,
1445
+ '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
1345
1446
  }
1346
1447
  },
1347
1448
  },
@@ -1353,10 +1454,11 @@ export let corePlugins = {
1353
1454
  let transparentToValue = transparentTo(value)
1354
1455
 
1355
1456
  return {
1457
+ '--tw-gradient-to': transparentToValue,
1356
1458
  '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
1357
1459
  value,
1358
1460
  'via'
1359
- )}, var(--tw-gradient-to, ${transparentToValue})`,
1461
+ )}, var(--tw-gradient-to)`,
1360
1462
  }
1361
1463
  },
1362
1464
  },
@@ -1371,8 +1473,10 @@ export let corePlugins = {
1371
1473
 
1372
1474
  boxDecorationBreak: ({ addUtilities }) => {
1373
1475
  addUtilities({
1374
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1375
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1476
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1477
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1478
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1479
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1376
1480
  })
1377
1481
  },
1378
1482
 
@@ -1477,6 +1581,8 @@ export let corePlugins = {
1477
1581
  '.text-center': { 'text-align': 'center' },
1478
1582
  '.text-right': { 'text-align': 'right' },
1479
1583
  '.text-justify': { 'text-align': 'justify' },
1584
+ '.text-start': { 'text-align': 'start' },
1585
+ '.text-end': { 'text-align': 'end' },
1480
1586
  })
1481
1587
  },
1482
1588
 
@@ -1499,16 +1605,35 @@ export let corePlugins = {
1499
1605
  matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
1500
1606
  },
1501
1607
 
1502
- fontFamily: createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
1503
- type: ['lookup', 'generic-name', 'family-name'],
1504
- }),
1608
+ fontFamily: ({ matchUtilities, theme }) => {
1609
+ matchUtilities(
1610
+ {
1611
+ font: (value) => {
1612
+ let [families, options = {}] =
1613
+ Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
1614
+ let { fontFeatureSettings } = options
1615
+
1616
+ return {
1617
+ 'font-family': Array.isArray(families) ? families.join(', ') : families,
1618
+ ...(fontFeatureSettings === undefined
1619
+ ? {}
1620
+ : { 'font-feature-settings': fontFeatureSettings }),
1621
+ }
1622
+ },
1623
+ },
1624
+ {
1625
+ values: theme('fontFamily'),
1626
+ type: ['lookup', 'generic-name', 'family-name'],
1627
+ }
1628
+ )
1629
+ },
1505
1630
 
1506
1631
  fontSize: ({ matchUtilities, theme }) => {
1507
1632
  matchUtilities(
1508
1633
  {
1509
1634
  text: (value) => {
1510
1635
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1511
- let { lineHeight, letterSpacing } = isPlainObject(options)
1636
+ let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1512
1637
  ? options
1513
1638
  : { lineHeight: options }
1514
1639
 
@@ -1516,6 +1641,7 @@ export let corePlugins = {
1516
1641
  'font-size': fontSize,
1517
1642
  ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
1518
1643
  ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
1644
+ ...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
1519
1645
  }
1520
1646
  },
1521
1647
  },
@@ -1546,57 +1672,59 @@ export let corePlugins = {
1546
1672
  })
1547
1673
  },
1548
1674
 
1549
- fontVariantNumeric: ({ addUtilities }) => {
1675
+ fontVariantNumeric: ({ addDefaults, addUtilities }) => {
1676
+ let cssFontVariantNumericValue =
1677
+ 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
1678
+
1679
+ addDefaults('font-variant-numeric', {
1680
+ '--tw-ordinal': ' ',
1681
+ '--tw-slashed-zero': ' ',
1682
+ '--tw-numeric-figure': ' ',
1683
+ '--tw-numeric-spacing': ' ',
1684
+ '--tw-numeric-fraction': ' ',
1685
+ })
1686
+
1550
1687
  addUtilities({
1551
- '@defaults font-variant-numeric': {
1552
- '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
1553
- '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
1554
- '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
1555
- '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
1556
- '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
1557
- '--tw-font-variant-numeric':
1558
- 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
1559
- },
1560
1688
  '.normal-nums': { 'font-variant-numeric': 'normal' },
1561
1689
  '.ordinal': {
1562
1690
  '@defaults font-variant-numeric': {},
1563
1691
  '--tw-ordinal': 'ordinal',
1564
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1692
+ 'font-variant-numeric': cssFontVariantNumericValue,
1565
1693
  },
1566
1694
  '.slashed-zero': {
1567
1695
  '@defaults font-variant-numeric': {},
1568
1696
  '--tw-slashed-zero': 'slashed-zero',
1569
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1697
+ 'font-variant-numeric': cssFontVariantNumericValue,
1570
1698
  },
1571
1699
  '.lining-nums': {
1572
1700
  '@defaults font-variant-numeric': {},
1573
1701
  '--tw-numeric-figure': 'lining-nums',
1574
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1702
+ 'font-variant-numeric': cssFontVariantNumericValue,
1575
1703
  },
1576
1704
  '.oldstyle-nums': {
1577
1705
  '@defaults font-variant-numeric': {},
1578
1706
  '--tw-numeric-figure': 'oldstyle-nums',
1579
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1707
+ 'font-variant-numeric': cssFontVariantNumericValue,
1580
1708
  },
1581
1709
  '.proportional-nums': {
1582
1710
  '@defaults font-variant-numeric': {},
1583
1711
  '--tw-numeric-spacing': 'proportional-nums',
1584
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1712
+ 'font-variant-numeric': cssFontVariantNumericValue,
1585
1713
  },
1586
1714
  '.tabular-nums': {
1587
1715
  '@defaults font-variant-numeric': {},
1588
1716
  '--tw-numeric-spacing': 'tabular-nums',
1589
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1717
+ 'font-variant-numeric': cssFontVariantNumericValue,
1590
1718
  },
1591
1719
  '.diagonal-fractions': {
1592
1720
  '@defaults font-variant-numeric': {},
1593
1721
  '--tw-numeric-fraction': 'diagonal-fractions',
1594
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1722
+ 'font-variant-numeric': cssFontVariantNumericValue,
1595
1723
  },
1596
1724
  '.stacked-fractions': {
1597
1725
  '@defaults font-variant-numeric': {},
1598
1726
  '--tw-numeric-fraction': 'stacked-fractions',
1599
- 'font-variant-numeric': 'var(--tw-font-variant-numeric)',
1727
+ 'font-variant-numeric': cssFontVariantNumericValue,
1600
1728
  },
1601
1729
  })
1602
1730
  },
@@ -1629,9 +1757,10 @@ export let corePlugins = {
1629
1757
 
1630
1758
  textDecoration: ({ addUtilities }) => {
1631
1759
  addUtilities({
1632
- '.underline': { 'text-decoration': 'underline' },
1633
- '.line-through': { 'text-decoration': 'line-through' },
1634
- '.no-underline': { 'text-decoration': 'none' },
1760
+ '.underline': { 'text-decoration-line': 'underline' },
1761
+ '.overline': { 'text-decoration-line': 'overline' },
1762
+ '.line-through': { 'text-decoration-line': 'line-through' },
1763
+ '.no-underline': { 'text-decoration-line': 'none' },
1635
1764
  })
1636
1765
  },
1637
1766
 
@@ -1642,10 +1771,32 @@ export let corePlugins = {
1642
1771
  return { 'text-decoration-color': toColorValue(value) }
1643
1772
  },
1644
1773
  },
1645
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1774
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
1646
1775
  )
1647
1776
  },
1648
1777
 
1778
+ textDecorationStyle: ({ addUtilities }) => {
1779
+ addUtilities({
1780
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1781
+ '.decoration-double': { 'text-decoration-style': 'double' },
1782
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1783
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1784
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1785
+ })
1786
+ },
1787
+
1788
+ textDecorationThickness: createUtilityPlugin(
1789
+ 'textDecorationThickness',
1790
+ [['decoration', ['text-decoration-thickness']]],
1791
+ { type: ['length', 'percentage'] }
1792
+ ),
1793
+
1794
+ textUnderlineOffset: createUtilityPlugin(
1795
+ 'textUnderlineOffset',
1796
+ [['underline-offset', ['text-underline-offset']]],
1797
+ { type: ['length', 'percentage'] }
1798
+ ),
1799
+
1649
1800
  fontSmoothing: ({ addUtilities }) => {
1650
1801
  addUtilities({
1651
1802
  '.antialiased': {
@@ -1758,6 +1909,7 @@ export let corePlugins = {
1758
1909
  '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
1759
1910
  '.mix-blend-color': { 'mix-blend-mode': 'color' },
1760
1911
  '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
1912
+ '.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
1761
1913
  })
1762
1914
  },
1763
1915
 
@@ -1769,14 +1921,12 @@ export let corePlugins = {
1769
1921
  `var(--tw-shadow)`,
1770
1922
  ].join(', ')
1771
1923
 
1772
- return function ({ matchUtilities, addBase, theme }) {
1773
- addBase({
1774
- '@defaults box-shadow': {
1775
- '--tw-ring-offset-shadow': '0 0 #0000',
1776
- '--tw-ring-shadow': '0 0 #0000',
1777
- '--tw-shadow': '0 0 #0000',
1778
- '--tw-shadow-colored': '0 0 #0000',
1779
- },
1924
+ return function ({ matchUtilities, addDefaults, theme }) {
1925
+ addDefaults(' box-shadow', {
1926
+ '--tw-ring-offset-shadow': '0 0 #0000',
1927
+ '--tw-ring-shadow': '0 0 #0000',
1928
+ '--tw-shadow': '0 0 #0000',
1929
+ '--tw-shadow-colored': '0 0 #0000',
1780
1930
  })
1781
1931
 
1782
1932
  matchUtilities(
@@ -1831,7 +1981,6 @@ export let corePlugins = {
1831
1981
  '.outline-dashed': { 'outline-style': 'dashed' },
1832
1982
  '.outline-dotted': { 'outline-style': 'dotted' },
1833
1983
  '.outline-double': { 'outline-style': 'double' },
1834
- '.outline-hidden': { 'outline-style': 'hidden' },
1835
1984
  })
1836
1985
  },
1837
1986
 
@@ -1841,6 +1990,7 @@ export let corePlugins = {
1841
1990
 
1842
1991
  outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
1843
1992
  type: ['length', 'number', 'percentage'],
1993
+ supportsNegativeValues: true,
1844
1994
  }),
1845
1995
 
1846
1996
  outlineColor: ({ matchUtilities, theme }) => {
@@ -1854,25 +2004,34 @@ export let corePlugins = {
1854
2004
  )
1855
2005
  },
1856
2006
 
1857
- ringWidth: ({ matchUtilities, addBase, addUtilities, theme }) => {
1858
- let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
1859
- let ringColorDefault = withAlphaValue(
1860
- theme('ringColor.DEFAULT'),
1861
- ringOpacityDefault,
1862
- `rgb(147 197 253 / ${ringOpacityDefault})`
1863
- )
2007
+ ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
2008
+ let ringColorDefault = (() => {
2009
+ if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
2010
+ return theme('ringColor.DEFAULT')
2011
+ }
1864
2012
 
1865
- addBase({
1866
- '@defaults ring-width': {
1867
- '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
1868
- '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
1869
- '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
1870
- '--tw-ring-color': ringColorDefault,
1871
- '--tw-ring-offset-shadow': '0 0 #0000',
1872
- '--tw-ring-shadow': '0 0 #0000',
1873
- '--tw-shadow': '0 0 #0000',
1874
- '--tw-shadow-colored': '0 0 #0000',
1875
- },
2013
+ let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
2014
+
2015
+ if (!theme('ringColor')?.DEFAULT) {
2016
+ return `rgb(147 197 253 / ${ringOpacityDefault})`
2017
+ }
2018
+
2019
+ return withAlphaValue(
2020
+ theme('ringColor')?.DEFAULT,
2021
+ ringOpacityDefault,
2022
+ `rgb(147 197 253 / ${ringOpacityDefault})`
2023
+ )
2024
+ })()
2025
+
2026
+ addDefaults('ring-width', {
2027
+ '--tw-ring-inset': ' ',
2028
+ '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
2029
+ '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
2030
+ '--tw-ring-color': ringColorDefault,
2031
+ '--tw-ring-offset-shadow': '0 0 #0000',
2032
+ '--tw-ring-shadow': '0 0 #0000',
2033
+ '--tw-shadow': '0 0 #0000',
2034
+ '--tw-shadow-colored': '0 0 #0000',
1876
2035
  })
1877
2036
 
1878
2037
  matchUtilities(
@@ -1898,10 +2057,16 @@ export let corePlugins = {
1898
2057
  })
1899
2058
  },
1900
2059
 
1901
- ringColor: ({ matchUtilities, theme }) => {
2060
+ ringColor: ({ matchUtilities, theme, corePlugins }) => {
1902
2061
  matchUtilities(
1903
2062
  {
1904
2063
  ring: (value) => {
2064
+ if (!corePlugins('ringOpacity')) {
2065
+ return {
2066
+ '--tw-ring-color': toColorValue(value),
2067
+ }
2068
+ }
2069
+
1905
2070
  return withAlphaVariable({
1906
2071
  color: value,
1907
2072
  property: '--tw-ring-color',
@@ -1920,9 +2085,13 @@ export let corePlugins = {
1920
2085
  )
1921
2086
  },
1922
2087
 
1923
- ringOpacity: createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
1924
- filterDefault: true,
1925
- }),
2088
+ ringOpacity: (helpers) => {
2089
+ let { config } = helpers
2090
+
2091
+ return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
2092
+ filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
2093
+ })(helpers)
2094
+ },
1926
2095
  ringOffsetWidth: createUtilityPlugin(
1927
2096
  'ringOffsetWidth',
1928
2097
  [['ring-offset', ['--tw-ring-offset-width']]],
@@ -1949,7 +2118,7 @@ export let corePlugins = {
1949
2118
  return {
1950
2119
  '--tw-blur': `blur(${value})`,
1951
2120
  '@defaults filter': {},
1952
- filter: 'var(--tw-filter)',
2121
+ filter: cssFilterValue,
1953
2122
  }
1954
2123
  },
1955
2124
  },
@@ -1964,7 +2133,7 @@ export let corePlugins = {
1964
2133
  return {
1965
2134
  '--tw-brightness': `brightness(${value})`,
1966
2135
  '@defaults filter': {},
1967
- filter: 'var(--tw-filter)',
2136
+ filter: cssFilterValue,
1968
2137
  }
1969
2138
  },
1970
2139
  },
@@ -1979,7 +2148,7 @@ export let corePlugins = {
1979
2148
  return {
1980
2149
  '--tw-contrast': `contrast(${value})`,
1981
2150
  '@defaults filter': {},
1982
- filter: 'var(--tw-filter)',
2151
+ filter: cssFilterValue,
1983
2152
  }
1984
2153
  },
1985
2154
  },
@@ -1996,7 +2165,7 @@ export let corePlugins = {
1996
2165
  ? value.map((v) => `drop-shadow(${v})`).join(' ')
1997
2166
  : `drop-shadow(${value})`,
1998
2167
  '@defaults filter': {},
1999
- filter: 'var(--tw-filter)',
2168
+ filter: cssFilterValue,
2000
2169
  }
2001
2170
  },
2002
2171
  },
@@ -2011,7 +2180,7 @@ export let corePlugins = {
2011
2180
  return {
2012
2181
  '--tw-grayscale': `grayscale(${value})`,
2013
2182
  '@defaults filter': {},
2014
- filter: 'var(--tw-filter)',
2183
+ filter: cssFilterValue,
2015
2184
  }
2016
2185
  },
2017
2186
  },
@@ -2026,7 +2195,7 @@ export let corePlugins = {
2026
2195
  return {
2027
2196
  '--tw-hue-rotate': `hue-rotate(${value})`,
2028
2197
  '@defaults filter': {},
2029
- filter: 'var(--tw-filter)',
2198
+ filter: cssFilterValue,
2030
2199
  }
2031
2200
  },
2032
2201
  },
@@ -2041,7 +2210,7 @@ export let corePlugins = {
2041
2210
  return {
2042
2211
  '--tw-invert': `invert(${value})`,
2043
2212
  '@defaults filter': {},
2044
- filter: 'var(--tw-filter)',
2213
+ filter: cssFilterValue,
2045
2214
  }
2046
2215
  },
2047
2216
  },
@@ -2056,7 +2225,7 @@ export let corePlugins = {
2056
2225
  return {
2057
2226
  '--tw-saturate': `saturate(${value})`,
2058
2227
  '@defaults filter': {},
2059
- filter: 'var(--tw-filter)',
2228
+ filter: cssFilterValue,
2060
2229
  }
2061
2230
  },
2062
2231
  },
@@ -2071,7 +2240,7 @@ export let corePlugins = {
2071
2240
  return {
2072
2241
  '--tw-sepia': `sepia(${value})`,
2073
2242
  '@defaults filter': {},
2074
- filter: 'var(--tw-filter)',
2243
+ filter: cssFilterValue,
2075
2244
  }
2076
2245
  },
2077
2246
  },
@@ -2079,33 +2248,20 @@ export let corePlugins = {
2079
2248
  )
2080
2249
  },
2081
2250
 
2082
- filter: ({ addBase, addUtilities }) => {
2083
- addBase({
2084
- '@defaults filter': {
2085
- '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2086
- '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2087
- '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2088
- '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2089
- '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2090
- '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2091
- '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2092
- '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2093
- '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)',
2094
- '--tw-filter': [
2095
- 'var(--tw-blur)',
2096
- 'var(--tw-brightness)',
2097
- 'var(--tw-contrast)',
2098
- 'var(--tw-grayscale)',
2099
- 'var(--tw-hue-rotate)',
2100
- 'var(--tw-invert)',
2101
- 'var(--tw-saturate)',
2102
- 'var(--tw-sepia)',
2103
- 'var(--tw-drop-shadow)',
2104
- ].join(' '),
2105
- },
2106
- })
2107
- addUtilities({
2108
- '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
2251
+ filter: ({ addDefaults, addUtilities }) => {
2252
+ addDefaults('filter', {
2253
+ '--tw-blur': ' ',
2254
+ '--tw-brightness': ' ',
2255
+ '--tw-contrast': ' ',
2256
+ '--tw-grayscale': ' ',
2257
+ '--tw-hue-rotate': ' ',
2258
+ '--tw-invert': ' ',
2259
+ '--tw-saturate': ' ',
2260
+ '--tw-sepia': ' ',
2261
+ '--tw-drop-shadow': ' ',
2262
+ })
2263
+ addUtilities({
2264
+ '.filter': { '@defaults filter': {}, filter: cssFilterValue },
2109
2265
  '.filter-none': { filter: 'none' },
2110
2266
  })
2111
2267
  },
@@ -2117,7 +2273,7 @@ export let corePlugins = {
2117
2273
  return {
2118
2274
  '--tw-backdrop-blur': `blur(${value})`,
2119
2275
  '@defaults backdrop-filter': {},
2120
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2276
+ 'backdrop-filter': cssBackdropFilterValue,
2121
2277
  }
2122
2278
  },
2123
2279
  },
@@ -2132,7 +2288,7 @@ export let corePlugins = {
2132
2288
  return {
2133
2289
  '--tw-backdrop-brightness': `brightness(${value})`,
2134
2290
  '@defaults backdrop-filter': {},
2135
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2291
+ 'backdrop-filter': cssBackdropFilterValue,
2136
2292
  }
2137
2293
  },
2138
2294
  },
@@ -2147,7 +2303,7 @@ export let corePlugins = {
2147
2303
  return {
2148
2304
  '--tw-backdrop-contrast': `contrast(${value})`,
2149
2305
  '@defaults backdrop-filter': {},
2150
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2306
+ 'backdrop-filter': cssBackdropFilterValue,
2151
2307
  }
2152
2308
  },
2153
2309
  },
@@ -2162,7 +2318,7 @@ export let corePlugins = {
2162
2318
  return {
2163
2319
  '--tw-backdrop-grayscale': `grayscale(${value})`,
2164
2320
  '@defaults backdrop-filter': {},
2165
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2321
+ 'backdrop-filter': cssBackdropFilterValue,
2166
2322
  }
2167
2323
  },
2168
2324
  },
@@ -2177,7 +2333,7 @@ export let corePlugins = {
2177
2333
  return {
2178
2334
  '--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
2179
2335
  '@defaults backdrop-filter': {},
2180
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2336
+ 'backdrop-filter': cssBackdropFilterValue,
2181
2337
  }
2182
2338
  },
2183
2339
  },
@@ -2192,7 +2348,7 @@ export let corePlugins = {
2192
2348
  return {
2193
2349
  '--tw-backdrop-invert': `invert(${value})`,
2194
2350
  '@defaults backdrop-filter': {},
2195
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2351
+ 'backdrop-filter': cssBackdropFilterValue,
2196
2352
  }
2197
2353
  },
2198
2354
  },
@@ -2207,7 +2363,7 @@ export let corePlugins = {
2207
2363
  return {
2208
2364
  '--tw-backdrop-opacity': `opacity(${value})`,
2209
2365
  '@defaults backdrop-filter': {},
2210
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2366
+ 'backdrop-filter': cssBackdropFilterValue,
2211
2367
  }
2212
2368
  },
2213
2369
  },
@@ -2222,7 +2378,7 @@ export let corePlugins = {
2222
2378
  return {
2223
2379
  '--tw-backdrop-saturate': `saturate(${value})`,
2224
2380
  '@defaults backdrop-filter': {},
2225
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2381
+ 'backdrop-filter': cssBackdropFilterValue,
2226
2382
  }
2227
2383
  },
2228
2384
  },
@@ -2237,7 +2393,7 @@ export let corePlugins = {
2237
2393
  return {
2238
2394
  '--tw-backdrop-sepia': `sepia(${value})`,
2239
2395
  '@defaults backdrop-filter': {},
2240
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2396
+ 'backdrop-filter': cssBackdropFilterValue,
2241
2397
  }
2242
2398
  },
2243
2399
  },
@@ -2245,35 +2401,22 @@ export let corePlugins = {
2245
2401
  )
2246
2402
  },
2247
2403
 
2248
- backdropFilter: ({ addBase, addUtilities }) => {
2249
- addBase({
2250
- '@defaults backdrop-filter': {
2251
- '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)',
2252
- '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)',
2253
- '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)',
2254
- '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)',
2255
- '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)',
2256
- '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)',
2257
- '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)',
2258
- '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)',
2259
- '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
2260
- '--tw-backdrop-filter': [
2261
- 'var(--tw-backdrop-blur)',
2262
- 'var(--tw-backdrop-brightness)',
2263
- 'var(--tw-backdrop-contrast)',
2264
- 'var(--tw-backdrop-grayscale)',
2265
- 'var(--tw-backdrop-hue-rotate)',
2266
- 'var(--tw-backdrop-invert)',
2267
- 'var(--tw-backdrop-opacity)',
2268
- 'var(--tw-backdrop-saturate)',
2269
- 'var(--tw-backdrop-sepia)',
2270
- ].join(' '),
2271
- },
2404
+ backdropFilter: ({ addDefaults, addUtilities }) => {
2405
+ addDefaults('backdrop-filter', {
2406
+ '--tw-backdrop-blur': ' ',
2407
+ '--tw-backdrop-brightness': ' ',
2408
+ '--tw-backdrop-contrast': ' ',
2409
+ '--tw-backdrop-grayscale': ' ',
2410
+ '--tw-backdrop-hue-rotate': ' ',
2411
+ '--tw-backdrop-invert': ' ',
2412
+ '--tw-backdrop-opacity': ' ',
2413
+ '--tw-backdrop-saturate': ' ',
2414
+ '--tw-backdrop-sepia': ' ',
2272
2415
  })
2273
2416
  addUtilities({
2274
2417
  '.backdrop-filter': {
2275
2418
  '@defaults backdrop-filter': {},
2276
- 'backdrop-filter': 'var(--tw-backdrop-filter)',
2419
+ 'backdrop-filter': cssBackdropFilterValue,
2277
2420
  },
2278
2421
  '.backdrop-filter-none': { 'backdrop-filter': 'none' },
2279
2422
  })