tailwindcss 0.0.0-insiders.ff2c25f → 0.0.0-internal.b2586d4e

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