tailwindcss 0.0.0-insiders.eebf529 → 0.0.0-insiders.eec1bf2

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