tailwindcss 0.0.0-insiders.ebc1c7a → 0.0.0-insiders.ec0049a

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