tailwindcss 0.0.0-insiders.bd4dddd → 0.0.0-insiders.bda8421
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.
- package/LICENSE +1 -2
- package/README.md +13 -10
- package/colors.d.ts +3 -0
- package/defaultConfig.d.ts +3 -0
- package/defaultTheme.d.ts +4 -0
- package/lib/cli/build/deps.js +62 -0
- package/lib/cli/build/index.js +54 -0
- package/lib/cli/build/plugin.js +371 -0
- package/lib/cli/build/utils.js +88 -0
- package/lib/cli/build/watching.js +182 -0
- package/lib/cli/help/index.js +73 -0
- package/lib/cli/index.js +230 -0
- package/lib/cli/init/index.js +63 -0
- package/lib/cli-peer-dependencies.js +28 -7
- package/lib/cli.js +1 -741
- package/lib/corePluginList.js +17 -4
- package/lib/corePlugins.js +2503 -1839
- package/lib/css/preflight.css +32 -13
- package/lib/featureFlags.js +45 -28
- package/lib/index.js +1 -29
- package/lib/lib/cacheInvalidation.js +92 -0
- package/lib/lib/collapseAdjacentRules.js +30 -10
- package/lib/lib/collapseDuplicateDeclarations.js +13 -8
- package/lib/lib/content.js +214 -0
- package/lib/lib/defaultExtractor.js +240 -31
- package/lib/lib/evaluateTailwindFunctions.js +117 -50
- package/lib/lib/expandApplyAtRules.js +466 -230
- package/lib/lib/expandTailwindAtRules.js +156 -135
- package/lib/lib/findAtConfigPath.js +46 -0
- package/lib/lib/generateRules.js +554 -200
- package/lib/lib/getModuleDependencies.js +88 -37
- package/lib/lib/load-config.js +57 -0
- package/lib/lib/normalizeTailwindDirectives.js +39 -33
- package/lib/lib/offsets.js +355 -0
- package/lib/lib/partitionApplyAtRules.js +58 -0
- package/lib/lib/regex.js +74 -0
- package/lib/lib/remap-bitfield.js +89 -0
- package/lib/lib/resolveDefaultsAtRules.js +97 -69
- package/lib/lib/setupContextUtils.js +796 -341
- package/lib/lib/setupTrackingContext.js +66 -71
- package/lib/lib/sharedState.js +45 -14
- package/lib/lib/substituteScreenAtRules.js +14 -10
- package/lib/plugin.js +48 -0
- package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
- package/lib/postcss-plugins/nesting/index.js +21 -0
- package/lib/postcss-plugins/nesting/plugin.js +89 -0
- package/lib/processTailwindFeatures.js +37 -27
- package/lib/public/colors.js +272 -246
- package/lib/public/create-plugin.js +9 -5
- package/lib/public/default-config.js +10 -6
- package/lib/public/default-theme.js +10 -6
- package/lib/public/load-config.js +12 -0
- package/lib/public/resolve-config.js +11 -6
- package/lib/util/applyImportantSelector.js +36 -0
- package/lib/util/bigSign.js +6 -1
- package/lib/util/buildMediaQuery.js +13 -6
- package/lib/util/cloneDeep.js +9 -6
- package/lib/util/cloneNodes.js +44 -4
- package/lib/util/color.js +70 -53
- package/lib/util/colorNames.js +752 -0
- package/lib/util/configurePlugins.js +7 -2
- package/lib/util/createPlugin.js +8 -6
- package/lib/util/createUtilityPlugin.js +16 -16
- package/lib/util/dataTypes.js +295 -113
- package/lib/util/defaults.js +12 -7
- package/lib/util/escapeClassName.js +13 -8
- package/lib/util/escapeCommas.js +7 -2
- package/lib/util/flattenColorPalette.js +11 -12
- package/lib/util/formatVariantSelector.js +235 -151
- package/lib/util/getAllConfigs.js +33 -12
- package/lib/util/hashConfig.js +9 -4
- package/lib/util/isKeyframeRule.js +7 -2
- package/lib/util/isPlainObject.js +8 -3
- package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
- package/lib/util/log.js +25 -15
- package/lib/util/nameClass.js +27 -10
- package/lib/util/negateValue.js +25 -8
- package/lib/util/normalizeConfig.js +127 -82
- package/lib/util/normalizeScreens.js +128 -11
- package/lib/util/parseAnimationValue.js +44 -40
- package/lib/util/parseBoxShadowValue.js +34 -23
- package/lib/util/parseDependency.js +39 -55
- package/lib/util/parseGlob.js +36 -0
- package/lib/util/parseObjectStyles.js +15 -10
- package/lib/util/pluginUtils.js +172 -69
- package/lib/util/prefixSelector.js +30 -12
- package/lib/util/pseudoElements.js +212 -0
- package/lib/util/removeAlphaVariables.js +31 -0
- package/lib/util/resolveConfig.js +101 -87
- package/lib/util/resolveConfigPath.js +30 -12
- package/lib/util/responsive.js +11 -6
- package/lib/util/splitAtTopLevelOnly.js +51 -0
- package/lib/util/tap.js +6 -1
- package/lib/util/toColorValue.js +7 -3
- package/lib/util/toPath.js +22 -4
- package/lib/util/transformThemeValue.js +40 -30
- package/lib/util/validateConfig.js +37 -0
- package/lib/util/validateFormalSyntax.js +26 -0
- package/lib/util/withAlphaVariable.js +27 -15
- package/lib/value-parser/LICENSE +22 -0
- package/lib/value-parser/README.md +3 -0
- package/lib/value-parser/index.d.js +2 -0
- package/lib/value-parser/index.js +22 -0
- package/lib/value-parser/parse.js +259 -0
- package/lib/value-parser/stringify.js +38 -0
- package/lib/value-parser/unit.js +86 -0
- package/lib/value-parser/walk.js +16 -0
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/nesting/index.d.ts +4 -0
- package/nesting/index.js +2 -12
- package/package.json +60 -55
- package/peers/index.js +75503 -55095
- package/plugin.d.ts +11 -0
- package/resolveConfig.d.ts +31 -0
- package/scripts/generate-types.js +104 -0
- package/scripts/release-channel.js +18 -0
- package/scripts/release-notes.js +21 -0
- package/scripts/type-utils.js +27 -0
- package/src/cli/build/deps.js +56 -0
- package/src/cli/build/index.js +49 -0
- package/src/cli/build/plugin.js +437 -0
- package/src/cli/build/utils.js +76 -0
- package/src/cli/build/watching.js +229 -0
- package/src/cli/help/index.js +70 -0
- package/src/cli/index.js +216 -0
- package/src/cli/init/index.js +79 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +1 -811
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +849 -243
- package/src/css/preflight.css +32 -13
- package/src/featureFlags.js +13 -9
- package/src/index.js +1 -28
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +21 -2
- package/src/lib/content.js +249 -0
- package/src/lib/defaultExtractor.js +215 -33
- package/src/lib/evaluateTailwindFunctions.js +82 -8
- package/src/lib/expandApplyAtRules.js +512 -224
- package/src/lib/expandTailwindAtRules.js +102 -87
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +541 -146
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/load-config.ts +44 -0
- package/src/lib/normalizeTailwindDirectives.js +1 -0
- package/src/lib/offsets.js +432 -0
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/regex.js +74 -0
- package/src/lib/remap-bitfield.js +82 -0
- package/src/lib/resolveDefaultsAtRules.js +55 -30
- package/src/lib/setupContextUtils.js +720 -190
- package/src/lib/setupTrackingContext.js +47 -61
- package/src/lib/sharedState.js +15 -4
- package/src/plugin.js +47 -0
- package/src/postcss-plugins/nesting/README.md +42 -0
- package/src/postcss-plugins/nesting/index.js +13 -0
- package/src/postcss-plugins/nesting/plugin.js +80 -0
- package/src/processTailwindFeatures.js +11 -4
- package/src/public/colors.js +22 -0
- package/src/public/default-config.js +1 -1
- package/src/public/default-theme.js +2 -2
- package/src/public/load-config.js +2 -0
- package/src/util/applyImportantSelector.js +27 -0
- package/src/util/buildMediaQuery.js +5 -3
- package/src/util/cloneNodes.js +40 -2
- package/src/util/color.js +39 -20
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +184 -26
- package/src/util/formatVariantSelector.js +272 -144
- package/src/util/getAllConfigs.js +21 -2
- package/src/util/isPlainObject.js +1 -1
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +8 -8
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +11 -3
- package/src/util/normalizeConfig.js +45 -6
- package/src/util/normalizeScreens.js +99 -4
- package/src/util/parseBoxShadowValue.js +4 -3
- package/src/util/parseDependency.js +37 -42
- package/src/util/parseGlob.js +24 -0
- package/src/util/pluginUtils.js +139 -24
- package/src/util/prefixSelector.js +31 -10
- package/src/util/pseudoElements.js +171 -0
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +70 -32
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +52 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +26 -0
- package/src/util/validateFormalSyntax.js +34 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/src/value-parser/LICENSE +22 -0
- package/src/value-parser/README.md +3 -0
- package/src/value-parser/index.d.ts +177 -0
- package/src/value-parser/index.js +28 -0
- package/src/value-parser/parse.js +303 -0
- package/src/value-parser/stringify.js +41 -0
- package/src/value-parser/unit.js +118 -0
- package/src/value-parser/walk.js +18 -0
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +290 -178
- package/stubs/postcss.config.js +6 -0
- package/stubs/tailwind.config.cjs +2 -0
- package/stubs/tailwind.config.js +2 -0
- package/stubs/tailwind.config.ts +3 -0
- package/types/config.d.ts +376 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +298 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/generated/default-theme.d.ts +397 -0
- package/types/index.d.ts +11 -0
- package/CHANGELOG.md +0 -1959
- package/lib/constants.js +0 -37
- package/lib/lib/detectNesting.js +0 -34
- package/nesting/plugin.js +0 -41
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/constants.js +0 -17
- package/src/lib/detectNesting.js +0 -39
- /package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -0
- /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
package/src/corePlugins.js
CHANGED
|
@@ -3,6 +3,7 @@ import * as path from 'path'
|
|
|
3
3
|
import postcss from 'postcss'
|
|
4
4
|
import createUtilityPlugin from './util/createUtilityPlugin'
|
|
5
5
|
import buildMediaQuery from './util/buildMediaQuery'
|
|
6
|
+
import escapeClassName from './util/escapeClassName'
|
|
6
7
|
import parseAnimationValue from './util/parseAnimationValue'
|
|
7
8
|
import flattenColorPalette from './util/flattenColorPalette'
|
|
8
9
|
import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
|
|
@@ -11,21 +12,47 @@ import isPlainObject from './util/isPlainObject'
|
|
|
11
12
|
import transformThemeValue from './util/transformThemeValue'
|
|
12
13
|
import { version as tailwindVersion } from '../package.json'
|
|
13
14
|
import log from './util/log'
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
normalizeScreens,
|
|
17
|
+
isScreenSortable,
|
|
18
|
+
compareScreens,
|
|
19
|
+
toScreen,
|
|
20
|
+
} from './util/normalizeScreens'
|
|
15
21
|
import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
|
|
22
|
+
import { removeAlphaVariables } from './util/removeAlphaVariables'
|
|
23
|
+
import { flagEnabled } from './featureFlags'
|
|
24
|
+
import { normalize } from './util/dataTypes'
|
|
25
|
+
import { INTERNAL_FEATURES } from './lib/setupContextUtils'
|
|
16
26
|
|
|
17
27
|
export let variantPlugins = {
|
|
28
|
+
childVariant: ({ addVariant }) => {
|
|
29
|
+
addVariant('*', '& > *')
|
|
30
|
+
},
|
|
18
31
|
pseudoElementVariants: ({ addVariant }) => {
|
|
19
32
|
addVariant('first-letter', '&::first-letter')
|
|
20
33
|
addVariant('first-line', '&::first-line')
|
|
21
34
|
|
|
22
|
-
addVariant('marker', [
|
|
35
|
+
addVariant('marker', [
|
|
36
|
+
({ container }) => {
|
|
37
|
+
removeAlphaVariables(container, ['--tw-text-opacity'])
|
|
38
|
+
|
|
39
|
+
return '& *::marker'
|
|
40
|
+
},
|
|
41
|
+
({ container }) => {
|
|
42
|
+
removeAlphaVariables(container, ['--tw-text-opacity'])
|
|
43
|
+
|
|
44
|
+
return '&::marker'
|
|
45
|
+
},
|
|
46
|
+
])
|
|
47
|
+
|
|
23
48
|
addVariant('selection', ['& *::selection', '&::selection'])
|
|
24
49
|
|
|
25
50
|
addVariant('file', '&::file-selector-button')
|
|
26
51
|
|
|
27
52
|
addVariant('placeholder', '&::placeholder')
|
|
28
53
|
|
|
54
|
+
addVariant('backdrop', '&::backdrop')
|
|
55
|
+
|
|
29
56
|
addVariant('before', ({ container }) => {
|
|
30
57
|
container.walkRules((rule) => {
|
|
31
58
|
let foundContent = false
|
|
@@ -57,22 +84,33 @@ export let variantPlugins = {
|
|
|
57
84
|
})
|
|
58
85
|
},
|
|
59
86
|
|
|
60
|
-
pseudoClassVariants: ({ addVariant }) => {
|
|
87
|
+
pseudoClassVariants: ({ addVariant, matchVariant, config, prefix }) => {
|
|
61
88
|
let pseudoVariants = [
|
|
62
89
|
// Positional
|
|
63
|
-
['first', '
|
|
64
|
-
['last', '
|
|
65
|
-
['only', '
|
|
66
|
-
['odd', '
|
|
67
|
-
['even', '
|
|
90
|
+
['first', '&:first-child'],
|
|
91
|
+
['last', '&:last-child'],
|
|
92
|
+
['only', '&:only-child'],
|
|
93
|
+
['odd', '&:nth-child(odd)'],
|
|
94
|
+
['even', '&:nth-child(even)'],
|
|
68
95
|
'first-of-type',
|
|
69
96
|
'last-of-type',
|
|
70
97
|
'only-of-type',
|
|
71
98
|
|
|
72
99
|
// State
|
|
73
|
-
|
|
100
|
+
[
|
|
101
|
+
'visited',
|
|
102
|
+
({ container }) => {
|
|
103
|
+
removeAlphaVariables(container, [
|
|
104
|
+
'--tw-text-opacity',
|
|
105
|
+
'--tw-border-opacity',
|
|
106
|
+
'--tw-bg-opacity',
|
|
107
|
+
])
|
|
108
|
+
|
|
109
|
+
return '&:visited'
|
|
110
|
+
},
|
|
111
|
+
],
|
|
74
112
|
'target',
|
|
75
|
-
['open', '[open]'],
|
|
113
|
+
['open', '&[open]'],
|
|
76
114
|
|
|
77
115
|
// Forms
|
|
78
116
|
'default',
|
|
@@ -80,6 +118,7 @@ export let variantPlugins = {
|
|
|
80
118
|
'indeterminate',
|
|
81
119
|
'placeholder-shown',
|
|
82
120
|
'autofill',
|
|
121
|
+
'optional',
|
|
83
122
|
'required',
|
|
84
123
|
'valid',
|
|
85
124
|
'invalid',
|
|
@@ -92,44 +131,84 @@ export let variantPlugins = {
|
|
|
92
131
|
|
|
93
132
|
// Interactive
|
|
94
133
|
'focus-within',
|
|
95
|
-
|
|
134
|
+
[
|
|
135
|
+
'hover',
|
|
136
|
+
!flagEnabled(config(), 'hoverOnlyWhenSupported')
|
|
137
|
+
? '&:hover'
|
|
138
|
+
: '@media (hover: hover) and (pointer: fine) { &:hover }',
|
|
139
|
+
],
|
|
96
140
|
'focus',
|
|
97
141
|
'focus-visible',
|
|
98
142
|
'active',
|
|
143
|
+
'enabled',
|
|
99
144
|
'disabled',
|
|
100
|
-
].map((variant) => (Array.isArray(variant) ? variant : [variant,
|
|
145
|
+
].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
|
|
101
146
|
|
|
102
147
|
for (let [variantName, state] of pseudoVariants) {
|
|
103
|
-
addVariant(variantName,
|
|
104
|
-
|
|
148
|
+
addVariant(variantName, (ctx) => {
|
|
149
|
+
let result = typeof state === 'function' ? state(ctx) : state
|
|
105
150
|
|
|
106
|
-
|
|
107
|
-
|
|
151
|
+
return result
|
|
152
|
+
})
|
|
108
153
|
}
|
|
109
154
|
|
|
110
|
-
|
|
111
|
-
|
|
155
|
+
let variants = {
|
|
156
|
+
group: (_, { modifier }) =>
|
|
157
|
+
modifier
|
|
158
|
+
? [`:merge(${prefix('.group')}\\/${escapeClassName(modifier)})`, ' &']
|
|
159
|
+
: [`:merge(${prefix('.group')})`, ' &'],
|
|
160
|
+
peer: (_, { modifier }) =>
|
|
161
|
+
modifier
|
|
162
|
+
? [`:merge(${prefix('.peer')}\\/${escapeClassName(modifier)})`, ' ~ &']
|
|
163
|
+
: [`:merge(${prefix('.peer')})`, ' ~ &'],
|
|
112
164
|
}
|
|
113
|
-
},
|
|
114
165
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
166
|
+
for (let [name, fn] of Object.entries(variants)) {
|
|
167
|
+
matchVariant(
|
|
168
|
+
name,
|
|
169
|
+
(value = '', extra) => {
|
|
170
|
+
let result = normalize(typeof value === 'function' ? value(extra) : value)
|
|
171
|
+
if (!result.includes('&')) result = '&' + result
|
|
172
|
+
|
|
173
|
+
let [a, b] = fn('', extra)
|
|
174
|
+
|
|
175
|
+
let start = null
|
|
176
|
+
let end = null
|
|
177
|
+
let quotes = 0
|
|
178
|
+
|
|
179
|
+
for (let i = 0; i < result.length; ++i) {
|
|
180
|
+
let c = result[i]
|
|
181
|
+
if (c === '&') {
|
|
182
|
+
start = i
|
|
183
|
+
} else if (c === "'" || c === '"') {
|
|
184
|
+
quotes += 1
|
|
185
|
+
} else if (start !== null && c === ' ' && !quotes) {
|
|
186
|
+
end = i
|
|
187
|
+
}
|
|
188
|
+
}
|
|
121
189
|
|
|
122
|
-
|
|
123
|
-
|
|
190
|
+
if (start !== null && end === null) {
|
|
191
|
+
end = result.length
|
|
192
|
+
}
|
|
124
193
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
'The RTL features in Tailwind CSS are currently in preview.',
|
|
128
|
-
'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
|
|
129
|
-
])
|
|
194
|
+
// Basically this but can handle quotes:
|
|
195
|
+
// result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
|
|
130
196
|
|
|
131
|
-
|
|
132
|
-
|
|
197
|
+
return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end)
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
values: Object.fromEntries(pseudoVariants),
|
|
201
|
+
[INTERNAL_FEATURES]: {
|
|
202
|
+
respectPrefix: false,
|
|
203
|
+
},
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
directionVariants: ({ addVariant }) => {
|
|
210
|
+
addVariant('ltr', '&:where([dir="ltr"], [dir="ltr"] *)')
|
|
211
|
+
addVariant('rtl', '&:where([dir="rtl"], [dir="rtl"] *)')
|
|
133
212
|
},
|
|
134
213
|
|
|
135
214
|
reducedMotionVariants: ({ addVariant }) => {
|
|
@@ -138,19 +217,60 @@ export let variantPlugins = {
|
|
|
138
217
|
},
|
|
139
218
|
|
|
140
219
|
darkVariants: ({ config, addVariant }) => {
|
|
141
|
-
let mode = config('darkMode', 'media')
|
|
220
|
+
let [mode, selector = '.dark'] = [].concat(config('darkMode', 'media'))
|
|
221
|
+
|
|
142
222
|
if (mode === false) {
|
|
143
223
|
mode = 'media'
|
|
144
224
|
log.warn('darkmode-false', [
|
|
145
225
|
'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
|
|
146
226
|
'Change `darkMode` to `media` or remove it entirely.',
|
|
227
|
+
'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
|
|
147
228
|
])
|
|
148
229
|
}
|
|
149
230
|
|
|
150
|
-
if (mode === '
|
|
151
|
-
|
|
231
|
+
if (mode === 'variant') {
|
|
232
|
+
let formats
|
|
233
|
+
if (Array.isArray(selector)) {
|
|
234
|
+
formats = selector
|
|
235
|
+
} else if (typeof selector === 'function') {
|
|
236
|
+
formats = selector
|
|
237
|
+
} else if (typeof selector === 'string') {
|
|
238
|
+
formats = [selector]
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// TODO: We could also add these warnings if the user passes a function that returns string | string[]
|
|
242
|
+
// But this is an advanced enough use case that it's probably not necessary
|
|
243
|
+
if (Array.isArray(formats)) {
|
|
244
|
+
for (let format of formats) {
|
|
245
|
+
if (format === '.dark') {
|
|
246
|
+
mode = false
|
|
247
|
+
log.warn('darkmode-variant-without-selector', [
|
|
248
|
+
'When using `variant` for `darkMode`, you must provide a selector.',
|
|
249
|
+
'Example: `darkMode: ["variant", ".your-selector &"]`',
|
|
250
|
+
])
|
|
251
|
+
} else if (!format.includes('&')) {
|
|
252
|
+
mode = false
|
|
253
|
+
log.warn('darkmode-variant-without-ampersand', [
|
|
254
|
+
'When using `variant` for `darkMode`, your selector must contain `&`.',
|
|
255
|
+
'Example `darkMode: ["variant", ".your-selector &"]`',
|
|
256
|
+
])
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
selector = formats
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (mode === 'selector') {
|
|
265
|
+
// New preferred behavior
|
|
266
|
+
addVariant('dark', `&:where(${selector}, ${selector} *)`)
|
|
152
267
|
} else if (mode === 'media') {
|
|
153
268
|
addVariant('dark', '@media (prefers-color-scheme: dark)')
|
|
269
|
+
} else if (mode === 'variant') {
|
|
270
|
+
addVariant('dark', selector)
|
|
271
|
+
} else if (mode === 'class') {
|
|
272
|
+
// Old behavior
|
|
273
|
+
addVariant('dark', `:is(${selector} &)`)
|
|
154
274
|
}
|
|
155
275
|
},
|
|
156
276
|
|
|
@@ -158,20 +278,270 @@ export let variantPlugins = {
|
|
|
158
278
|
addVariant('print', '@media print')
|
|
159
279
|
},
|
|
160
280
|
|
|
161
|
-
screenVariants: ({ theme, addVariant }) => {
|
|
162
|
-
|
|
163
|
-
|
|
281
|
+
screenVariants: ({ theme, addVariant, matchVariant }) => {
|
|
282
|
+
let rawScreens = theme('screens') ?? {}
|
|
283
|
+
let areSimpleScreens = Object.values(rawScreens).every((v) => typeof v === 'string')
|
|
284
|
+
let screens = normalizeScreens(theme('screens'))
|
|
285
|
+
|
|
286
|
+
/** @type {Set<string>} */
|
|
287
|
+
let unitCache = new Set([])
|
|
288
|
+
|
|
289
|
+
/** @param {string} value */
|
|
290
|
+
function units(value) {
|
|
291
|
+
return value.match(/(\D+)$/)?.[1] ?? '(none)'
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** @param {string} value */
|
|
295
|
+
function recordUnits(value) {
|
|
296
|
+
if (value !== undefined) {
|
|
297
|
+
unitCache.add(units(value))
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** @param {string} value */
|
|
302
|
+
function canUseUnits(value) {
|
|
303
|
+
recordUnits(value)
|
|
304
|
+
|
|
305
|
+
// If the cache was empty it'll become 1 because we've just added the current unit
|
|
306
|
+
// If the cache was not empty and the units are the same the size doesn't change
|
|
307
|
+
// Otherwise, if the units are different from what is already known the size will always be > 1
|
|
308
|
+
return unitCache.size === 1
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
for (const screen of screens) {
|
|
312
|
+
for (const value of screen.values) {
|
|
313
|
+
recordUnits(value.min)
|
|
314
|
+
recordUnits(value.max)
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
let screensUseConsistentUnits = unitCache.size <= 1
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @typedef {import('./util/normalizeScreens').Screen} Screen
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @param {'min' | 'max'} type
|
|
326
|
+
* @returns {Record<string, Screen>}
|
|
327
|
+
*/
|
|
328
|
+
function buildScreenValues(type) {
|
|
329
|
+
return Object.fromEntries(
|
|
330
|
+
screens
|
|
331
|
+
.filter((screen) => isScreenSortable(screen).result)
|
|
332
|
+
.map((screen) => {
|
|
333
|
+
let { min, max } = screen.values[0]
|
|
334
|
+
|
|
335
|
+
if (type === 'min' && min !== undefined) {
|
|
336
|
+
return screen
|
|
337
|
+
} else if (type === 'min' && max !== undefined) {
|
|
338
|
+
return { ...screen, not: !screen.not }
|
|
339
|
+
} else if (type === 'max' && max !== undefined) {
|
|
340
|
+
return screen
|
|
341
|
+
} else if (type === 'max' && min !== undefined) {
|
|
342
|
+
return { ...screen, not: !screen.not }
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
.map((screen) => [screen.name, screen])
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @param {'min' | 'max'} type
|
|
351
|
+
* @returns {(a: { value: string | Screen }, z: { value: string | Screen }) => number}
|
|
352
|
+
*/
|
|
353
|
+
function buildSort(type) {
|
|
354
|
+
return (a, z) => compareScreens(type, a.value, z.value)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
let maxSort = buildSort('max')
|
|
358
|
+
let minSort = buildSort('min')
|
|
359
|
+
|
|
360
|
+
/** @param {'min'|'max'} type */
|
|
361
|
+
function buildScreenVariant(type) {
|
|
362
|
+
return (value) => {
|
|
363
|
+
if (!areSimpleScreens) {
|
|
364
|
+
log.warn('complex-screen-config', [
|
|
365
|
+
'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects.',
|
|
366
|
+
])
|
|
367
|
+
|
|
368
|
+
return []
|
|
369
|
+
} else if (!screensUseConsistentUnits) {
|
|
370
|
+
log.warn('mixed-screen-units', [
|
|
371
|
+
'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
|
|
372
|
+
])
|
|
373
|
+
|
|
374
|
+
return []
|
|
375
|
+
} else if (typeof value === 'string' && !canUseUnits(value)) {
|
|
376
|
+
log.warn('minmax-have-mixed-units', [
|
|
377
|
+
'The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units.',
|
|
378
|
+
])
|
|
379
|
+
|
|
380
|
+
return []
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return [`@media ${buildMediaQuery(toScreen(value, type))}`]
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
matchVariant('max', buildScreenVariant('max'), {
|
|
388
|
+
sort: maxSort,
|
|
389
|
+
values: areSimpleScreens ? buildScreenValues('max') : {},
|
|
390
|
+
})
|
|
164
391
|
|
|
165
|
-
|
|
392
|
+
// screens and min-* are sorted together when they can be
|
|
393
|
+
let id = 'min-screens'
|
|
394
|
+
for (let screen of screens) {
|
|
395
|
+
addVariant(screen.name, `@media ${buildMediaQuery(screen)}`, {
|
|
396
|
+
id,
|
|
397
|
+
sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined,
|
|
398
|
+
value: screen,
|
|
399
|
+
})
|
|
166
400
|
}
|
|
401
|
+
|
|
402
|
+
matchVariant('min', buildScreenVariant('min'), {
|
|
403
|
+
id,
|
|
404
|
+
sort: minSort,
|
|
405
|
+
})
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
supportsVariants: ({ matchVariant, theme }) => {
|
|
409
|
+
matchVariant(
|
|
410
|
+
'supports',
|
|
411
|
+
(value = '') => {
|
|
412
|
+
let check = normalize(value)
|
|
413
|
+
let isRaw = /^\w*\s*\(/.test(check)
|
|
414
|
+
|
|
415
|
+
// Chrome has a bug where `(condtion1)or(condition2)` is not valid
|
|
416
|
+
// But `(condition1) or (condition2)` is supported.
|
|
417
|
+
check = isRaw ? check.replace(/\b(and|or|not)\b/g, ' $1 ') : check
|
|
418
|
+
|
|
419
|
+
if (isRaw) {
|
|
420
|
+
return `@supports ${check}`
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if (!check.includes(':')) {
|
|
424
|
+
check = `${check}: var(--tw)`
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (!(check.startsWith('(') && check.endsWith(')'))) {
|
|
428
|
+
check = `(${check})`
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return `@supports ${check}`
|
|
432
|
+
},
|
|
433
|
+
{ values: theme('supports') ?? {} }
|
|
434
|
+
)
|
|
435
|
+
},
|
|
436
|
+
|
|
437
|
+
hasVariants: ({ matchVariant }) => {
|
|
438
|
+
matchVariant('has', (value) => `&:has(${normalize(value)})`, { values: {} })
|
|
439
|
+
matchVariant(
|
|
440
|
+
'group-has',
|
|
441
|
+
(value, { modifier }) =>
|
|
442
|
+
modifier
|
|
443
|
+
? `:merge(.group\\/${modifier}):has(${normalize(value)}) &`
|
|
444
|
+
: `:merge(.group):has(${normalize(value)}) &`,
|
|
445
|
+
{ values: {} }
|
|
446
|
+
)
|
|
447
|
+
matchVariant(
|
|
448
|
+
'peer-has',
|
|
449
|
+
(value, { modifier }) =>
|
|
450
|
+
modifier
|
|
451
|
+
? `:merge(.peer\\/${modifier}):has(${normalize(value)}) ~ &`
|
|
452
|
+
: `:merge(.peer):has(${normalize(value)}) ~ &`,
|
|
453
|
+
{ values: {} }
|
|
454
|
+
)
|
|
455
|
+
},
|
|
456
|
+
|
|
457
|
+
ariaVariants: ({ matchVariant, theme }) => {
|
|
458
|
+
matchVariant('aria', (value) => `&[aria-${normalize(value)}]`, { values: theme('aria') ?? {} })
|
|
459
|
+
matchVariant(
|
|
460
|
+
'group-aria',
|
|
461
|
+
(value, { modifier }) =>
|
|
462
|
+
modifier
|
|
463
|
+
? `:merge(.group\\/${modifier})[aria-${normalize(value)}] &`
|
|
464
|
+
: `:merge(.group)[aria-${normalize(value)}] &`,
|
|
465
|
+
{ values: theme('aria') ?? {} }
|
|
466
|
+
)
|
|
467
|
+
matchVariant(
|
|
468
|
+
'peer-aria',
|
|
469
|
+
(value, { modifier }) =>
|
|
470
|
+
modifier
|
|
471
|
+
? `:merge(.peer\\/${modifier})[aria-${normalize(value)}] ~ &`
|
|
472
|
+
: `:merge(.peer)[aria-${normalize(value)}] ~ &`,
|
|
473
|
+
{ values: theme('aria') ?? {} }
|
|
474
|
+
)
|
|
475
|
+
},
|
|
476
|
+
|
|
477
|
+
dataVariants: ({ matchVariant, theme }) => {
|
|
478
|
+
matchVariant('data', (value) => `&[data-${normalize(value)}]`, { values: theme('data') ?? {} })
|
|
479
|
+
matchVariant(
|
|
480
|
+
'group-data',
|
|
481
|
+
(value, { modifier }) =>
|
|
482
|
+
modifier
|
|
483
|
+
? `:merge(.group\\/${modifier})[data-${normalize(value)}] &`
|
|
484
|
+
: `:merge(.group)[data-${normalize(value)}] &`,
|
|
485
|
+
{ values: theme('data') ?? {} }
|
|
486
|
+
)
|
|
487
|
+
matchVariant(
|
|
488
|
+
'peer-data',
|
|
489
|
+
(value, { modifier }) =>
|
|
490
|
+
modifier
|
|
491
|
+
? `:merge(.peer\\/${modifier})[data-${normalize(value)}] ~ &`
|
|
492
|
+
: `:merge(.peer)[data-${normalize(value)}] ~ &`,
|
|
493
|
+
{ values: theme('data') ?? {} }
|
|
494
|
+
)
|
|
167
495
|
},
|
|
168
496
|
|
|
169
497
|
orientationVariants: ({ addVariant }) => {
|
|
170
498
|
addVariant('portrait', '@media (orientation: portrait)')
|
|
171
499
|
addVariant('landscape', '@media (orientation: landscape)')
|
|
172
500
|
},
|
|
501
|
+
|
|
502
|
+
prefersContrastVariants: ({ addVariant }) => {
|
|
503
|
+
addVariant('contrast-more', '@media (prefers-contrast: more)')
|
|
504
|
+
addVariant('contrast-less', '@media (prefers-contrast: less)')
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
forcedColorsVariants: ({ addVariant }) => {
|
|
508
|
+
addVariant('forced-colors', '@media (forced-colors: active)')
|
|
509
|
+
},
|
|
173
510
|
}
|
|
174
511
|
|
|
512
|
+
let cssTransformValue = [
|
|
513
|
+
'translate(var(--tw-translate-x), var(--tw-translate-y))',
|
|
514
|
+
'rotate(var(--tw-rotate))',
|
|
515
|
+
'skewX(var(--tw-skew-x))',
|
|
516
|
+
'skewY(var(--tw-skew-y))',
|
|
517
|
+
'scaleX(var(--tw-scale-x))',
|
|
518
|
+
'scaleY(var(--tw-scale-y))',
|
|
519
|
+
].join(' ')
|
|
520
|
+
|
|
521
|
+
let cssFilterValue = [
|
|
522
|
+
'var(--tw-blur)',
|
|
523
|
+
'var(--tw-brightness)',
|
|
524
|
+
'var(--tw-contrast)',
|
|
525
|
+
'var(--tw-grayscale)',
|
|
526
|
+
'var(--tw-hue-rotate)',
|
|
527
|
+
'var(--tw-invert)',
|
|
528
|
+
'var(--tw-saturate)',
|
|
529
|
+
'var(--tw-sepia)',
|
|
530
|
+
'var(--tw-drop-shadow)',
|
|
531
|
+
].join(' ')
|
|
532
|
+
|
|
533
|
+
let cssBackdropFilterValue = [
|
|
534
|
+
'var(--tw-backdrop-blur)',
|
|
535
|
+
'var(--tw-backdrop-brightness)',
|
|
536
|
+
'var(--tw-backdrop-contrast)',
|
|
537
|
+
'var(--tw-backdrop-grayscale)',
|
|
538
|
+
'var(--tw-backdrop-hue-rotate)',
|
|
539
|
+
'var(--tw-backdrop-invert)',
|
|
540
|
+
'var(--tw-backdrop-opacity)',
|
|
541
|
+
'var(--tw-backdrop-saturate)',
|
|
542
|
+
'var(--tw-backdrop-sepia)',
|
|
543
|
+
].join(' ')
|
|
544
|
+
|
|
175
545
|
export let corePlugins = {
|
|
176
546
|
preflight: ({ addBase }) => {
|
|
177
547
|
let preflightStyles = postcss.parse(
|
|
@@ -310,6 +680,7 @@ export let corePlugins = {
|
|
|
310
680
|
addUtilities({
|
|
311
681
|
'.visible': { visibility: 'visible' },
|
|
312
682
|
'.invisible': { visibility: 'hidden' },
|
|
683
|
+
'.collapse': { visibility: 'collapse' },
|
|
313
684
|
})
|
|
314
685
|
},
|
|
315
686
|
|
|
@@ -326,12 +697,14 @@ export let corePlugins = {
|
|
|
326
697
|
inset: createUtilityPlugin(
|
|
327
698
|
'inset',
|
|
328
699
|
[
|
|
329
|
-
['inset', ['
|
|
700
|
+
['inset', ['inset']],
|
|
330
701
|
[
|
|
331
702
|
['inset-x', ['left', 'right']],
|
|
332
703
|
['inset-y', ['top', 'bottom']],
|
|
333
704
|
],
|
|
334
705
|
[
|
|
706
|
+
['start', ['inset-inline-start']],
|
|
707
|
+
['end', ['inset-inline-end']],
|
|
335
708
|
['top', ['top']],
|
|
336
709
|
['right', ['right']],
|
|
337
710
|
['bottom', ['bottom']],
|
|
@@ -359,6 +732,8 @@ export let corePlugins = {
|
|
|
359
732
|
|
|
360
733
|
float: ({ addUtilities }) => {
|
|
361
734
|
addUtilities({
|
|
735
|
+
'.float-start': { float: 'inline-start' },
|
|
736
|
+
'.float-end': { float: 'inline-end' },
|
|
362
737
|
'.float-right': { float: 'right' },
|
|
363
738
|
'.float-left': { float: 'left' },
|
|
364
739
|
'.float-none': { float: 'none' },
|
|
@@ -367,6 +742,8 @@ export let corePlugins = {
|
|
|
367
742
|
|
|
368
743
|
clear: ({ addUtilities }) => {
|
|
369
744
|
addUtilities({
|
|
745
|
+
'.clear-start': { clear: 'inline-start' },
|
|
746
|
+
'.clear-end': { clear: 'inline-end' },
|
|
370
747
|
'.clear-left': { clear: 'left' },
|
|
371
748
|
'.clear-right': { clear: 'right' },
|
|
372
749
|
'.clear-both': { clear: 'both' },
|
|
@@ -383,6 +760,8 @@ export let corePlugins = {
|
|
|
383
760
|
['my', ['margin-top', 'margin-bottom']],
|
|
384
761
|
],
|
|
385
762
|
[
|
|
763
|
+
['ms', ['margin-inline-start']],
|
|
764
|
+
['me', ['margin-inline-end']],
|
|
386
765
|
['mt', ['margin-top']],
|
|
387
766
|
['mr', ['margin-right']],
|
|
388
767
|
['mb', ['margin-bottom']],
|
|
@@ -399,6 +778,29 @@ export let corePlugins = {
|
|
|
399
778
|
})
|
|
400
779
|
},
|
|
401
780
|
|
|
781
|
+
lineClamp: ({ matchUtilities, addUtilities, theme }) => {
|
|
782
|
+
matchUtilities(
|
|
783
|
+
{
|
|
784
|
+
'line-clamp': (value) => ({
|
|
785
|
+
overflow: 'hidden',
|
|
786
|
+
display: '-webkit-box',
|
|
787
|
+
'-webkit-box-orient': 'vertical',
|
|
788
|
+
'-webkit-line-clamp': `${value}`,
|
|
789
|
+
}),
|
|
790
|
+
},
|
|
791
|
+
{ values: theme('lineClamp') }
|
|
792
|
+
)
|
|
793
|
+
|
|
794
|
+
addUtilities({
|
|
795
|
+
'.line-clamp-none': {
|
|
796
|
+
overflow: 'visible',
|
|
797
|
+
display: 'block',
|
|
798
|
+
'-webkit-box-orient': 'horizontal',
|
|
799
|
+
'-webkit-line-clamp': 'none',
|
|
800
|
+
},
|
|
801
|
+
})
|
|
802
|
+
},
|
|
803
|
+
|
|
402
804
|
display: ({ addUtilities }) => {
|
|
403
805
|
addUtilities({
|
|
404
806
|
'.block': { display: 'block' },
|
|
@@ -427,6 +829,8 @@ export let corePlugins = {
|
|
|
427
829
|
|
|
428
830
|
aspectRatio: createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]]),
|
|
429
831
|
|
|
832
|
+
size: createUtilityPlugin('size', [['size', ['width', 'height']]]),
|
|
833
|
+
|
|
430
834
|
height: createUtilityPlugin('height', [['h', ['height']]]),
|
|
431
835
|
maxHeight: createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]]),
|
|
432
836
|
minHeight: createUtilityPlugin('minHeight', [['min-h', ['minHeight']]]),
|
|
@@ -453,6 +857,13 @@ export let corePlugins = {
|
|
|
453
857
|
})
|
|
454
858
|
},
|
|
455
859
|
|
|
860
|
+
captionSide: ({ addUtilities }) => {
|
|
861
|
+
addUtilities({
|
|
862
|
+
'.caption-top': { 'caption-side': 'top' },
|
|
863
|
+
'.caption-bottom': { 'caption-side': 'bottom' },
|
|
864
|
+
})
|
|
865
|
+
},
|
|
866
|
+
|
|
456
867
|
borderCollapse: ({ addUtilities }) => {
|
|
457
868
|
addUtilities({
|
|
458
869
|
'.border-collapse': { 'border-collapse': 'collapse' },
|
|
@@ -460,6 +871,41 @@ export let corePlugins = {
|
|
|
460
871
|
})
|
|
461
872
|
},
|
|
462
873
|
|
|
874
|
+
borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
|
|
875
|
+
addDefaults('border-spacing', {
|
|
876
|
+
'--tw-border-spacing-x': 0,
|
|
877
|
+
'--tw-border-spacing-y': 0,
|
|
878
|
+
})
|
|
879
|
+
|
|
880
|
+
matchUtilities(
|
|
881
|
+
{
|
|
882
|
+
'border-spacing': (value) => {
|
|
883
|
+
return {
|
|
884
|
+
'--tw-border-spacing-x': value,
|
|
885
|
+
'--tw-border-spacing-y': value,
|
|
886
|
+
'@defaults border-spacing': {},
|
|
887
|
+
'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
'border-spacing-x': (value) => {
|
|
891
|
+
return {
|
|
892
|
+
'--tw-border-spacing-x': value,
|
|
893
|
+
'@defaults border-spacing': {},
|
|
894
|
+
'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
'border-spacing-y': (value) => {
|
|
898
|
+
return {
|
|
899
|
+
'--tw-border-spacing-y': value,
|
|
900
|
+
'@defaults border-spacing': {},
|
|
901
|
+
'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
},
|
|
905
|
+
{ values: theme('borderSpacing') }
|
|
906
|
+
)
|
|
907
|
+
},
|
|
908
|
+
|
|
463
909
|
transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
|
|
464
910
|
translate: createUtilityPlugin(
|
|
465
911
|
'translate',
|
|
@@ -467,11 +913,11 @@ export let corePlugins = {
|
|
|
467
913
|
[
|
|
468
914
|
[
|
|
469
915
|
'translate-x',
|
|
470
|
-
[['@defaults transform', {}], '--tw-translate-x', ['transform',
|
|
916
|
+
[['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
|
|
471
917
|
],
|
|
472
918
|
[
|
|
473
919
|
'translate-y',
|
|
474
|
-
[['@defaults transform', {}], '--tw-translate-y', ['transform',
|
|
920
|
+
[['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
|
|
475
921
|
],
|
|
476
922
|
],
|
|
477
923
|
],
|
|
@@ -479,26 +925,15 @@ export let corePlugins = {
|
|
|
479
925
|
),
|
|
480
926
|
rotate: createUtilityPlugin(
|
|
481
927
|
'rotate',
|
|
482
|
-
[
|
|
483
|
-
[
|
|
484
|
-
'rotate',
|
|
485
|
-
[['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
|
|
486
|
-
],
|
|
487
|
-
],
|
|
928
|
+
[['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
|
|
488
929
|
{ supportsNegativeValues: true }
|
|
489
930
|
),
|
|
490
931
|
skew: createUtilityPlugin(
|
|
491
932
|
'skew',
|
|
492
933
|
[
|
|
493
934
|
[
|
|
494
|
-
[
|
|
495
|
-
|
|
496
|
-
[['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
|
|
497
|
-
],
|
|
498
|
-
[
|
|
499
|
-
'skew-y',
|
|
500
|
-
[['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
|
|
501
|
-
],
|
|
935
|
+
['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
|
|
936
|
+
['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
|
|
502
937
|
],
|
|
503
938
|
],
|
|
504
939
|
{ supportsNegativeValues: true }
|
|
@@ -512,17 +947,17 @@ export let corePlugins = {
|
|
|
512
947
|
['@defaults transform', {}],
|
|
513
948
|
'--tw-scale-x',
|
|
514
949
|
'--tw-scale-y',
|
|
515
|
-
['transform',
|
|
950
|
+
['transform', cssTransformValue],
|
|
516
951
|
],
|
|
517
952
|
],
|
|
518
953
|
[
|
|
519
954
|
[
|
|
520
955
|
'scale-x',
|
|
521
|
-
[['@defaults transform', {}], '--tw-scale-x', ['transform',
|
|
956
|
+
[['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
|
|
522
957
|
],
|
|
523
958
|
[
|
|
524
959
|
'scale-y',
|
|
525
|
-
[['@defaults transform', {}], '--tw-scale-y', ['transform',
|
|
960
|
+
[['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
|
|
526
961
|
],
|
|
527
962
|
],
|
|
528
963
|
],
|
|
@@ -538,46 +973,25 @@ export let corePlugins = {
|
|
|
538
973
|
'--tw-skew-y': '0',
|
|
539
974
|
'--tw-scale-x': '1',
|
|
540
975
|
'--tw-scale-y': '1',
|
|
541
|
-
'--tw-transform': [
|
|
542
|
-
'translateX(var(--tw-translate-x))',
|
|
543
|
-
'translateY(var(--tw-translate-y))',
|
|
544
|
-
'rotate(var(--tw-rotate))',
|
|
545
|
-
'skewX(var(--tw-skew-x))',
|
|
546
|
-
'skewY(var(--tw-skew-y))',
|
|
547
|
-
'scaleX(var(--tw-scale-x))',
|
|
548
|
-
'scaleY(var(--tw-scale-y))',
|
|
549
|
-
].join(' '),
|
|
550
976
|
})
|
|
551
977
|
|
|
552
978
|
addUtilities({
|
|
553
|
-
'.transform': { '@defaults transform': {}, transform:
|
|
979
|
+
'.transform': { '@defaults transform': {}, transform: cssTransformValue },
|
|
554
980
|
'.transform-cpu': {
|
|
555
|
-
|
|
556
|
-
'translateX(var(--tw-translate-x))',
|
|
557
|
-
'translateY(var(--tw-translate-y))',
|
|
558
|
-
'rotate(var(--tw-rotate))',
|
|
559
|
-
'skewX(var(--tw-skew-x))',
|
|
560
|
-
'skewY(var(--tw-skew-y))',
|
|
561
|
-
'scaleX(var(--tw-scale-x))',
|
|
562
|
-
'scaleY(var(--tw-scale-y))',
|
|
563
|
-
].join(' '),
|
|
981
|
+
transform: cssTransformValue,
|
|
564
982
|
},
|
|
565
983
|
'.transform-gpu': {
|
|
566
|
-
|
|
567
|
-
'
|
|
568
|
-
'
|
|
569
|
-
|
|
570
|
-
'skewY(var(--tw-skew-y))',
|
|
571
|
-
'scaleX(var(--tw-scale-x))',
|
|
572
|
-
'scaleY(var(--tw-scale-y))',
|
|
573
|
-
].join(' '),
|
|
984
|
+
transform: cssTransformValue.replace(
|
|
985
|
+
'translate(var(--tw-translate-x), var(--tw-translate-y))',
|
|
986
|
+
'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
|
|
987
|
+
),
|
|
574
988
|
},
|
|
575
989
|
'.transform-none': { transform: 'none' },
|
|
576
990
|
})
|
|
577
991
|
},
|
|
578
992
|
|
|
579
|
-
animation: ({ matchUtilities, theme,
|
|
580
|
-
let prefixName = (name) => prefix
|
|
993
|
+
animation: ({ matchUtilities, theme, config }) => {
|
|
994
|
+
let prefixName = (name) => escapeClassName(config('prefix') + name)
|
|
581
995
|
let keyframes = Object.fromEntries(
|
|
582
996
|
Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
|
|
583
997
|
return [key, { [`@keyframes ${prefixName(key)}`]: value }]
|
|
@@ -612,49 +1026,50 @@ export let corePlugins = {
|
|
|
612
1026
|
|
|
613
1027
|
touchAction: ({ addDefaults, addUtilities }) => {
|
|
614
1028
|
addDefaults('touch-action', {
|
|
615
|
-
'--tw-pan-x': '
|
|
616
|
-
'--tw-pan-y': '
|
|
617
|
-
'--tw-pinch-zoom': '
|
|
618
|
-
'--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
|
|
1029
|
+
'--tw-pan-x': ' ',
|
|
1030
|
+
'--tw-pan-y': ' ',
|
|
1031
|
+
'--tw-pinch-zoom': ' ',
|
|
619
1032
|
})
|
|
620
1033
|
|
|
1034
|
+
let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
|
|
1035
|
+
|
|
621
1036
|
addUtilities({
|
|
622
1037
|
'.touch-auto': { 'touch-action': 'auto' },
|
|
623
1038
|
'.touch-none': { 'touch-action': 'none' },
|
|
624
1039
|
'.touch-pan-x': {
|
|
625
1040
|
'@defaults touch-action': {},
|
|
626
1041
|
'--tw-pan-x': 'pan-x',
|
|
627
|
-
'touch-action':
|
|
1042
|
+
'touch-action': cssTouchActionValue,
|
|
628
1043
|
},
|
|
629
1044
|
'.touch-pan-left': {
|
|
630
1045
|
'@defaults touch-action': {},
|
|
631
1046
|
'--tw-pan-x': 'pan-left',
|
|
632
|
-
'touch-action':
|
|
1047
|
+
'touch-action': cssTouchActionValue,
|
|
633
1048
|
},
|
|
634
1049
|
'.touch-pan-right': {
|
|
635
1050
|
'@defaults touch-action': {},
|
|
636
1051
|
'--tw-pan-x': 'pan-right',
|
|
637
|
-
'touch-action':
|
|
1052
|
+
'touch-action': cssTouchActionValue,
|
|
638
1053
|
},
|
|
639
1054
|
'.touch-pan-y': {
|
|
640
1055
|
'@defaults touch-action': {},
|
|
641
1056
|
'--tw-pan-y': 'pan-y',
|
|
642
|
-
'touch-action':
|
|
1057
|
+
'touch-action': cssTouchActionValue,
|
|
643
1058
|
},
|
|
644
1059
|
'.touch-pan-up': {
|
|
645
1060
|
'@defaults touch-action': {},
|
|
646
1061
|
'--tw-pan-y': 'pan-up',
|
|
647
|
-
'touch-action':
|
|
1062
|
+
'touch-action': cssTouchActionValue,
|
|
648
1063
|
},
|
|
649
1064
|
'.touch-pan-down': {
|
|
650
1065
|
'@defaults touch-action': {},
|
|
651
1066
|
'--tw-pan-y': 'pan-down',
|
|
652
|
-
'touch-action':
|
|
1067
|
+
'touch-action': cssTouchActionValue,
|
|
653
1068
|
},
|
|
654
1069
|
'.touch-pinch-zoom': {
|
|
655
1070
|
'@defaults touch-action': {},
|
|
656
1071
|
'--tw-pinch-zoom': 'pinch-zoom',
|
|
657
|
-
'touch-action':
|
|
1072
|
+
'touch-action': cssTouchActionValue,
|
|
658
1073
|
},
|
|
659
1074
|
'.touch-manipulation': { 'touch-action': 'manipulation' },
|
|
660
1075
|
})
|
|
@@ -727,6 +1142,8 @@ export let corePlugins = {
|
|
|
727
1142
|
['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
|
|
728
1143
|
],
|
|
729
1144
|
[
|
|
1145
|
+
['scroll-ms', ['scroll-margin-inline-start']],
|
|
1146
|
+
['scroll-me', ['scroll-margin-inline-end']],
|
|
730
1147
|
['scroll-mt', ['scroll-margin-top']],
|
|
731
1148
|
['scroll-mr', ['scroll-margin-right']],
|
|
732
1149
|
['scroll-mb', ['scroll-margin-bottom']],
|
|
@@ -743,6 +1160,8 @@ export let corePlugins = {
|
|
|
743
1160
|
['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
|
|
744
1161
|
],
|
|
745
1162
|
[
|
|
1163
|
+
['scroll-ps', ['scroll-padding-inline-start']],
|
|
1164
|
+
['scroll-pe', ['scroll-padding-inline-end']],
|
|
746
1165
|
['scroll-pt', ['scroll-padding-top']],
|
|
747
1166
|
['scroll-pr', ['scroll-padding-right']],
|
|
748
1167
|
['scroll-pb', ['scroll-padding-bottom']],
|
|
@@ -756,12 +1175,13 @@ export let corePlugins = {
|
|
|
756
1175
|
'.list-outside': { 'list-style-position': 'outside' },
|
|
757
1176
|
})
|
|
758
1177
|
},
|
|
759
|
-
|
|
760
1178
|
listStyleType: createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]),
|
|
1179
|
+
listStyleImage: createUtilityPlugin('listStyleImage', [['list-image', ['listStyleImage']]]),
|
|
761
1180
|
|
|
762
1181
|
appearance: ({ addUtilities }) => {
|
|
763
1182
|
addUtilities({
|
|
764
1183
|
'.appearance-none': { appearance: 'none' },
|
|
1184
|
+
'.appearance-auto': { appearance: 'auto' },
|
|
765
1185
|
})
|
|
766
1186
|
},
|
|
767
1187
|
|
|
@@ -808,6 +1228,7 @@ export let corePlugins = {
|
|
|
808
1228
|
addUtilities({
|
|
809
1229
|
'.grid-flow-row': { gridAutoFlow: 'row' },
|
|
810
1230
|
'.grid-flow-col': { gridAutoFlow: 'column' },
|
|
1231
|
+
'.grid-flow-dense': { gridAutoFlow: 'dense' },
|
|
811
1232
|
'.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
|
|
812
1233
|
'.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
|
|
813
1234
|
})
|
|
@@ -844,6 +1265,7 @@ export let corePlugins = {
|
|
|
844
1265
|
'.place-content-between': { 'place-content': 'space-between' },
|
|
845
1266
|
'.place-content-around': { 'place-content': 'space-around' },
|
|
846
1267
|
'.place-content-evenly': { 'place-content': 'space-evenly' },
|
|
1268
|
+
'.place-content-baseline': { 'place-content': 'baseline' },
|
|
847
1269
|
'.place-content-stretch': { 'place-content': 'stretch' },
|
|
848
1270
|
})
|
|
849
1271
|
},
|
|
@@ -853,18 +1275,22 @@ export let corePlugins = {
|
|
|
853
1275
|
'.place-items-start': { 'place-items': 'start' },
|
|
854
1276
|
'.place-items-end': { 'place-items': 'end' },
|
|
855
1277
|
'.place-items-center': { 'place-items': 'center' },
|
|
1278
|
+
'.place-items-baseline': { 'place-items': 'baseline' },
|
|
856
1279
|
'.place-items-stretch': { 'place-items': 'stretch' },
|
|
857
1280
|
})
|
|
858
1281
|
},
|
|
859
1282
|
|
|
860
1283
|
alignContent: ({ addUtilities }) => {
|
|
861
1284
|
addUtilities({
|
|
1285
|
+
'.content-normal': { 'align-content': 'normal' },
|
|
862
1286
|
'.content-center': { 'align-content': 'center' },
|
|
863
1287
|
'.content-start': { 'align-content': 'flex-start' },
|
|
864
1288
|
'.content-end': { 'align-content': 'flex-end' },
|
|
865
1289
|
'.content-between': { 'align-content': 'space-between' },
|
|
866
1290
|
'.content-around': { 'align-content': 'space-around' },
|
|
867
1291
|
'.content-evenly': { 'align-content': 'space-evenly' },
|
|
1292
|
+
'.content-baseline': { 'align-content': 'baseline' },
|
|
1293
|
+
'.content-stretch': { 'align-content': 'stretch' },
|
|
868
1294
|
})
|
|
869
1295
|
},
|
|
870
1296
|
|
|
@@ -880,12 +1306,14 @@ export let corePlugins = {
|
|
|
880
1306
|
|
|
881
1307
|
justifyContent: ({ addUtilities }) => {
|
|
882
1308
|
addUtilities({
|
|
1309
|
+
'.justify-normal': { 'justify-content': 'normal' },
|
|
883
1310
|
'.justify-start': { 'justify-content': 'flex-start' },
|
|
884
1311
|
'.justify-end': { 'justify-content': 'flex-end' },
|
|
885
1312
|
'.justify-center': { 'justify-content': 'center' },
|
|
886
1313
|
'.justify-between': { 'justify-content': 'space-between' },
|
|
887
1314
|
'.justify-around': { 'justify-content': 'space-around' },
|
|
888
1315
|
'.justify-evenly': { 'justify-content': 'space-evenly' },
|
|
1316
|
+
'.justify-stretch': { 'justify-content': 'stretch' },
|
|
889
1317
|
})
|
|
890
1318
|
},
|
|
891
1319
|
|
|
@@ -969,7 +1397,7 @@ export let corePlugins = {
|
|
|
969
1397
|
}
|
|
970
1398
|
},
|
|
971
1399
|
},
|
|
972
|
-
{ values: theme('divideWidth'), type: ['line-width', 'length'] }
|
|
1400
|
+
{ values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
|
|
973
1401
|
)
|
|
974
1402
|
|
|
975
1403
|
addUtilities({
|
|
@@ -1017,7 +1445,7 @@ export let corePlugins = {
|
|
|
1017
1445
|
},
|
|
1018
1446
|
{
|
|
1019
1447
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
|
|
1020
|
-
type: 'color',
|
|
1448
|
+
type: ['color', 'any'],
|
|
1021
1449
|
}
|
|
1022
1450
|
)
|
|
1023
1451
|
},
|
|
@@ -1114,6 +1542,14 @@ export let corePlugins = {
|
|
|
1114
1542
|
})
|
|
1115
1543
|
},
|
|
1116
1544
|
|
|
1545
|
+
hyphens: ({ addUtilities }) => {
|
|
1546
|
+
addUtilities({
|
|
1547
|
+
'.hyphens-none': { hyphens: 'none' },
|
|
1548
|
+
'.hyphens-manual': { hyphens: 'manual' },
|
|
1549
|
+
'.hyphens-auto': { hyphens: 'auto' },
|
|
1550
|
+
})
|
|
1551
|
+
},
|
|
1552
|
+
|
|
1117
1553
|
whitespace: ({ addUtilities }) => {
|
|
1118
1554
|
addUtilities({
|
|
1119
1555
|
'.whitespace-normal': { 'white-space': 'normal' },
|
|
@@ -1121,6 +1557,16 @@ export let corePlugins = {
|
|
|
1121
1557
|
'.whitespace-pre': { 'white-space': 'pre' },
|
|
1122
1558
|
'.whitespace-pre-line': { 'white-space': 'pre-line' },
|
|
1123
1559
|
'.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
|
|
1560
|
+
'.whitespace-break-spaces': { 'white-space': 'break-spaces' },
|
|
1561
|
+
})
|
|
1562
|
+
},
|
|
1563
|
+
|
|
1564
|
+
textWrap: ({ addUtilities }) => {
|
|
1565
|
+
addUtilities({
|
|
1566
|
+
'.text-wrap': { 'text-wrap': 'wrap' },
|
|
1567
|
+
'.text-nowrap': { 'text-wrap': 'nowrap' },
|
|
1568
|
+
'.text-balance': { 'text-wrap': 'balance' },
|
|
1569
|
+
'.text-pretty': { 'text-wrap': 'pretty' },
|
|
1124
1570
|
})
|
|
1125
1571
|
},
|
|
1126
1572
|
|
|
@@ -1129,18 +1575,25 @@ export let corePlugins = {
|
|
|
1129
1575
|
'.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
|
|
1130
1576
|
'.break-words': { 'overflow-wrap': 'break-word' },
|
|
1131
1577
|
'.break-all': { 'word-break': 'break-all' },
|
|
1578
|
+
'.break-keep': { 'word-break': 'keep-all' },
|
|
1132
1579
|
})
|
|
1133
1580
|
},
|
|
1134
1581
|
|
|
1135
1582
|
borderRadius: createUtilityPlugin('borderRadius', [
|
|
1136
1583
|
['rounded', ['border-radius']],
|
|
1137
1584
|
[
|
|
1585
|
+
['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
|
|
1586
|
+
['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
|
|
1138
1587
|
['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
|
|
1139
1588
|
['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
|
|
1140
1589
|
['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
|
|
1141
1590
|
['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
|
|
1142
1591
|
],
|
|
1143
1592
|
[
|
|
1593
|
+
['rounded-ss', ['border-start-start-radius']],
|
|
1594
|
+
['rounded-se', ['border-start-end-radius']],
|
|
1595
|
+
['rounded-ee', ['border-end-end-radius']],
|
|
1596
|
+
['rounded-es', ['border-end-start-radius']],
|
|
1144
1597
|
['rounded-tl', ['border-top-left-radius']],
|
|
1145
1598
|
['rounded-tr', ['border-top-right-radius']],
|
|
1146
1599
|
['rounded-br', ['border-bottom-right-radius']],
|
|
@@ -1157,6 +1610,8 @@ export let corePlugins = {
|
|
|
1157
1610
|
['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
|
|
1158
1611
|
],
|
|
1159
1612
|
[
|
|
1613
|
+
['border-s', [['@defaults border-width', {}], 'border-inline-start-width']],
|
|
1614
|
+
['border-e', [['@defaults border-width', {}], 'border-inline-end-width']],
|
|
1160
1615
|
['border-t', [['@defaults border-width', {}], 'border-top-width']],
|
|
1161
1616
|
['border-r', [['@defaults border-width', {}], 'border-right-width']],
|
|
1162
1617
|
['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
|
|
@@ -1177,23 +1632,7 @@ export let corePlugins = {
|
|
|
1177
1632
|
})
|
|
1178
1633
|
},
|
|
1179
1634
|
|
|
1180
|
-
borderColor: ({
|
|
1181
|
-
if (!corePlugins('borderOpacity')) {
|
|
1182
|
-
let value = theme('borderColor.DEFAULT', 'currentColor')
|
|
1183
|
-
addDefaults('border-width', {
|
|
1184
|
-
'border-color': toColorValue(value),
|
|
1185
|
-
})
|
|
1186
|
-
} else {
|
|
1187
|
-
addDefaults(
|
|
1188
|
-
'border-width',
|
|
1189
|
-
withAlphaVariable({
|
|
1190
|
-
color: theme('borderColor.DEFAULT', 'currentColor'),
|
|
1191
|
-
property: 'border-color',
|
|
1192
|
-
variable: '--tw-border-opacity',
|
|
1193
|
-
})
|
|
1194
|
-
)
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1635
|
+
borderColor: ({ matchUtilities, theme, corePlugins }) => {
|
|
1197
1636
|
matchUtilities(
|
|
1198
1637
|
{
|
|
1199
1638
|
border: (value) => {
|
|
@@ -1212,7 +1651,7 @@ export let corePlugins = {
|
|
|
1212
1651
|
},
|
|
1213
1652
|
{
|
|
1214
1653
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
|
|
1215
|
-
type: ['color'],
|
|
1654
|
+
type: ['color', 'any'],
|
|
1216
1655
|
}
|
|
1217
1656
|
)
|
|
1218
1657
|
|
|
@@ -1249,12 +1688,38 @@ export let corePlugins = {
|
|
|
1249
1688
|
},
|
|
1250
1689
|
{
|
|
1251
1690
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
|
|
1252
|
-
type: 'color',
|
|
1691
|
+
type: ['color', 'any'],
|
|
1253
1692
|
}
|
|
1254
1693
|
)
|
|
1255
1694
|
|
|
1256
1695
|
matchUtilities(
|
|
1257
1696
|
{
|
|
1697
|
+
'border-s': (value) => {
|
|
1698
|
+
if (!corePlugins('borderOpacity')) {
|
|
1699
|
+
return {
|
|
1700
|
+
'border-inline-start-color': toColorValue(value),
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
return withAlphaVariable({
|
|
1705
|
+
color: value,
|
|
1706
|
+
property: 'border-inline-start-color',
|
|
1707
|
+
variable: '--tw-border-opacity',
|
|
1708
|
+
})
|
|
1709
|
+
},
|
|
1710
|
+
'border-e': (value) => {
|
|
1711
|
+
if (!corePlugins('borderOpacity')) {
|
|
1712
|
+
return {
|
|
1713
|
+
'border-inline-end-color': toColorValue(value),
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
return withAlphaVariable({
|
|
1718
|
+
color: value,
|
|
1719
|
+
property: 'border-inline-end-color',
|
|
1720
|
+
variable: '--tw-border-opacity',
|
|
1721
|
+
})
|
|
1722
|
+
},
|
|
1258
1723
|
'border-t': (value) => {
|
|
1259
1724
|
if (!corePlugins('borderOpacity')) {
|
|
1260
1725
|
return {
|
|
@@ -1310,7 +1775,7 @@ export let corePlugins = {
|
|
|
1310
1775
|
},
|
|
1311
1776
|
{
|
|
1312
1777
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
|
|
1313
|
-
type: 'color',
|
|
1778
|
+
type: ['color', 'any'],
|
|
1314
1779
|
}
|
|
1315
1780
|
)
|
|
1316
1781
|
},
|
|
@@ -1336,7 +1801,7 @@ export let corePlugins = {
|
|
|
1336
1801
|
})
|
|
1337
1802
|
},
|
|
1338
1803
|
},
|
|
1339
|
-
{ values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
|
|
1804
|
+
{ values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
|
|
1340
1805
|
)
|
|
1341
1806
|
},
|
|
1342
1807
|
|
|
@@ -1351,44 +1816,98 @@ export let corePlugins = {
|
|
|
1351
1816
|
return withAlphaValue(value, 0, 'rgb(255 255 255 / 0)')
|
|
1352
1817
|
}
|
|
1353
1818
|
|
|
1354
|
-
return function ({ matchUtilities, theme }) {
|
|
1819
|
+
return function ({ matchUtilities, theme, addDefaults }) {
|
|
1820
|
+
addDefaults('gradient-color-stops', {
|
|
1821
|
+
'--tw-gradient-from-position': ' ',
|
|
1822
|
+
'--tw-gradient-via-position': ' ',
|
|
1823
|
+
'--tw-gradient-to-position': ' ',
|
|
1824
|
+
})
|
|
1825
|
+
|
|
1355
1826
|
let options = {
|
|
1356
1827
|
values: flattenColorPalette(theme('gradientColorStops')),
|
|
1357
1828
|
type: ['color', 'any'],
|
|
1358
1829
|
}
|
|
1359
1830
|
|
|
1831
|
+
let positionOptions = {
|
|
1832
|
+
values: theme('gradientColorStopPositions'),
|
|
1833
|
+
type: ['length', 'percentage'],
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1360
1836
|
matchUtilities(
|
|
1361
1837
|
{
|
|
1362
1838
|
from: (value) => {
|
|
1363
1839
|
let transparentToValue = transparentTo(value)
|
|
1364
1840
|
|
|
1365
1841
|
return {
|
|
1366
|
-
'
|
|
1367
|
-
'--tw-gradient-
|
|
1842
|
+
'@defaults gradient-color-stops': {},
|
|
1843
|
+
'--tw-gradient-from': `${toColorValue(value)} var(--tw-gradient-from-position)`,
|
|
1844
|
+
'--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
|
|
1845
|
+
'--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
|
|
1368
1846
|
}
|
|
1369
1847
|
},
|
|
1370
1848
|
},
|
|
1371
1849
|
options
|
|
1372
1850
|
)
|
|
1851
|
+
|
|
1852
|
+
matchUtilities(
|
|
1853
|
+
{
|
|
1854
|
+
from: (value) => {
|
|
1855
|
+
return {
|
|
1856
|
+
'--tw-gradient-from-position': value,
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
},
|
|
1860
|
+
positionOptions
|
|
1861
|
+
)
|
|
1862
|
+
|
|
1373
1863
|
matchUtilities(
|
|
1374
1864
|
{
|
|
1375
1865
|
via: (value) => {
|
|
1376
1866
|
let transparentToValue = transparentTo(value)
|
|
1377
1867
|
|
|
1378
1868
|
return {
|
|
1869
|
+
'@defaults gradient-color-stops': {},
|
|
1870
|
+
'--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
|
|
1379
1871
|
'--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
|
|
1380
|
-
value
|
|
1381
|
-
|
|
1382
|
-
)}, var(--tw-gradient-to, ${transparentToValue})`,
|
|
1872
|
+
value
|
|
1873
|
+
)} var(--tw-gradient-via-position), var(--tw-gradient-to)`,
|
|
1383
1874
|
}
|
|
1384
1875
|
},
|
|
1385
1876
|
},
|
|
1386
1877
|
options
|
|
1387
1878
|
)
|
|
1879
|
+
|
|
1880
|
+
matchUtilities(
|
|
1881
|
+
{
|
|
1882
|
+
via: (value) => {
|
|
1883
|
+
return {
|
|
1884
|
+
'--tw-gradient-via-position': value,
|
|
1885
|
+
}
|
|
1886
|
+
},
|
|
1887
|
+
},
|
|
1888
|
+
positionOptions
|
|
1889
|
+
)
|
|
1890
|
+
|
|
1388
1891
|
matchUtilities(
|
|
1389
|
-
{
|
|
1892
|
+
{
|
|
1893
|
+
to: (value) => ({
|
|
1894
|
+
'@defaults gradient-color-stops': {},
|
|
1895
|
+
'--tw-gradient-to': `${toColorValue(value)} var(--tw-gradient-to-position)`,
|
|
1896
|
+
}),
|
|
1897
|
+
},
|
|
1390
1898
|
options
|
|
1391
1899
|
)
|
|
1900
|
+
|
|
1901
|
+
matchUtilities(
|
|
1902
|
+
{
|
|
1903
|
+
to: (value) => {
|
|
1904
|
+
return {
|
|
1905
|
+
'--tw-gradient-to-position': value,
|
|
1906
|
+
}
|
|
1907
|
+
},
|
|
1908
|
+
},
|
|
1909
|
+
positionOptions
|
|
1910
|
+
)
|
|
1392
1911
|
}
|
|
1393
1912
|
})(),
|
|
1394
1913
|
|
|
@@ -1402,7 +1921,7 @@ export let corePlugins = {
|
|
|
1402
1921
|
},
|
|
1403
1922
|
|
|
1404
1923
|
backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
|
|
1405
|
-
type: ['lookup', 'length', 'percentage'],
|
|
1924
|
+
type: ['lookup', 'length', 'percentage', 'size'],
|
|
1406
1925
|
}),
|
|
1407
1926
|
|
|
1408
1927
|
backgroundAttachment: ({ addUtilities }) => {
|
|
@@ -1423,7 +1942,7 @@ export let corePlugins = {
|
|
|
1423
1942
|
},
|
|
1424
1943
|
|
|
1425
1944
|
backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
|
|
1426
|
-
type: ['lookup', 'position'],
|
|
1945
|
+
type: ['lookup', ['position', { preferOnConflict: true }]],
|
|
1427
1946
|
}),
|
|
1428
1947
|
|
|
1429
1948
|
backgroundRepeat: ({ addUtilities }) => {
|
|
@@ -1463,7 +1982,7 @@ export let corePlugins = {
|
|
|
1463
1982
|
return { stroke: toColorValue(value) }
|
|
1464
1983
|
},
|
|
1465
1984
|
},
|
|
1466
|
-
{ values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
|
|
1985
|
+
{ values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
|
|
1467
1986
|
)
|
|
1468
1987
|
},
|
|
1469
1988
|
|
|
@@ -1489,6 +2008,8 @@ export let corePlugins = {
|
|
|
1489
2008
|
['py', ['padding-top', 'padding-bottom']],
|
|
1490
2009
|
],
|
|
1491
2010
|
[
|
|
2011
|
+
['ps', ['padding-inline-start']],
|
|
2012
|
+
['pe', ['padding-inline-end']],
|
|
1492
2013
|
['pt', ['padding-top']],
|
|
1493
2014
|
['pr', ['padding-right']],
|
|
1494
2015
|
['pb', ['padding-bottom']],
|
|
@@ -1502,6 +2023,8 @@ export let corePlugins = {
|
|
|
1502
2023
|
'.text-center': { 'text-align': 'center' },
|
|
1503
2024
|
'.text-right': { 'text-align': 'right' },
|
|
1504
2025
|
'.text-justify': { 'text-align': 'justify' },
|
|
2026
|
+
'.text-start': { 'text-align': 'start' },
|
|
2027
|
+
'.text-end': { 'text-align': 'end' },
|
|
1505
2028
|
})
|
|
1506
2029
|
},
|
|
1507
2030
|
|
|
@@ -1524,16 +2047,46 @@ export let corePlugins = {
|
|
|
1524
2047
|
matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
|
|
1525
2048
|
},
|
|
1526
2049
|
|
|
1527
|
-
fontFamily:
|
|
1528
|
-
|
|
1529
|
-
|
|
2050
|
+
fontFamily: ({ matchUtilities, theme }) => {
|
|
2051
|
+
matchUtilities(
|
|
2052
|
+
{
|
|
2053
|
+
font: (value) => {
|
|
2054
|
+
let [families, options = {}] =
|
|
2055
|
+
Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
|
|
2056
|
+
let { fontFeatureSettings, fontVariationSettings } = options
|
|
2057
|
+
|
|
2058
|
+
return {
|
|
2059
|
+
'font-family': Array.isArray(families) ? families.join(', ') : families,
|
|
2060
|
+
...(fontFeatureSettings === undefined
|
|
2061
|
+
? {}
|
|
2062
|
+
: { 'font-feature-settings': fontFeatureSettings }),
|
|
2063
|
+
...(fontVariationSettings === undefined
|
|
2064
|
+
? {}
|
|
2065
|
+
: { 'font-variation-settings': fontVariationSettings }),
|
|
2066
|
+
}
|
|
2067
|
+
},
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
values: theme('fontFamily'),
|
|
2071
|
+
type: ['lookup', 'generic-name', 'family-name'],
|
|
2072
|
+
}
|
|
2073
|
+
)
|
|
2074
|
+
},
|
|
1530
2075
|
|
|
1531
2076
|
fontSize: ({ matchUtilities, theme }) => {
|
|
1532
2077
|
matchUtilities(
|
|
1533
2078
|
{
|
|
1534
|
-
text: (value) => {
|
|
2079
|
+
text: (value, { modifier }) => {
|
|
1535
2080
|
let [fontSize, options] = Array.isArray(value) ? value : [value]
|
|
1536
|
-
|
|
2081
|
+
|
|
2082
|
+
if (modifier) {
|
|
2083
|
+
return {
|
|
2084
|
+
'font-size': fontSize,
|
|
2085
|
+
'line-height': modifier,
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
|
|
1537
2090
|
? options
|
|
1538
2091
|
: { lineHeight: options }
|
|
1539
2092
|
|
|
@@ -1541,18 +2094,20 @@ export let corePlugins = {
|
|
|
1541
2094
|
'font-size': fontSize,
|
|
1542
2095
|
...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
|
|
1543
2096
|
...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
|
|
2097
|
+
...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
|
|
1544
2098
|
}
|
|
1545
2099
|
},
|
|
1546
2100
|
},
|
|
1547
2101
|
{
|
|
1548
2102
|
values: theme('fontSize'),
|
|
2103
|
+
modifiers: theme('lineHeight'),
|
|
1549
2104
|
type: ['absolute-size', 'relative-size', 'length', 'percentage'],
|
|
1550
2105
|
}
|
|
1551
2106
|
)
|
|
1552
2107
|
},
|
|
1553
2108
|
|
|
1554
2109
|
fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
|
|
1555
|
-
type: ['lookup', 'number'],
|
|
2110
|
+
type: ['lookup', 'number', 'any'],
|
|
1556
2111
|
}),
|
|
1557
2112
|
|
|
1558
2113
|
textTransform: ({ addUtilities }) => {
|
|
@@ -1571,57 +2126,59 @@ export let corePlugins = {
|
|
|
1571
2126
|
})
|
|
1572
2127
|
},
|
|
1573
2128
|
|
|
1574
|
-
fontVariantNumeric: ({ addUtilities }) => {
|
|
2129
|
+
fontVariantNumeric: ({ addDefaults, addUtilities }) => {
|
|
2130
|
+
let cssFontVariantNumericValue =
|
|
2131
|
+
'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
|
|
2132
|
+
|
|
2133
|
+
addDefaults('font-variant-numeric', {
|
|
2134
|
+
'--tw-ordinal': ' ',
|
|
2135
|
+
'--tw-slashed-zero': ' ',
|
|
2136
|
+
'--tw-numeric-figure': ' ',
|
|
2137
|
+
'--tw-numeric-spacing': ' ',
|
|
2138
|
+
'--tw-numeric-fraction': ' ',
|
|
2139
|
+
})
|
|
2140
|
+
|
|
1575
2141
|
addUtilities({
|
|
1576
|
-
'@defaults font-variant-numeric': {
|
|
1577
|
-
'--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1578
|
-
'--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1579
|
-
'--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1580
|
-
'--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1581
|
-
'--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1582
|
-
'--tw-font-variant-numeric':
|
|
1583
|
-
'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
|
|
1584
|
-
},
|
|
1585
2142
|
'.normal-nums': { 'font-variant-numeric': 'normal' },
|
|
1586
2143
|
'.ordinal': {
|
|
1587
2144
|
'@defaults font-variant-numeric': {},
|
|
1588
2145
|
'--tw-ordinal': 'ordinal',
|
|
1589
|
-
'font-variant-numeric':
|
|
2146
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1590
2147
|
},
|
|
1591
2148
|
'.slashed-zero': {
|
|
1592
2149
|
'@defaults font-variant-numeric': {},
|
|
1593
2150
|
'--tw-slashed-zero': 'slashed-zero',
|
|
1594
|
-
'font-variant-numeric':
|
|
2151
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1595
2152
|
},
|
|
1596
2153
|
'.lining-nums': {
|
|
1597
2154
|
'@defaults font-variant-numeric': {},
|
|
1598
2155
|
'--tw-numeric-figure': 'lining-nums',
|
|
1599
|
-
'font-variant-numeric':
|
|
2156
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1600
2157
|
},
|
|
1601
2158
|
'.oldstyle-nums': {
|
|
1602
2159
|
'@defaults font-variant-numeric': {},
|
|
1603
2160
|
'--tw-numeric-figure': 'oldstyle-nums',
|
|
1604
|
-
'font-variant-numeric':
|
|
2161
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1605
2162
|
},
|
|
1606
2163
|
'.proportional-nums': {
|
|
1607
2164
|
'@defaults font-variant-numeric': {},
|
|
1608
2165
|
'--tw-numeric-spacing': 'proportional-nums',
|
|
1609
|
-
'font-variant-numeric':
|
|
2166
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1610
2167
|
},
|
|
1611
2168
|
'.tabular-nums': {
|
|
1612
2169
|
'@defaults font-variant-numeric': {},
|
|
1613
2170
|
'--tw-numeric-spacing': 'tabular-nums',
|
|
1614
|
-
'font-variant-numeric':
|
|
2171
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1615
2172
|
},
|
|
1616
2173
|
'.diagonal-fractions': {
|
|
1617
2174
|
'@defaults font-variant-numeric': {},
|
|
1618
2175
|
'--tw-numeric-fraction': 'diagonal-fractions',
|
|
1619
|
-
'font-variant-numeric':
|
|
2176
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1620
2177
|
},
|
|
1621
2178
|
'.stacked-fractions': {
|
|
1622
2179
|
'@defaults font-variant-numeric': {},
|
|
1623
2180
|
'--tw-numeric-fraction': 'stacked-fractions',
|
|
1624
|
-
'font-variant-numeric':
|
|
2181
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1625
2182
|
},
|
|
1626
2183
|
})
|
|
1627
2184
|
},
|
|
@@ -1646,7 +2203,7 @@ export let corePlugins = {
|
|
|
1646
2203
|
})
|
|
1647
2204
|
},
|
|
1648
2205
|
},
|
|
1649
|
-
{ values: flattenColorPalette(theme('textColor')), type: 'color' }
|
|
2206
|
+
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
|
|
1650
2207
|
)
|
|
1651
2208
|
},
|
|
1652
2209
|
|
|
@@ -1668,7 +2225,7 @@ export let corePlugins = {
|
|
|
1668
2225
|
return { 'text-decoration-color': toColorValue(value) }
|
|
1669
2226
|
},
|
|
1670
2227
|
},
|
|
1671
|
-
{ values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
|
|
2228
|
+
{ values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
|
|
1672
2229
|
)
|
|
1673
2230
|
},
|
|
1674
2231
|
|
|
@@ -1691,7 +2248,7 @@ export let corePlugins = {
|
|
|
1691
2248
|
textUnderlineOffset: createUtilityPlugin(
|
|
1692
2249
|
'textUnderlineOffset',
|
|
1693
2250
|
[['underline-offset', ['text-underline-offset']]],
|
|
1694
|
-
{ type: ['length', 'percentage'] }
|
|
2251
|
+
{ type: ['length', 'percentage', 'any'] }
|
|
1695
2252
|
),
|
|
1696
2253
|
|
|
1697
2254
|
fontSmoothing: ({ addUtilities }) => {
|
|
@@ -1806,6 +2363,8 @@ export let corePlugins = {
|
|
|
1806
2363
|
'.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
|
|
1807
2364
|
'.mix-blend-color': { 'mix-blend-mode': 'color' },
|
|
1808
2365
|
'.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
|
|
2366
|
+
'.mix-blend-plus-darker': { 'mix-blend-mode': 'plus-darker' },
|
|
2367
|
+
'.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
|
|
1809
2368
|
})
|
|
1810
2369
|
},
|
|
1811
2370
|
|
|
@@ -1818,7 +2377,7 @@ export let corePlugins = {
|
|
|
1818
2377
|
].join(', ')
|
|
1819
2378
|
|
|
1820
2379
|
return function ({ matchUtilities, addDefaults, theme }) {
|
|
1821
|
-
addDefaults('
|
|
2380
|
+
addDefaults('box-shadow', {
|
|
1822
2381
|
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
1823
2382
|
'--tw-ring-shadow': '0 0 #0000',
|
|
1824
2383
|
'--tw-shadow': '0 0 #0000',
|
|
@@ -1863,7 +2422,7 @@ export let corePlugins = {
|
|
|
1863
2422
|
}
|
|
1864
2423
|
},
|
|
1865
2424
|
},
|
|
1866
|
-
{ values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
|
|
2425
|
+
{ values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
|
|
1867
2426
|
)
|
|
1868
2427
|
},
|
|
1869
2428
|
|
|
@@ -1877,7 +2436,6 @@ export let corePlugins = {
|
|
|
1877
2436
|
'.outline-dashed': { 'outline-style': 'dashed' },
|
|
1878
2437
|
'.outline-dotted': { 'outline-style': 'dotted' },
|
|
1879
2438
|
'.outline-double': { 'outline-style': 'double' },
|
|
1880
|
-
'.outline-hidden': { 'outline-style': 'hidden' },
|
|
1881
2439
|
})
|
|
1882
2440
|
},
|
|
1883
2441
|
|
|
@@ -1886,7 +2444,8 @@ export let corePlugins = {
|
|
|
1886
2444
|
}),
|
|
1887
2445
|
|
|
1888
2446
|
outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
|
|
1889
|
-
type: ['length', 'number', 'percentage'],
|
|
2447
|
+
type: ['length', 'number', 'percentage', 'any'],
|
|
2448
|
+
supportsNegativeValues: true,
|
|
1890
2449
|
}),
|
|
1891
2450
|
|
|
1892
2451
|
outlineColor: ({ matchUtilities, theme }) => {
|
|
@@ -1896,20 +2455,31 @@ export let corePlugins = {
|
|
|
1896
2455
|
return { 'outline-color': toColorValue(value) }
|
|
1897
2456
|
},
|
|
1898
2457
|
},
|
|
1899
|
-
{ values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
|
|
2458
|
+
{ values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
|
|
1900
2459
|
)
|
|
1901
2460
|
},
|
|
1902
2461
|
|
|
1903
|
-
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
|
|
1904
|
-
let
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
2462
|
+
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
|
|
2463
|
+
let ringColorDefault = (() => {
|
|
2464
|
+
if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
|
|
2465
|
+
return theme('ringColor.DEFAULT')
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
|
|
2469
|
+
|
|
2470
|
+
if (!theme('ringColor')?.DEFAULT) {
|
|
2471
|
+
return `rgb(147 197 253 / ${ringOpacityDefault})`
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
return withAlphaValue(
|
|
2475
|
+
theme('ringColor')?.DEFAULT,
|
|
2476
|
+
ringOpacityDefault,
|
|
2477
|
+
`rgb(147 197 253 / ${ringOpacityDefault})`
|
|
2478
|
+
)
|
|
2479
|
+
})()
|
|
1910
2480
|
|
|
1911
2481
|
addDefaults('ring-width', {
|
|
1912
|
-
'--tw-ring-inset': '
|
|
2482
|
+
'--tw-ring-inset': ' ',
|
|
1913
2483
|
'--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
|
|
1914
2484
|
'--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
|
|
1915
2485
|
'--tw-ring-color': ringColorDefault,
|
|
@@ -1942,10 +2512,16 @@ export let corePlugins = {
|
|
|
1942
2512
|
})
|
|
1943
2513
|
},
|
|
1944
2514
|
|
|
1945
|
-
ringColor: ({ matchUtilities, theme }) => {
|
|
2515
|
+
ringColor: ({ matchUtilities, theme, corePlugins }) => {
|
|
1946
2516
|
matchUtilities(
|
|
1947
2517
|
{
|
|
1948
2518
|
ring: (value) => {
|
|
2519
|
+
if (!corePlugins('ringOpacity')) {
|
|
2520
|
+
return {
|
|
2521
|
+
'--tw-ring-color': toColorValue(value),
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
|
|
1949
2525
|
return withAlphaVariable({
|
|
1950
2526
|
color: value,
|
|
1951
2527
|
property: '--tw-ring-color',
|
|
@@ -1959,14 +2535,18 @@ export let corePlugins = {
|
|
|
1959
2535
|
([modifier]) => modifier !== 'DEFAULT'
|
|
1960
2536
|
)
|
|
1961
2537
|
),
|
|
1962
|
-
type: 'color',
|
|
2538
|
+
type: ['color', 'any'],
|
|
1963
2539
|
}
|
|
1964
2540
|
)
|
|
1965
2541
|
},
|
|
1966
2542
|
|
|
1967
|
-
ringOpacity:
|
|
1968
|
-
|
|
1969
|
-
|
|
2543
|
+
ringOpacity: (helpers) => {
|
|
2544
|
+
let { config } = helpers
|
|
2545
|
+
|
|
2546
|
+
return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
|
|
2547
|
+
filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
|
|
2548
|
+
})(helpers)
|
|
2549
|
+
},
|
|
1970
2550
|
ringOffsetWidth: createUtilityPlugin(
|
|
1971
2551
|
'ringOffsetWidth',
|
|
1972
2552
|
[['ring-offset', ['--tw-ring-offset-width']]],
|
|
@@ -1982,7 +2562,7 @@ export let corePlugins = {
|
|
|
1982
2562
|
}
|
|
1983
2563
|
},
|
|
1984
2564
|
},
|
|
1985
|
-
{ values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
|
|
2565
|
+
{ values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
|
|
1986
2566
|
)
|
|
1987
2567
|
},
|
|
1988
2568
|
|
|
@@ -1993,7 +2573,7 @@ export let corePlugins = {
|
|
|
1993
2573
|
return {
|
|
1994
2574
|
'--tw-blur': `blur(${value})`,
|
|
1995
2575
|
'@defaults filter': {},
|
|
1996
|
-
filter:
|
|
2576
|
+
filter: cssFilterValue,
|
|
1997
2577
|
}
|
|
1998
2578
|
},
|
|
1999
2579
|
},
|
|
@@ -2008,7 +2588,7 @@ export let corePlugins = {
|
|
|
2008
2588
|
return {
|
|
2009
2589
|
'--tw-brightness': `brightness(${value})`,
|
|
2010
2590
|
'@defaults filter': {},
|
|
2011
|
-
filter:
|
|
2591
|
+
filter: cssFilterValue,
|
|
2012
2592
|
}
|
|
2013
2593
|
},
|
|
2014
2594
|
},
|
|
@@ -2023,7 +2603,7 @@ export let corePlugins = {
|
|
|
2023
2603
|
return {
|
|
2024
2604
|
'--tw-contrast': `contrast(${value})`,
|
|
2025
2605
|
'@defaults filter': {},
|
|
2026
|
-
filter:
|
|
2606
|
+
filter: cssFilterValue,
|
|
2027
2607
|
}
|
|
2028
2608
|
},
|
|
2029
2609
|
},
|
|
@@ -2040,7 +2620,7 @@ export let corePlugins = {
|
|
|
2040
2620
|
? value.map((v) => `drop-shadow(${v})`).join(' ')
|
|
2041
2621
|
: `drop-shadow(${value})`,
|
|
2042
2622
|
'@defaults filter': {},
|
|
2043
|
-
filter:
|
|
2623
|
+
filter: cssFilterValue,
|
|
2044
2624
|
}
|
|
2045
2625
|
},
|
|
2046
2626
|
},
|
|
@@ -2055,7 +2635,7 @@ export let corePlugins = {
|
|
|
2055
2635
|
return {
|
|
2056
2636
|
'--tw-grayscale': `grayscale(${value})`,
|
|
2057
2637
|
'@defaults filter': {},
|
|
2058
|
-
filter:
|
|
2638
|
+
filter: cssFilterValue,
|
|
2059
2639
|
}
|
|
2060
2640
|
},
|
|
2061
2641
|
},
|
|
@@ -2070,7 +2650,7 @@ export let corePlugins = {
|
|
|
2070
2650
|
return {
|
|
2071
2651
|
'--tw-hue-rotate': `hue-rotate(${value})`,
|
|
2072
2652
|
'@defaults filter': {},
|
|
2073
|
-
filter:
|
|
2653
|
+
filter: cssFilterValue,
|
|
2074
2654
|
}
|
|
2075
2655
|
},
|
|
2076
2656
|
},
|
|
@@ -2085,7 +2665,7 @@ export let corePlugins = {
|
|
|
2085
2665
|
return {
|
|
2086
2666
|
'--tw-invert': `invert(${value})`,
|
|
2087
2667
|
'@defaults filter': {},
|
|
2088
|
-
filter:
|
|
2668
|
+
filter: cssFilterValue,
|
|
2089
2669
|
}
|
|
2090
2670
|
},
|
|
2091
2671
|
},
|
|
@@ -2100,7 +2680,7 @@ export let corePlugins = {
|
|
|
2100
2680
|
return {
|
|
2101
2681
|
'--tw-saturate': `saturate(${value})`,
|
|
2102
2682
|
'@defaults filter': {},
|
|
2103
|
-
filter:
|
|
2683
|
+
filter: cssFilterValue,
|
|
2104
2684
|
}
|
|
2105
2685
|
},
|
|
2106
2686
|
},
|
|
@@ -2115,7 +2695,7 @@ export let corePlugins = {
|
|
|
2115
2695
|
return {
|
|
2116
2696
|
'--tw-sepia': `sepia(${value})`,
|
|
2117
2697
|
'@defaults filter': {},
|
|
2118
|
-
filter:
|
|
2698
|
+
filter: cssFilterValue,
|
|
2119
2699
|
}
|
|
2120
2700
|
},
|
|
2121
2701
|
},
|
|
@@ -2125,29 +2705,18 @@ export let corePlugins = {
|
|
|
2125
2705
|
|
|
2126
2706
|
filter: ({ addDefaults, addUtilities }) => {
|
|
2127
2707
|
addDefaults('filter', {
|
|
2128
|
-
'--tw-blur': '
|
|
2129
|
-
'--tw-brightness': '
|
|
2130
|
-
'--tw-contrast': '
|
|
2131
|
-
'--tw-grayscale': '
|
|
2132
|
-
'--tw-hue-rotate': '
|
|
2133
|
-
'--tw-invert': '
|
|
2134
|
-
'--tw-saturate': '
|
|
2135
|
-
'--tw-sepia': '
|
|
2136
|
-
'--tw-drop-shadow': '
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
'var(--tw-contrast)',
|
|
2141
|
-
'var(--tw-grayscale)',
|
|
2142
|
-
'var(--tw-hue-rotate)',
|
|
2143
|
-
'var(--tw-invert)',
|
|
2144
|
-
'var(--tw-saturate)',
|
|
2145
|
-
'var(--tw-sepia)',
|
|
2146
|
-
'var(--tw-drop-shadow)',
|
|
2147
|
-
].join(' '),
|
|
2148
|
-
})
|
|
2149
|
-
addUtilities({
|
|
2150
|
-
'.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
|
|
2708
|
+
'--tw-blur': ' ',
|
|
2709
|
+
'--tw-brightness': ' ',
|
|
2710
|
+
'--tw-contrast': ' ',
|
|
2711
|
+
'--tw-grayscale': ' ',
|
|
2712
|
+
'--tw-hue-rotate': ' ',
|
|
2713
|
+
'--tw-invert': ' ',
|
|
2714
|
+
'--tw-saturate': ' ',
|
|
2715
|
+
'--tw-sepia': ' ',
|
|
2716
|
+
'--tw-drop-shadow': ' ',
|
|
2717
|
+
})
|
|
2718
|
+
addUtilities({
|
|
2719
|
+
'.filter': { '@defaults filter': {}, filter: cssFilterValue },
|
|
2151
2720
|
'.filter-none': { filter: 'none' },
|
|
2152
2721
|
})
|
|
2153
2722
|
},
|
|
@@ -2159,7 +2728,7 @@ export let corePlugins = {
|
|
|
2159
2728
|
return {
|
|
2160
2729
|
'--tw-backdrop-blur': `blur(${value})`,
|
|
2161
2730
|
'@defaults backdrop-filter': {},
|
|
2162
|
-
'backdrop-filter':
|
|
2731
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2163
2732
|
}
|
|
2164
2733
|
},
|
|
2165
2734
|
},
|
|
@@ -2174,7 +2743,7 @@ export let corePlugins = {
|
|
|
2174
2743
|
return {
|
|
2175
2744
|
'--tw-backdrop-brightness': `brightness(${value})`,
|
|
2176
2745
|
'@defaults backdrop-filter': {},
|
|
2177
|
-
'backdrop-filter':
|
|
2746
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2178
2747
|
}
|
|
2179
2748
|
},
|
|
2180
2749
|
},
|
|
@@ -2189,7 +2758,7 @@ export let corePlugins = {
|
|
|
2189
2758
|
return {
|
|
2190
2759
|
'--tw-backdrop-contrast': `contrast(${value})`,
|
|
2191
2760
|
'@defaults backdrop-filter': {},
|
|
2192
|
-
'backdrop-filter':
|
|
2761
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2193
2762
|
}
|
|
2194
2763
|
},
|
|
2195
2764
|
},
|
|
@@ -2204,7 +2773,7 @@ export let corePlugins = {
|
|
|
2204
2773
|
return {
|
|
2205
2774
|
'--tw-backdrop-grayscale': `grayscale(${value})`,
|
|
2206
2775
|
'@defaults backdrop-filter': {},
|
|
2207
|
-
'backdrop-filter':
|
|
2776
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2208
2777
|
}
|
|
2209
2778
|
},
|
|
2210
2779
|
},
|
|
@@ -2219,7 +2788,7 @@ export let corePlugins = {
|
|
|
2219
2788
|
return {
|
|
2220
2789
|
'--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
|
|
2221
2790
|
'@defaults backdrop-filter': {},
|
|
2222
|
-
'backdrop-filter':
|
|
2791
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2223
2792
|
}
|
|
2224
2793
|
},
|
|
2225
2794
|
},
|
|
@@ -2234,7 +2803,7 @@ export let corePlugins = {
|
|
|
2234
2803
|
return {
|
|
2235
2804
|
'--tw-backdrop-invert': `invert(${value})`,
|
|
2236
2805
|
'@defaults backdrop-filter': {},
|
|
2237
|
-
'backdrop-filter':
|
|
2806
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2238
2807
|
}
|
|
2239
2808
|
},
|
|
2240
2809
|
},
|
|
@@ -2249,7 +2818,7 @@ export let corePlugins = {
|
|
|
2249
2818
|
return {
|
|
2250
2819
|
'--tw-backdrop-opacity': `opacity(${value})`,
|
|
2251
2820
|
'@defaults backdrop-filter': {},
|
|
2252
|
-
'backdrop-filter':
|
|
2821
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2253
2822
|
}
|
|
2254
2823
|
},
|
|
2255
2824
|
},
|
|
@@ -2264,7 +2833,7 @@ export let corePlugins = {
|
|
|
2264
2833
|
return {
|
|
2265
2834
|
'--tw-backdrop-saturate': `saturate(${value})`,
|
|
2266
2835
|
'@defaults backdrop-filter': {},
|
|
2267
|
-
'backdrop-filter':
|
|
2836
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2268
2837
|
}
|
|
2269
2838
|
},
|
|
2270
2839
|
},
|
|
@@ -2279,7 +2848,7 @@ export let corePlugins = {
|
|
|
2279
2848
|
return {
|
|
2280
2849
|
'--tw-backdrop-sepia': `sepia(${value})`,
|
|
2281
2850
|
'@defaults backdrop-filter': {},
|
|
2282
|
-
'backdrop-filter':
|
|
2851
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2283
2852
|
}
|
|
2284
2853
|
},
|
|
2285
2854
|
},
|
|
@@ -2289,31 +2858,20 @@ export let corePlugins = {
|
|
|
2289
2858
|
|
|
2290
2859
|
backdropFilter: ({ addDefaults, addUtilities }) => {
|
|
2291
2860
|
addDefaults('backdrop-filter', {
|
|
2292
|
-
'--tw-backdrop-blur': '
|
|
2293
|
-
'--tw-backdrop-brightness': '
|
|
2294
|
-
'--tw-backdrop-contrast': '
|
|
2295
|
-
'--tw-backdrop-grayscale': '
|
|
2296
|
-
'--tw-backdrop-hue-rotate': '
|
|
2297
|
-
'--tw-backdrop-invert': '
|
|
2298
|
-
'--tw-backdrop-opacity': '
|
|
2299
|
-
'--tw-backdrop-saturate': '
|
|
2300
|
-
'--tw-backdrop-sepia': '
|
|
2301
|
-
'--tw-backdrop-filter': [
|
|
2302
|
-
'var(--tw-backdrop-blur)',
|
|
2303
|
-
'var(--tw-backdrop-brightness)',
|
|
2304
|
-
'var(--tw-backdrop-contrast)',
|
|
2305
|
-
'var(--tw-backdrop-grayscale)',
|
|
2306
|
-
'var(--tw-backdrop-hue-rotate)',
|
|
2307
|
-
'var(--tw-backdrop-invert)',
|
|
2308
|
-
'var(--tw-backdrop-opacity)',
|
|
2309
|
-
'var(--tw-backdrop-saturate)',
|
|
2310
|
-
'var(--tw-backdrop-sepia)',
|
|
2311
|
-
].join(' '),
|
|
2861
|
+
'--tw-backdrop-blur': ' ',
|
|
2862
|
+
'--tw-backdrop-brightness': ' ',
|
|
2863
|
+
'--tw-backdrop-contrast': ' ',
|
|
2864
|
+
'--tw-backdrop-grayscale': ' ',
|
|
2865
|
+
'--tw-backdrop-hue-rotate': ' ',
|
|
2866
|
+
'--tw-backdrop-invert': ' ',
|
|
2867
|
+
'--tw-backdrop-opacity': ' ',
|
|
2868
|
+
'--tw-backdrop-saturate': ' ',
|
|
2869
|
+
'--tw-backdrop-sepia': ' ',
|
|
2312
2870
|
})
|
|
2313
2871
|
addUtilities({
|
|
2314
2872
|
'.backdrop-filter': {
|
|
2315
2873
|
'@defaults backdrop-filter': {},
|
|
2316
|
-
'backdrop-filter':
|
|
2874
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2317
2875
|
},
|
|
2318
2876
|
'.backdrop-filter-none': { 'backdrop-filter': 'none' },
|
|
2319
2877
|
})
|
|
@@ -2353,7 +2911,55 @@ export let corePlugins = {
|
|
|
2353
2911
|
{ filterDefault: true }
|
|
2354
2912
|
),
|
|
2355
2913
|
willChange: createUtilityPlugin('willChange', [['will-change', ['will-change']]]),
|
|
2914
|
+
contain: ({ addDefaults, addUtilities }) => {
|
|
2915
|
+
let cssContainValue =
|
|
2916
|
+
'var(--tw-contain-size) var(--tw-contain-layout) var(--tw-contain-paint) var(--tw-contain-style)'
|
|
2917
|
+
|
|
2918
|
+
addDefaults('contain', {
|
|
2919
|
+
'--tw-contain-size': ' ',
|
|
2920
|
+
'--tw-contain-layout': ' ',
|
|
2921
|
+
'--tw-contain-paint': ' ',
|
|
2922
|
+
'--tw-contain-style': ' ',
|
|
2923
|
+
})
|
|
2924
|
+
|
|
2925
|
+
addUtilities({
|
|
2926
|
+
'.contain-none': { contain: 'none' },
|
|
2927
|
+
'.contain-content': { contain: 'content' },
|
|
2928
|
+
'.contain-strict': { contain: 'strict' },
|
|
2929
|
+
'.contain-size': {
|
|
2930
|
+
'@defaults contain': {},
|
|
2931
|
+
'--tw-contain-size': 'size',
|
|
2932
|
+
contain: cssContainValue,
|
|
2933
|
+
},
|
|
2934
|
+
'.contain-inline-size': {
|
|
2935
|
+
'@defaults contain': {},
|
|
2936
|
+
'--tw-contain-size': 'inline-size',
|
|
2937
|
+
contain: cssContainValue,
|
|
2938
|
+
},
|
|
2939
|
+
'.contain-layout': {
|
|
2940
|
+
'@defaults contain': {},
|
|
2941
|
+
'--tw-contain-layout': 'layout',
|
|
2942
|
+
contain: cssContainValue,
|
|
2943
|
+
},
|
|
2944
|
+
'.contain-paint': {
|
|
2945
|
+
'@defaults contain': {},
|
|
2946
|
+
'--tw-contain-paint': 'paint',
|
|
2947
|
+
contain: cssContainValue,
|
|
2948
|
+
},
|
|
2949
|
+
'.contain-style': {
|
|
2950
|
+
'@defaults contain': {},
|
|
2951
|
+
'--tw-contain-style': 'style',
|
|
2952
|
+
contain: cssContainValue,
|
|
2953
|
+
},
|
|
2954
|
+
})
|
|
2955
|
+
},
|
|
2356
2956
|
content: createUtilityPlugin('content', [
|
|
2357
2957
|
['content', ['--tw-content', ['content', 'var(--tw-content)']]],
|
|
2358
2958
|
]),
|
|
2959
|
+
forcedColorAdjust: ({ addUtilities }) => {
|
|
2960
|
+
addUtilities({
|
|
2961
|
+
'.forced-color-adjust-auto': { 'forced-color-adjust': 'auto' },
|
|
2962
|
+
'.forced-color-adjust-none': { 'forced-color-adjust': 'none' },
|
|
2963
|
+
})
|
|
2964
|
+
},
|
|
2359
2965
|
}
|