tailwindcss 0.0.0-insiders.d2bb6f1 → 0.0.0-insiders.d2fdddf

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