tailwindcss 0.0.0-insiders.89bf2ed → 0.0.0-insiders.89cbfc7

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