tailwindcss 0.0.0-oxide-insiders.9ebaaac → 0.0.0-oxide.1

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