tailwindcss 0.0.0-insiders.bdc87ae → 0.0.0-insiders.bdcd708

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