tailwindcss 0.0.0-insiders.ea139f2 → 0.0.0-insiders.ea3d9cd
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 +15 -7
- package/colors.d.ts +3 -0
- package/colors.js +2 -1
- package/defaultConfig.d.ts +3 -0
- package/defaultConfig.js +2 -1
- package/defaultTheme.d.ts +4 -0
- package/defaultTheme.js +2 -1
- package/index.css +5 -0
- package/lib/cli/build/index.js +57 -0
- package/lib/cli/build/plugin.js +381 -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 +231 -0
- package/lib/cli/init/index.js +63 -0
- package/lib/cli.js +1 -704
- package/lib/corePluginList.js +13 -3
- package/lib/corePlugins.js +2399 -1865
- package/lib/css/preflight.css +17 -9
- package/lib/featureFlags.js +50 -26
- package/lib/index.js +1 -31
- package/lib/lib/cacheInvalidation.js +92 -0
- package/lib/lib/collapseAdjacentRules.js +30 -10
- package/lib/lib/collapseDuplicateDeclarations.js +60 -4
- package/lib/lib/content.js +207 -0
- package/lib/lib/defaultExtractor.js +243 -0
- package/lib/lib/detectNesting.js +21 -10
- package/lib/lib/evaluateTailwindFunctions.js +117 -50
- package/lib/lib/expandApplyAtRules.js +467 -161
- package/lib/lib/expandTailwindAtRules.js +200 -133
- package/lib/lib/findAtConfigPath.js +46 -0
- package/lib/lib/generateRules.js +550 -200
- package/lib/lib/getModuleDependencies.js +88 -37
- package/lib/lib/handleImportAtRules.js +50 -0
- package/lib/lib/load-config.js +42 -0
- package/lib/lib/normalizeTailwindDirectives.js +36 -38
- package/lib/lib/offsets.js +306 -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 +98 -58
- package/lib/lib/setupContextUtils.js +767 -325
- package/lib/lib/setupTrackingContext.js +71 -75
- package/lib/lib/sharedState.js +70 -10
- package/lib/lib/substituteScreenAtRules.js +14 -10
- package/lib/plugin.js +116 -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 +39 -26
- 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 +23 -3
- package/lib/util/color.js +70 -38
- 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 +182 -109
- package/lib/util/defaults.js +14 -3
- 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 +228 -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 +7 -2
- package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +25 -15
- package/lib/util/log.js +44 -13
- package/lib/util/nameClass.js +27 -10
- package/lib/util/negateValue.js +25 -8
- package/lib/util/normalizeConfig.js +167 -67
- package/lib/util/normalizeScreens.js +131 -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 +157 -69
- package/lib/util/prefixSelector.js +30 -12
- package/lib/util/pseudoElements.js +209 -0
- package/lib/util/removeAlphaVariables.js +31 -0
- package/lib/util/resolveConfig.js +97 -75
- 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 +26 -3
- package/lib/util/transformThemeValue.js +40 -30
- package/lib/util/validateConfig.js +48 -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.js +2 -12
- package/package.json +61 -59
- package/plugin.d.ts +11 -0
- package/plugin.js +2 -1
- package/resolveConfig.d.ts +12 -0
- package/resolveConfig.js +2 -1
- package/scripts/generate-types.js +105 -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/index.js +53 -0
- package/src/cli/build/plugin.js +457 -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 +217 -0
- package/src/cli/init/index.js +79 -0
- package/src/cli.js +1 -766
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +816 -308
- package/src/css/preflight.css +17 -9
- package/src/featureFlags.js +20 -6
- package/src/index.js +1 -34
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +21 -2
- package/src/lib/collapseDuplicateDeclarations.js +66 -1
- package/src/lib/content.js +240 -0
- package/src/lib/defaultExtractor.js +217 -0
- package/src/lib/detectNesting.js +9 -1
- package/src/lib/evaluateTailwindFunctions.js +83 -9
- package/src/lib/expandApplyAtRules.js +515 -153
- package/src/lib/expandTailwindAtRules.js +147 -86
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +541 -147
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/handleImportAtRules.js +34 -0
- package/src/lib/load-config.ts +31 -0
- package/src/lib/normalizeTailwindDirectives.js +5 -26
- package/src/lib/offsets.js +373 -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 +59 -17
- package/src/lib/setupContextUtils.js +693 -176
- package/src/lib/setupTrackingContext.js +52 -65
- package/src/lib/sharedState.js +54 -7
- package/src/plugin.js +124 -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 +12 -2
- 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 +19 -2
- package/src/util/color.js +44 -12
- package/src/util/colorNames.js +150 -0
- package/src/util/dataTypes.js +64 -18
- package/src/util/defaults.js +6 -0
- package/src/util/formatVariantSelector.js +264 -144
- package/src/util/getAllConfigs.js +21 -2
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +35 -7
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +11 -3
- package/src/util/normalizeConfig.js +86 -7
- package/src/util/normalizeScreens.js +105 -7
- 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 +118 -23
- package/src/util/prefixSelector.js +30 -10
- package/src/util/pseudoElements.js +167 -0
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +74 -26
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +52 -0
- package/src/util/toPath.js +23 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +36 -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} +220 -167
- package/stubs/{simpleConfig.stub.js → config.simple.js} +1 -1
- package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -1
- package/stubs/postcss.config.js +5 -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 +369 -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 +372 -0
- package/types/index.d.ts +7 -0
- package/CHANGELOG.md +0 -1843
- package/lib/cli-peer-dependencies.js +0 -15
- package/lib/constants.js +0 -37
- package/lib/lib/setupWatchingContext.js +0 -288
- package/nesting/plugin.js +0 -41
- package/peers/index.js +0 -76015
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/cli-peer-dependencies.js +0 -9
- package/src/constants.js +0 -17
- package/src/lib/setupWatchingContext.js +0 -311
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,43 @@ 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'
|
|
16
25
|
|
|
17
26
|
export let variantPlugins = {
|
|
18
27
|
pseudoElementVariants: ({ addVariant }) => {
|
|
19
28
|
addVariant('first-letter', '&::first-letter')
|
|
20
29
|
addVariant('first-line', '&::first-line')
|
|
21
30
|
|
|
22
|
-
addVariant('marker', [
|
|
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
|
+
|
|
23
44
|
addVariant('selection', ['& *::selection', '&::selection'])
|
|
24
45
|
|
|
25
46
|
addVariant('file', '&::file-selector-button')
|
|
26
47
|
|
|
27
48
|
addVariant('placeholder', '&::placeholder')
|
|
28
49
|
|
|
50
|
+
addVariant('backdrop', '&::backdrop')
|
|
51
|
+
|
|
29
52
|
addVariant('before', ({ container }) => {
|
|
30
53
|
container.walkRules((rule) => {
|
|
31
54
|
let foundContent = false
|
|
@@ -57,22 +80,33 @@ export let variantPlugins = {
|
|
|
57
80
|
})
|
|
58
81
|
},
|
|
59
82
|
|
|
60
|
-
pseudoClassVariants: ({ addVariant }) => {
|
|
83
|
+
pseudoClassVariants: ({ addVariant, matchVariant, config }) => {
|
|
61
84
|
let pseudoVariants = [
|
|
62
85
|
// Positional
|
|
63
|
-
['first', '
|
|
64
|
-
['last', '
|
|
65
|
-
['only', '
|
|
66
|
-
['odd', '
|
|
67
|
-
['even', '
|
|
86
|
+
['first', '&:first-child'],
|
|
87
|
+
['last', '&:last-child'],
|
|
88
|
+
['only', '&:only-child'],
|
|
89
|
+
['odd', '&:nth-child(odd)'],
|
|
90
|
+
['even', '&:nth-child(even)'],
|
|
68
91
|
'first-of-type',
|
|
69
92
|
'last-of-type',
|
|
70
93
|
'only-of-type',
|
|
71
94
|
|
|
72
95
|
// State
|
|
73
|
-
|
|
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
|
+
],
|
|
74
108
|
'target',
|
|
75
|
-
['open', '[open]'],
|
|
109
|
+
['open', '&[open]'],
|
|
76
110
|
|
|
77
111
|
// Forms
|
|
78
112
|
'default',
|
|
@@ -80,6 +114,7 @@ export let variantPlugins = {
|
|
|
80
114
|
'indeterminate',
|
|
81
115
|
'placeholder-shown',
|
|
82
116
|
'autofill',
|
|
117
|
+
'optional',
|
|
83
118
|
'required',
|
|
84
119
|
'valid',
|
|
85
120
|
'invalid',
|
|
@@ -92,44 +127,79 @@ export let variantPlugins = {
|
|
|
92
127
|
|
|
93
128
|
// Interactive
|
|
94
129
|
'focus-within',
|
|
95
|
-
|
|
130
|
+
[
|
|
131
|
+
'hover',
|
|
132
|
+
!flagEnabled(config(), 'hoverOnlyWhenSupported')
|
|
133
|
+
? '&:hover'
|
|
134
|
+
: '@media (hover: hover) and (pointer: fine) { &:hover }',
|
|
135
|
+
],
|
|
96
136
|
'focus',
|
|
97
137
|
'focus-visible',
|
|
98
138
|
'active',
|
|
139
|
+
'enabled',
|
|
99
140
|
'disabled',
|
|
100
|
-
].map((variant) => (Array.isArray(variant) ? variant : [variant,
|
|
141
|
+
].map((variant) => (Array.isArray(variant) ? variant : [variant, `&:${variant}`]))
|
|
101
142
|
|
|
102
143
|
for (let [variantName, state] of pseudoVariants) {
|
|
103
|
-
addVariant(variantName,
|
|
104
|
-
|
|
144
|
+
addVariant(variantName, (ctx) => {
|
|
145
|
+
let result = typeof state === 'function' ? state(ctx) : state
|
|
105
146
|
|
|
106
|
-
|
|
107
|
-
|
|
147
|
+
return result
|
|
148
|
+
})
|
|
108
149
|
}
|
|
109
150
|
|
|
110
|
-
|
|
111
|
-
|
|
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)`, ' ~ &'],
|
|
112
160
|
}
|
|
113
|
-
},
|
|
114
161
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
+
}
|
|
121
185
|
|
|
122
|
-
|
|
123
|
-
|
|
186
|
+
if (start !== null && end === null) {
|
|
187
|
+
end = result.length
|
|
188
|
+
}
|
|
124
189
|
|
|
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
|
-
])
|
|
190
|
+
// Basically this but can handle quotes:
|
|
191
|
+
// result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
|
|
130
192
|
|
|
131
|
-
|
|
132
|
-
|
|
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"] &)')
|
|
133
203
|
},
|
|
134
204
|
|
|
135
205
|
reducedMotionVariants: ({ addVariant }) => {
|
|
@@ -138,17 +208,19 @@ export let variantPlugins = {
|
|
|
138
208
|
},
|
|
139
209
|
|
|
140
210
|
darkVariants: ({ config, addVariant }) => {
|
|
141
|
-
let mode = config('darkMode', 'media')
|
|
211
|
+
let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
|
|
212
|
+
|
|
142
213
|
if (mode === false) {
|
|
143
214
|
mode = 'media'
|
|
144
215
|
log.warn('darkmode-false', [
|
|
145
216
|
'The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.',
|
|
146
217
|
'Change `darkMode` to `media` or remove it entirely.',
|
|
218
|
+
'https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration',
|
|
147
219
|
])
|
|
148
220
|
}
|
|
149
221
|
|
|
150
222
|
if (mode === 'class') {
|
|
151
|
-
addVariant('dark',
|
|
223
|
+
addVariant('dark', `:is(${className} &)`)
|
|
152
224
|
} else if (mode === 'media') {
|
|
153
225
|
addVariant('dark', '@media (prefers-color-scheme: dark)')
|
|
154
226
|
}
|
|
@@ -158,20 +230,266 @@ export let variantPlugins = {
|
|
|
158
230
|
addVariant('print', '@media print')
|
|
159
231
|
},
|
|
160
232
|
|
|
161
|
-
screenVariants: ({ theme, addVariant }) => {
|
|
162
|
-
|
|
163
|
-
|
|
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
|
+
}
|
|
164
338
|
|
|
165
|
-
|
|
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
|
+
})
|
|
166
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
|
+
hasVariants: ({ matchVariant }) => {
|
|
390
|
+
matchVariant('has', (value) => `&:has(${normalize(value)})`, { values: {} })
|
|
391
|
+
matchVariant(
|
|
392
|
+
'group-has',
|
|
393
|
+
(value, { modifier }) =>
|
|
394
|
+
modifier
|
|
395
|
+
? `:merge(.group\\/${modifier}):has(${normalize(value)}) &`
|
|
396
|
+
: `:merge(.group):has(${normalize(value)}) &`,
|
|
397
|
+
{ values: {} }
|
|
398
|
+
)
|
|
399
|
+
matchVariant(
|
|
400
|
+
'peer-has',
|
|
401
|
+
(value, { modifier }) =>
|
|
402
|
+
modifier
|
|
403
|
+
? `:merge(.peer\\/${modifier}):has(${normalize(value)}) ~ &`
|
|
404
|
+
: `:merge(.peer):has(${normalize(value)}) ~ &`,
|
|
405
|
+
{ values: {} }
|
|
406
|
+
)
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
ariaVariants: ({ matchVariant, theme }) => {
|
|
410
|
+
matchVariant('aria', (value) => `&[aria-${normalize(value)}]`, { values: theme('aria') ?? {} })
|
|
411
|
+
matchVariant(
|
|
412
|
+
'group-aria',
|
|
413
|
+
(value, { modifier }) =>
|
|
414
|
+
modifier
|
|
415
|
+
? `:merge(.group\\/${modifier})[aria-${normalize(value)}] &`
|
|
416
|
+
: `:merge(.group)[aria-${normalize(value)}] &`,
|
|
417
|
+
{ values: theme('aria') ?? {} }
|
|
418
|
+
)
|
|
419
|
+
matchVariant(
|
|
420
|
+
'peer-aria',
|
|
421
|
+
(value, { modifier }) =>
|
|
422
|
+
modifier
|
|
423
|
+
? `:merge(.peer\\/${modifier})[aria-${normalize(value)}] ~ &`
|
|
424
|
+
: `:merge(.peer)[aria-${normalize(value)}] ~ &`,
|
|
425
|
+
{ values: theme('aria') ?? {} }
|
|
426
|
+
)
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
dataVariants: ({ matchVariant, theme }) => {
|
|
430
|
+
matchVariant('data', (value) => `&[data-${normalize(value)}]`, { values: theme('data') ?? {} })
|
|
431
|
+
matchVariant(
|
|
432
|
+
'group-data',
|
|
433
|
+
(value, { modifier }) =>
|
|
434
|
+
modifier
|
|
435
|
+
? `:merge(.group\\/${modifier})[data-${normalize(value)}] &`
|
|
436
|
+
: `:merge(.group)[data-${normalize(value)}] &`,
|
|
437
|
+
{ values: theme('data') ?? {} }
|
|
438
|
+
)
|
|
439
|
+
matchVariant(
|
|
440
|
+
'peer-data',
|
|
441
|
+
(value, { modifier }) =>
|
|
442
|
+
modifier
|
|
443
|
+
? `:merge(.peer\\/${modifier})[data-${normalize(value)}] ~ &`
|
|
444
|
+
: `:merge(.peer)[data-${normalize(value)}] ~ &`,
|
|
445
|
+
{ values: theme('data') ?? {} }
|
|
446
|
+
)
|
|
167
447
|
},
|
|
168
448
|
|
|
169
449
|
orientationVariants: ({ addVariant }) => {
|
|
170
450
|
addVariant('portrait', '@media (orientation: portrait)')
|
|
171
451
|
addVariant('landscape', '@media (orientation: landscape)')
|
|
172
452
|
},
|
|
453
|
+
|
|
454
|
+
prefersContrastVariants: ({ addVariant }) => {
|
|
455
|
+
addVariant('contrast-more', '@media (prefers-contrast: more)')
|
|
456
|
+
addVariant('contrast-less', '@media (prefers-contrast: less)')
|
|
457
|
+
},
|
|
173
458
|
}
|
|
174
459
|
|
|
460
|
+
let cssTransformValue = [
|
|
461
|
+
'translate(var(--tw-translate-x), var(--tw-translate-y))',
|
|
462
|
+
'rotate(var(--tw-rotate))',
|
|
463
|
+
'skewX(var(--tw-skew-x))',
|
|
464
|
+
'skewY(var(--tw-skew-y))',
|
|
465
|
+
'scaleX(var(--tw-scale-x))',
|
|
466
|
+
'scaleY(var(--tw-scale-y))',
|
|
467
|
+
].join(' ')
|
|
468
|
+
|
|
469
|
+
let cssFilterValue = [
|
|
470
|
+
'var(--tw-blur)',
|
|
471
|
+
'var(--tw-brightness)',
|
|
472
|
+
'var(--tw-contrast)',
|
|
473
|
+
'var(--tw-grayscale)',
|
|
474
|
+
'var(--tw-hue-rotate)',
|
|
475
|
+
'var(--tw-invert)',
|
|
476
|
+
'var(--tw-saturate)',
|
|
477
|
+
'var(--tw-sepia)',
|
|
478
|
+
'var(--tw-drop-shadow)',
|
|
479
|
+
].join(' ')
|
|
480
|
+
|
|
481
|
+
let cssBackdropFilterValue = [
|
|
482
|
+
'var(--tw-backdrop-blur)',
|
|
483
|
+
'var(--tw-backdrop-brightness)',
|
|
484
|
+
'var(--tw-backdrop-contrast)',
|
|
485
|
+
'var(--tw-backdrop-grayscale)',
|
|
486
|
+
'var(--tw-backdrop-hue-rotate)',
|
|
487
|
+
'var(--tw-backdrop-invert)',
|
|
488
|
+
'var(--tw-backdrop-opacity)',
|
|
489
|
+
'var(--tw-backdrop-saturate)',
|
|
490
|
+
'var(--tw-backdrop-sepia)',
|
|
491
|
+
].join(' ')
|
|
492
|
+
|
|
175
493
|
export let corePlugins = {
|
|
176
494
|
preflight: ({ addBase }) => {
|
|
177
495
|
let preflightStyles = postcss.parse(
|
|
@@ -310,6 +628,7 @@ export let corePlugins = {
|
|
|
310
628
|
addUtilities({
|
|
311
629
|
'.visible': { visibility: 'visible' },
|
|
312
630
|
'.invisible': { visibility: 'hidden' },
|
|
631
|
+
'.collapse': { visibility: 'collapse' },
|
|
313
632
|
})
|
|
314
633
|
},
|
|
315
634
|
|
|
@@ -326,12 +645,14 @@ export let corePlugins = {
|
|
|
326
645
|
inset: createUtilityPlugin(
|
|
327
646
|
'inset',
|
|
328
647
|
[
|
|
329
|
-
['inset', ['
|
|
648
|
+
['inset', ['inset']],
|
|
330
649
|
[
|
|
331
650
|
['inset-x', ['left', 'right']],
|
|
332
651
|
['inset-y', ['top', 'bottom']],
|
|
333
652
|
],
|
|
334
653
|
[
|
|
654
|
+
['start', ['inset-inline-start']],
|
|
655
|
+
['end', ['inset-inline-end']],
|
|
335
656
|
['top', ['top']],
|
|
336
657
|
['right', ['right']],
|
|
337
658
|
['bottom', ['bottom']],
|
|
@@ -383,6 +704,8 @@ export let corePlugins = {
|
|
|
383
704
|
['my', ['margin-top', 'margin-bottom']],
|
|
384
705
|
],
|
|
385
706
|
[
|
|
707
|
+
['ms', ['margin-inline-start']],
|
|
708
|
+
['me', ['margin-inline-end']],
|
|
386
709
|
['mt', ['margin-top']],
|
|
387
710
|
['mr', ['margin-right']],
|
|
388
711
|
['mb', ['margin-bottom']],
|
|
@@ -399,6 +722,29 @@ export let corePlugins = {
|
|
|
399
722
|
})
|
|
400
723
|
},
|
|
401
724
|
|
|
725
|
+
lineClamp: ({ matchUtilities, addUtilities, theme }) => {
|
|
726
|
+
matchUtilities(
|
|
727
|
+
{
|
|
728
|
+
'line-clamp': (value) => ({
|
|
729
|
+
overflow: 'hidden',
|
|
730
|
+
display: '-webkit-box',
|
|
731
|
+
'-webkit-box-orient': 'vertical',
|
|
732
|
+
'-webkit-line-clamp': `${value}`,
|
|
733
|
+
}),
|
|
734
|
+
},
|
|
735
|
+
{ values: theme('lineClamp') }
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
addUtilities({
|
|
739
|
+
'.line-clamp-none': {
|
|
740
|
+
overflow: 'visible',
|
|
741
|
+
display: 'block',
|
|
742
|
+
'-webkit-box-orient': 'horizontal',
|
|
743
|
+
'-webkit-line-clamp': 'none',
|
|
744
|
+
},
|
|
745
|
+
})
|
|
746
|
+
},
|
|
747
|
+
|
|
402
748
|
display: ({ addUtilities }) => {
|
|
403
749
|
addUtilities({
|
|
404
750
|
'.block': { display: 'block' },
|
|
@@ -453,6 +799,13 @@ export let corePlugins = {
|
|
|
453
799
|
})
|
|
454
800
|
},
|
|
455
801
|
|
|
802
|
+
captionSide: ({ addUtilities }) => {
|
|
803
|
+
addUtilities({
|
|
804
|
+
'.caption-top': { 'caption-side': 'top' },
|
|
805
|
+
'.caption-bottom': { 'caption-side': 'bottom' },
|
|
806
|
+
})
|
|
807
|
+
},
|
|
808
|
+
|
|
456
809
|
borderCollapse: ({ addUtilities }) => {
|
|
457
810
|
addUtilities({
|
|
458
811
|
'.border-collapse': { 'border-collapse': 'collapse' },
|
|
@@ -460,6 +813,41 @@ export let corePlugins = {
|
|
|
460
813
|
})
|
|
461
814
|
},
|
|
462
815
|
|
|
816
|
+
borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
|
|
817
|
+
addDefaults('border-spacing', {
|
|
818
|
+
'--tw-border-spacing-x': 0,
|
|
819
|
+
'--tw-border-spacing-y': 0,
|
|
820
|
+
})
|
|
821
|
+
|
|
822
|
+
matchUtilities(
|
|
823
|
+
{
|
|
824
|
+
'border-spacing': (value) => {
|
|
825
|
+
return {
|
|
826
|
+
'--tw-border-spacing-x': value,
|
|
827
|
+
'--tw-border-spacing-y': value,
|
|
828
|
+
'@defaults border-spacing': {},
|
|
829
|
+
'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
'border-spacing-x': (value) => {
|
|
833
|
+
return {
|
|
834
|
+
'--tw-border-spacing-x': value,
|
|
835
|
+
'@defaults border-spacing': {},
|
|
836
|
+
'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
'border-spacing-y': (value) => {
|
|
840
|
+
return {
|
|
841
|
+
'--tw-border-spacing-y': value,
|
|
842
|
+
'@defaults border-spacing': {},
|
|
843
|
+
'border-spacing': 'var(--tw-border-spacing-x) var(--tw-border-spacing-y)',
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
},
|
|
847
|
+
{ values: theme('borderSpacing') }
|
|
848
|
+
)
|
|
849
|
+
},
|
|
850
|
+
|
|
463
851
|
transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
|
|
464
852
|
translate: createUtilityPlugin(
|
|
465
853
|
'translate',
|
|
@@ -467,11 +855,11 @@ export let corePlugins = {
|
|
|
467
855
|
[
|
|
468
856
|
[
|
|
469
857
|
'translate-x',
|
|
470
|
-
[['@defaults transform', {}], '--tw-translate-x', ['transform',
|
|
858
|
+
[['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
|
|
471
859
|
],
|
|
472
860
|
[
|
|
473
861
|
'translate-y',
|
|
474
|
-
[['@defaults transform', {}], '--tw-translate-y', ['transform',
|
|
862
|
+
[['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
|
|
475
863
|
],
|
|
476
864
|
],
|
|
477
865
|
],
|
|
@@ -479,102 +867,73 @@ export let corePlugins = {
|
|
|
479
867
|
),
|
|
480
868
|
rotate: createUtilityPlugin(
|
|
481
869
|
'rotate',
|
|
482
|
-
[
|
|
483
|
-
[
|
|
484
|
-
'rotate',
|
|
485
|
-
[['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
|
|
486
|
-
],
|
|
487
|
-
],
|
|
870
|
+
[['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
|
|
488
871
|
{ supportsNegativeValues: true }
|
|
489
872
|
),
|
|
490
873
|
skew: createUtilityPlugin(
|
|
491
874
|
'skew',
|
|
492
875
|
[
|
|
493
876
|
[
|
|
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
|
-
],
|
|
877
|
+
['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
|
|
878
|
+
['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
|
|
502
879
|
],
|
|
503
880
|
],
|
|
504
881
|
{ supportsNegativeValues: true }
|
|
505
882
|
),
|
|
506
|
-
scale: createUtilityPlugin(
|
|
883
|
+
scale: createUtilityPlugin(
|
|
884
|
+
'scale',
|
|
507
885
|
[
|
|
508
|
-
'scale',
|
|
509
886
|
[
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
[
|
|
518
|
-
'scale-x',
|
|
519
|
-
[['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
|
|
887
|
+
'scale',
|
|
888
|
+
[
|
|
889
|
+
['@defaults transform', {}],
|
|
890
|
+
'--tw-scale-x',
|
|
891
|
+
'--tw-scale-y',
|
|
892
|
+
['transform', cssTransformValue],
|
|
893
|
+
],
|
|
520
894
|
],
|
|
521
895
|
[
|
|
522
|
-
|
|
523
|
-
|
|
896
|
+
[
|
|
897
|
+
'scale-x',
|
|
898
|
+
[['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
|
|
899
|
+
],
|
|
900
|
+
[
|
|
901
|
+
'scale-y',
|
|
902
|
+
[['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
|
|
903
|
+
],
|
|
524
904
|
],
|
|
525
905
|
],
|
|
526
|
-
|
|
906
|
+
{ supportsNegativeValues: true }
|
|
907
|
+
),
|
|
908
|
+
|
|
909
|
+
transform: ({ addDefaults, addUtilities }) => {
|
|
910
|
+
addDefaults('transform', {
|
|
911
|
+
'--tw-translate-x': '0',
|
|
912
|
+
'--tw-translate-y': '0',
|
|
913
|
+
'--tw-rotate': '0',
|
|
914
|
+
'--tw-skew-x': '0',
|
|
915
|
+
'--tw-skew-y': '0',
|
|
916
|
+
'--tw-scale-x': '1',
|
|
917
|
+
'--tw-scale-y': '1',
|
|
918
|
+
})
|
|
527
919
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
'@defaults transform': {
|
|
531
|
-
'--tw-translate-x': '0',
|
|
532
|
-
'--tw-translate-y': '0',
|
|
533
|
-
'--tw-rotate': '0',
|
|
534
|
-
'--tw-skew-x': '0',
|
|
535
|
-
'--tw-skew-y': '0',
|
|
536
|
-
'--tw-scale-x': '1',
|
|
537
|
-
'--tw-scale-y': '1',
|
|
538
|
-
'--tw-transform': [
|
|
539
|
-
'translateX(var(--tw-translate-x))',
|
|
540
|
-
'translateY(var(--tw-translate-y))',
|
|
541
|
-
'rotate(var(--tw-rotate))',
|
|
542
|
-
'skewX(var(--tw-skew-x))',
|
|
543
|
-
'skewY(var(--tw-skew-y))',
|
|
544
|
-
'scaleX(var(--tw-scale-x))',
|
|
545
|
-
'scaleY(var(--tw-scale-y))',
|
|
546
|
-
].join(' '),
|
|
547
|
-
},
|
|
548
|
-
})
|
|
549
|
-
addUtilities({
|
|
550
|
-
'.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
|
|
920
|
+
addUtilities({
|
|
921
|
+
'.transform': { '@defaults transform': {}, transform: cssTransformValue },
|
|
551
922
|
'.transform-cpu': {
|
|
552
|
-
|
|
553
|
-
'translateX(var(--tw-translate-x))',
|
|
554
|
-
'translateY(var(--tw-translate-y))',
|
|
555
|
-
'rotate(var(--tw-rotate))',
|
|
556
|
-
'skewX(var(--tw-skew-x))',
|
|
557
|
-
'skewY(var(--tw-skew-y))',
|
|
558
|
-
'scaleX(var(--tw-scale-x))',
|
|
559
|
-
'scaleY(var(--tw-scale-y))',
|
|
560
|
-
].join(' '),
|
|
923
|
+
transform: cssTransformValue,
|
|
561
924
|
},
|
|
562
925
|
'.transform-gpu': {
|
|
563
|
-
|
|
564
|
-
'
|
|
565
|
-
'
|
|
566
|
-
|
|
567
|
-
'skewY(var(--tw-skew-y))',
|
|
568
|
-
'scaleX(var(--tw-scale-x))',
|
|
569
|
-
'scaleY(var(--tw-scale-y))',
|
|
570
|
-
].join(' '),
|
|
926
|
+
transform: cssTransformValue.replace(
|
|
927
|
+
'translate(var(--tw-translate-x), var(--tw-translate-y))',
|
|
928
|
+
'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
|
|
929
|
+
),
|
|
571
930
|
},
|
|
572
931
|
'.transform-none': { transform: 'none' },
|
|
573
932
|
})
|
|
574
933
|
},
|
|
575
934
|
|
|
576
|
-
animation: ({ matchUtilities, theme,
|
|
577
|
-
let prefixName = (name) => prefix(
|
|
935
|
+
animation: ({ matchUtilities, theme, config }) => {
|
|
936
|
+
let prefixName = (name) => `${config('prefix')}${escapeClassName(name)}`
|
|
578
937
|
let keyframes = Object.fromEntries(
|
|
579
938
|
Object.entries(theme('keyframes') ?? {}).map(([key, value]) => {
|
|
580
939
|
return [key, { [`@keyframes ${prefixName(key)}`]: value }]
|
|
@@ -607,53 +966,52 @@ export let corePlugins = {
|
|
|
607
966
|
|
|
608
967
|
cursor: createUtilityPlugin('cursor'),
|
|
609
968
|
|
|
610
|
-
touchAction: ({
|
|
611
|
-
|
|
612
|
-
'
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
'--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
616
|
-
'--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
|
|
617
|
-
},
|
|
969
|
+
touchAction: ({ addDefaults, addUtilities }) => {
|
|
970
|
+
addDefaults('touch-action', {
|
|
971
|
+
'--tw-pan-x': ' ',
|
|
972
|
+
'--tw-pan-y': ' ',
|
|
973
|
+
'--tw-pinch-zoom': ' ',
|
|
618
974
|
})
|
|
619
975
|
|
|
976
|
+
let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
|
|
977
|
+
|
|
620
978
|
addUtilities({
|
|
621
979
|
'.touch-auto': { 'touch-action': 'auto' },
|
|
622
980
|
'.touch-none': { 'touch-action': 'none' },
|
|
623
981
|
'.touch-pan-x': {
|
|
624
982
|
'@defaults touch-action': {},
|
|
625
983
|
'--tw-pan-x': 'pan-x',
|
|
626
|
-
'touch-action':
|
|
984
|
+
'touch-action': cssTouchActionValue,
|
|
627
985
|
},
|
|
628
986
|
'.touch-pan-left': {
|
|
629
987
|
'@defaults touch-action': {},
|
|
630
988
|
'--tw-pan-x': 'pan-left',
|
|
631
|
-
'touch-action':
|
|
989
|
+
'touch-action': cssTouchActionValue,
|
|
632
990
|
},
|
|
633
991
|
'.touch-pan-right': {
|
|
634
992
|
'@defaults touch-action': {},
|
|
635
993
|
'--tw-pan-x': 'pan-right',
|
|
636
|
-
'touch-action':
|
|
994
|
+
'touch-action': cssTouchActionValue,
|
|
637
995
|
},
|
|
638
996
|
'.touch-pan-y': {
|
|
639
997
|
'@defaults touch-action': {},
|
|
640
998
|
'--tw-pan-y': 'pan-y',
|
|
641
|
-
'touch-action':
|
|
999
|
+
'touch-action': cssTouchActionValue,
|
|
642
1000
|
},
|
|
643
1001
|
'.touch-pan-up': {
|
|
644
1002
|
'@defaults touch-action': {},
|
|
645
1003
|
'--tw-pan-y': 'pan-up',
|
|
646
|
-
'touch-action':
|
|
1004
|
+
'touch-action': cssTouchActionValue,
|
|
647
1005
|
},
|
|
648
1006
|
'.touch-pan-down': {
|
|
649
1007
|
'@defaults touch-action': {},
|
|
650
1008
|
'--tw-pan-y': 'pan-down',
|
|
651
|
-
'touch-action':
|
|
1009
|
+
'touch-action': cssTouchActionValue,
|
|
652
1010
|
},
|
|
653
1011
|
'.touch-pinch-zoom': {
|
|
654
1012
|
'@defaults touch-action': {},
|
|
655
1013
|
'--tw-pinch-zoom': 'pinch-zoom',
|
|
656
|
-
'touch-action':
|
|
1014
|
+
'touch-action': cssTouchActionValue,
|
|
657
1015
|
},
|
|
658
1016
|
'.touch-manipulation': { 'touch-action': 'manipulation' },
|
|
659
1017
|
})
|
|
@@ -677,11 +1035,9 @@ export let corePlugins = {
|
|
|
677
1035
|
})
|
|
678
1036
|
},
|
|
679
1037
|
|
|
680
|
-
scrollSnapType: ({
|
|
681
|
-
|
|
682
|
-
'
|
|
683
|
-
'--tw-scroll-snap-strictness': 'proximity',
|
|
684
|
-
},
|
|
1038
|
+
scrollSnapType: ({ addDefaults, addUtilities }) => {
|
|
1039
|
+
addDefaults('scroll-snap-type', {
|
|
1040
|
+
'--tw-scroll-snap-strictness': 'proximity',
|
|
685
1041
|
})
|
|
686
1042
|
|
|
687
1043
|
addUtilities({
|
|
@@ -728,6 +1084,8 @@ export let corePlugins = {
|
|
|
728
1084
|
['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
|
|
729
1085
|
],
|
|
730
1086
|
[
|
|
1087
|
+
['scroll-ms', ['scroll-margin-inline-start']],
|
|
1088
|
+
['scroll-me', ['scroll-margin-inline-end']],
|
|
731
1089
|
['scroll-mt', ['scroll-margin-top']],
|
|
732
1090
|
['scroll-mr', ['scroll-margin-right']],
|
|
733
1091
|
['scroll-mb', ['scroll-margin-bottom']],
|
|
@@ -744,6 +1102,8 @@ export let corePlugins = {
|
|
|
744
1102
|
['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
|
|
745
1103
|
],
|
|
746
1104
|
[
|
|
1105
|
+
['scroll-ps', ['scroll-padding-inline-start']],
|
|
1106
|
+
['scroll-pe', ['scroll-padding-inline-end']],
|
|
747
1107
|
['scroll-pt', ['scroll-padding-top']],
|
|
748
1108
|
['scroll-pr', ['scroll-padding-right']],
|
|
749
1109
|
['scroll-pb', ['scroll-padding-bottom']],
|
|
@@ -757,8 +1117,8 @@ export let corePlugins = {
|
|
|
757
1117
|
'.list-outside': { 'list-style-position': 'outside' },
|
|
758
1118
|
})
|
|
759
1119
|
},
|
|
760
|
-
|
|
761
1120
|
listStyleType: createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]),
|
|
1121
|
+
listStyleImage: createUtilityPlugin('listStyleImage', [['list-image', ['listStyleImage']]]),
|
|
762
1122
|
|
|
763
1123
|
appearance: ({ addUtilities }) => {
|
|
764
1124
|
addUtilities({
|
|
@@ -809,6 +1169,7 @@ export let corePlugins = {
|
|
|
809
1169
|
addUtilities({
|
|
810
1170
|
'.grid-flow-row': { gridAutoFlow: 'row' },
|
|
811
1171
|
'.grid-flow-col': { gridAutoFlow: 'column' },
|
|
1172
|
+
'.grid-flow-dense': { gridAutoFlow: 'dense' },
|
|
812
1173
|
'.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
|
|
813
1174
|
'.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
|
|
814
1175
|
})
|
|
@@ -845,6 +1206,7 @@ export let corePlugins = {
|
|
|
845
1206
|
'.place-content-between': { 'place-content': 'space-between' },
|
|
846
1207
|
'.place-content-around': { 'place-content': 'space-around' },
|
|
847
1208
|
'.place-content-evenly': { 'place-content': 'space-evenly' },
|
|
1209
|
+
'.place-content-baseline': { 'place-content': 'baseline' },
|
|
848
1210
|
'.place-content-stretch': { 'place-content': 'stretch' },
|
|
849
1211
|
})
|
|
850
1212
|
},
|
|
@@ -854,18 +1216,22 @@ export let corePlugins = {
|
|
|
854
1216
|
'.place-items-start': { 'place-items': 'start' },
|
|
855
1217
|
'.place-items-end': { 'place-items': 'end' },
|
|
856
1218
|
'.place-items-center': { 'place-items': 'center' },
|
|
1219
|
+
'.place-items-baseline': { 'place-items': 'baseline' },
|
|
857
1220
|
'.place-items-stretch': { 'place-items': 'stretch' },
|
|
858
1221
|
})
|
|
859
1222
|
},
|
|
860
1223
|
|
|
861
1224
|
alignContent: ({ addUtilities }) => {
|
|
862
1225
|
addUtilities({
|
|
1226
|
+
'.content-normal': { 'align-content': 'normal' },
|
|
863
1227
|
'.content-center': { 'align-content': 'center' },
|
|
864
1228
|
'.content-start': { 'align-content': 'flex-start' },
|
|
865
1229
|
'.content-end': { 'align-content': 'flex-end' },
|
|
866
1230
|
'.content-between': { 'align-content': 'space-between' },
|
|
867
1231
|
'.content-around': { 'align-content': 'space-around' },
|
|
868
1232
|
'.content-evenly': { 'align-content': 'space-evenly' },
|
|
1233
|
+
'.content-baseline': { 'align-content': 'baseline' },
|
|
1234
|
+
'.content-stretch': { 'align-content': 'stretch' },
|
|
869
1235
|
})
|
|
870
1236
|
},
|
|
871
1237
|
|
|
@@ -881,12 +1247,14 @@ export let corePlugins = {
|
|
|
881
1247
|
|
|
882
1248
|
justifyContent: ({ addUtilities }) => {
|
|
883
1249
|
addUtilities({
|
|
1250
|
+
'.justify-normal': { 'justify-content': 'normal' },
|
|
884
1251
|
'.justify-start': { 'justify-content': 'flex-start' },
|
|
885
1252
|
'.justify-end': { 'justify-content': 'flex-end' },
|
|
886
1253
|
'.justify-center': { 'justify-content': 'center' },
|
|
887
1254
|
'.justify-between': { 'justify-content': 'space-between' },
|
|
888
1255
|
'.justify-around': { 'justify-content': 'space-around' },
|
|
889
1256
|
'.justify-evenly': { 'justify-content': 'space-evenly' },
|
|
1257
|
+
'.justify-stretch': { 'justify-content': 'stretch' },
|
|
890
1258
|
})
|
|
891
1259
|
},
|
|
892
1260
|
|
|
@@ -907,12 +1275,22 @@ export let corePlugins = {
|
|
|
907
1275
|
],
|
|
908
1276
|
]),
|
|
909
1277
|
|
|
910
|
-
space: ({ matchUtilities, addUtilities, theme }) => {
|
|
1278
|
+
space: ({ matchUtilities, addUtilities, theme, config }) => {
|
|
911
1279
|
matchUtilities(
|
|
912
1280
|
{
|
|
913
1281
|
'space-x': (value) => {
|
|
914
1282
|
value = value === '0' ? '0px' : value
|
|
915
1283
|
|
|
1284
|
+
if (flagEnabled(config(), 'logicalSiblingUtilities')) {
|
|
1285
|
+
return {
|
|
1286
|
+
'& > :not([hidden]) ~ :not([hidden])': {
|
|
1287
|
+
'--tw-space-x-reverse': '0',
|
|
1288
|
+
'margin-inline-end': `calc(${value} * var(--tw-space-x-reverse))`,
|
|
1289
|
+
'margin-inline-start': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`,
|
|
1290
|
+
},
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
|
|
916
1294
|
return {
|
|
917
1295
|
'& > :not([hidden]) ~ :not([hidden])': {
|
|
918
1296
|
'--tw-space-x-reverse': '0',
|
|
@@ -942,12 +1320,23 @@ export let corePlugins = {
|
|
|
942
1320
|
})
|
|
943
1321
|
},
|
|
944
1322
|
|
|
945
|
-
divideWidth: ({ matchUtilities, addUtilities, theme }) => {
|
|
1323
|
+
divideWidth: ({ matchUtilities, addUtilities, theme, config }) => {
|
|
946
1324
|
matchUtilities(
|
|
947
1325
|
{
|
|
948
1326
|
'divide-x': (value) => {
|
|
949
1327
|
value = value === '0' ? '0px' : value
|
|
950
1328
|
|
|
1329
|
+
if (flagEnabled(config(), 'logicalSiblingUtilities')) {
|
|
1330
|
+
return {
|
|
1331
|
+
'& > :not([hidden]) ~ :not([hidden])': {
|
|
1332
|
+
'@defaults border-width': {},
|
|
1333
|
+
'--tw-divide-x-reverse': '0',
|
|
1334
|
+
'border-inline-end-width': `calc(${value} * var(--tw-divide-x-reverse))`,
|
|
1335
|
+
'border-inline-start-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`,
|
|
1336
|
+
},
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
|
|
951
1340
|
return {
|
|
952
1341
|
'& > :not([hidden]) ~ :not([hidden])': {
|
|
953
1342
|
'@defaults border-width': {},
|
|
@@ -970,7 +1359,7 @@ export let corePlugins = {
|
|
|
970
1359
|
}
|
|
971
1360
|
},
|
|
972
1361
|
},
|
|
973
|
-
{ values: theme('divideWidth'), type: ['line-width', 'length'] }
|
|
1362
|
+
{ values: theme('divideWidth'), type: ['line-width', 'length', 'any'] }
|
|
974
1363
|
)
|
|
975
1364
|
|
|
976
1365
|
addUtilities({
|
|
@@ -1018,7 +1407,7 @@ export let corePlugins = {
|
|
|
1018
1407
|
},
|
|
1019
1408
|
{
|
|
1020
1409
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
|
|
1021
|
-
type: 'color',
|
|
1410
|
+
type: ['color', 'any'],
|
|
1022
1411
|
}
|
|
1023
1412
|
)
|
|
1024
1413
|
},
|
|
@@ -1115,6 +1504,14 @@ export let corePlugins = {
|
|
|
1115
1504
|
})
|
|
1116
1505
|
},
|
|
1117
1506
|
|
|
1507
|
+
hyphens: ({ addUtilities }) => {
|
|
1508
|
+
addUtilities({
|
|
1509
|
+
'.hyphens-none': { hyphens: 'none' },
|
|
1510
|
+
'.hyphens-manual': { hyphens: 'manual' },
|
|
1511
|
+
'.hyphens-auto': { hyphens: 'auto' },
|
|
1512
|
+
})
|
|
1513
|
+
},
|
|
1514
|
+
|
|
1118
1515
|
whitespace: ({ addUtilities }) => {
|
|
1119
1516
|
addUtilities({
|
|
1120
1517
|
'.whitespace-normal': { 'white-space': 'normal' },
|
|
@@ -1122,6 +1519,15 @@ export let corePlugins = {
|
|
|
1122
1519
|
'.whitespace-pre': { 'white-space': 'pre' },
|
|
1123
1520
|
'.whitespace-pre-line': { 'white-space': 'pre-line' },
|
|
1124
1521
|
'.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
|
|
1522
|
+
'.whitespace-break-spaces': { 'white-space': 'break-spaces' },
|
|
1523
|
+
})
|
|
1524
|
+
},
|
|
1525
|
+
|
|
1526
|
+
textWrap: ({ addUtilities }) => {
|
|
1527
|
+
addUtilities({
|
|
1528
|
+
'.text-wrap': { 'text-wrap': 'wrap' },
|
|
1529
|
+
'.text-nowrap': { 'text-wrap': 'nowrap' },
|
|
1530
|
+
'.text-balance': { 'text-wrap': 'balance' },
|
|
1125
1531
|
})
|
|
1126
1532
|
},
|
|
1127
1533
|
|
|
@@ -1130,18 +1536,25 @@ export let corePlugins = {
|
|
|
1130
1536
|
'.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
|
|
1131
1537
|
'.break-words': { 'overflow-wrap': 'break-word' },
|
|
1132
1538
|
'.break-all': { 'word-break': 'break-all' },
|
|
1539
|
+
'.break-keep': { 'word-break': 'keep-all' },
|
|
1133
1540
|
})
|
|
1134
1541
|
},
|
|
1135
1542
|
|
|
1136
1543
|
borderRadius: createUtilityPlugin('borderRadius', [
|
|
1137
1544
|
['rounded', ['border-radius']],
|
|
1138
1545
|
[
|
|
1546
|
+
['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
|
|
1547
|
+
['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
|
|
1139
1548
|
['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
|
|
1140
1549
|
['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
|
|
1141
1550
|
['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
|
|
1142
1551
|
['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
|
|
1143
1552
|
],
|
|
1144
1553
|
[
|
|
1554
|
+
['rounded-ss', ['border-start-start-radius']],
|
|
1555
|
+
['rounded-se', ['border-start-end-radius']],
|
|
1556
|
+
['rounded-ee', ['border-end-end-radius']],
|
|
1557
|
+
['rounded-es', ['border-end-start-radius']],
|
|
1145
1558
|
['rounded-tl', ['border-top-left-radius']],
|
|
1146
1559
|
['rounded-tr', ['border-top-right-radius']],
|
|
1147
1560
|
['rounded-br', ['border-bottom-right-radius']],
|
|
@@ -1158,6 +1571,8 @@ export let corePlugins = {
|
|
|
1158
1571
|
['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
|
|
1159
1572
|
],
|
|
1160
1573
|
[
|
|
1574
|
+
['border-s', [['@defaults border-width', {}], 'border-inline-start-width']],
|
|
1575
|
+
['border-e', [['@defaults border-width', {}], 'border-inline-end-width']],
|
|
1161
1576
|
['border-t', [['@defaults border-width', {}], 'border-top-width']],
|
|
1162
1577
|
['border-r', [['@defaults border-width', {}], 'border-right-width']],
|
|
1163
1578
|
['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
|
|
@@ -1178,24 +1593,7 @@ export let corePlugins = {
|
|
|
1178
1593
|
})
|
|
1179
1594
|
},
|
|
1180
1595
|
|
|
1181
|
-
borderColor: ({
|
|
1182
|
-
if (!corePlugins('borderOpacity')) {
|
|
1183
|
-
let value = theme('borderColor.DEFAULT', 'currentColor')
|
|
1184
|
-
addBase({
|
|
1185
|
-
'@defaults border-width': {
|
|
1186
|
-
'border-color': toColorValue(value),
|
|
1187
|
-
},
|
|
1188
|
-
})
|
|
1189
|
-
} else {
|
|
1190
|
-
addBase({
|
|
1191
|
-
'@defaults border-width': withAlphaVariable({
|
|
1192
|
-
color: theme('borderColor.DEFAULT', 'currentColor'),
|
|
1193
|
-
property: 'border-color',
|
|
1194
|
-
variable: '--tw-border-opacity',
|
|
1195
|
-
}),
|
|
1196
|
-
})
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1596
|
+
borderColor: ({ matchUtilities, theme, corePlugins }) => {
|
|
1199
1597
|
matchUtilities(
|
|
1200
1598
|
{
|
|
1201
1599
|
border: (value) => {
|
|
@@ -1214,7 +1612,7 @@ export let corePlugins = {
|
|
|
1214
1612
|
},
|
|
1215
1613
|
{
|
|
1216
1614
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
|
|
1217
|
-
type: ['color'],
|
|
1615
|
+
type: ['color', 'any'],
|
|
1218
1616
|
}
|
|
1219
1617
|
)
|
|
1220
1618
|
|
|
@@ -1251,12 +1649,38 @@ export let corePlugins = {
|
|
|
1251
1649
|
},
|
|
1252
1650
|
{
|
|
1253
1651
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
|
|
1254
|
-
type: 'color',
|
|
1652
|
+
type: ['color', 'any'],
|
|
1255
1653
|
}
|
|
1256
1654
|
)
|
|
1257
1655
|
|
|
1258
1656
|
matchUtilities(
|
|
1259
1657
|
{
|
|
1658
|
+
'border-s': (value) => {
|
|
1659
|
+
if (!corePlugins('borderOpacity')) {
|
|
1660
|
+
return {
|
|
1661
|
+
'border-inline-start-color': toColorValue(value),
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
return withAlphaVariable({
|
|
1666
|
+
color: value,
|
|
1667
|
+
property: 'border-inline-start-color',
|
|
1668
|
+
variable: '--tw-border-opacity',
|
|
1669
|
+
})
|
|
1670
|
+
},
|
|
1671
|
+
'border-e': (value) => {
|
|
1672
|
+
if (!corePlugins('borderOpacity')) {
|
|
1673
|
+
return {
|
|
1674
|
+
'border-inline-end-color': toColorValue(value),
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
return withAlphaVariable({
|
|
1679
|
+
color: value,
|
|
1680
|
+
property: 'border-inline-end-color',
|
|
1681
|
+
variable: '--tw-border-opacity',
|
|
1682
|
+
})
|
|
1683
|
+
},
|
|
1260
1684
|
'border-t': (value) => {
|
|
1261
1685
|
if (!corePlugins('borderOpacity')) {
|
|
1262
1686
|
return {
|
|
@@ -1312,7 +1736,7 @@ export let corePlugins = {
|
|
|
1312
1736
|
},
|
|
1313
1737
|
{
|
|
1314
1738
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))),
|
|
1315
|
-
type: 'color',
|
|
1739
|
+
type: ['color', 'any'],
|
|
1316
1740
|
}
|
|
1317
1741
|
)
|
|
1318
1742
|
},
|
|
@@ -1338,7 +1762,7 @@ export let corePlugins = {
|
|
|
1338
1762
|
})
|
|
1339
1763
|
},
|
|
1340
1764
|
},
|
|
1341
|
-
{ values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
|
|
1765
|
+
{ values: flattenColorPalette(theme('backgroundColor')), type: ['color', 'any'] }
|
|
1342
1766
|
)
|
|
1343
1767
|
},
|
|
1344
1768
|
|
|
@@ -1353,44 +1777,98 @@ export let corePlugins = {
|
|
|
1353
1777
|
return withAlphaValue(value, 0, 'rgb(255 255 255 / 0)')
|
|
1354
1778
|
}
|
|
1355
1779
|
|
|
1356
|
-
return function ({ matchUtilities, theme }) {
|
|
1780
|
+
return function ({ matchUtilities, theme, addDefaults }) {
|
|
1781
|
+
addDefaults('gradient-color-stops', {
|
|
1782
|
+
'--tw-gradient-from-position': ' ',
|
|
1783
|
+
'--tw-gradient-via-position': ' ',
|
|
1784
|
+
'--tw-gradient-to-position': ' ',
|
|
1785
|
+
})
|
|
1786
|
+
|
|
1357
1787
|
let options = {
|
|
1358
1788
|
values: flattenColorPalette(theme('gradientColorStops')),
|
|
1359
1789
|
type: ['color', 'any'],
|
|
1360
1790
|
}
|
|
1361
1791
|
|
|
1792
|
+
let positionOptions = {
|
|
1793
|
+
values: theme('gradientColorStopPositions'),
|
|
1794
|
+
type: ['length', 'percentage'],
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1362
1797
|
matchUtilities(
|
|
1363
1798
|
{
|
|
1364
1799
|
from: (value) => {
|
|
1365
1800
|
let transparentToValue = transparentTo(value)
|
|
1366
1801
|
|
|
1367
1802
|
return {
|
|
1368
|
-
'
|
|
1369
|
-
'--tw-gradient-
|
|
1803
|
+
'@defaults gradient-color-stops': {},
|
|
1804
|
+
'--tw-gradient-from': `${toColorValue(value)} var(--tw-gradient-from-position)`,
|
|
1805
|
+
'--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
|
|
1806
|
+
'--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to)`,
|
|
1370
1807
|
}
|
|
1371
1808
|
},
|
|
1372
1809
|
},
|
|
1373
1810
|
options
|
|
1374
1811
|
)
|
|
1812
|
+
|
|
1813
|
+
matchUtilities(
|
|
1814
|
+
{
|
|
1815
|
+
from: (value) => {
|
|
1816
|
+
return {
|
|
1817
|
+
'--tw-gradient-from-position': value,
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
},
|
|
1821
|
+
positionOptions
|
|
1822
|
+
)
|
|
1823
|
+
|
|
1375
1824
|
matchUtilities(
|
|
1376
1825
|
{
|
|
1377
1826
|
via: (value) => {
|
|
1378
1827
|
let transparentToValue = transparentTo(value)
|
|
1379
1828
|
|
|
1380
1829
|
return {
|
|
1830
|
+
'@defaults gradient-color-stops': {},
|
|
1831
|
+
'--tw-gradient-to': `${transparentToValue} var(--tw-gradient-to-position)`,
|
|
1381
1832
|
'--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue(
|
|
1382
|
-
value
|
|
1383
|
-
|
|
1384
|
-
)}, var(--tw-gradient-to, ${transparentToValue})`,
|
|
1833
|
+
value
|
|
1834
|
+
)} var(--tw-gradient-via-position), var(--tw-gradient-to)`,
|
|
1385
1835
|
}
|
|
1386
1836
|
},
|
|
1387
1837
|
},
|
|
1388
1838
|
options
|
|
1389
1839
|
)
|
|
1840
|
+
|
|
1390
1841
|
matchUtilities(
|
|
1391
|
-
{
|
|
1842
|
+
{
|
|
1843
|
+
via: (value) => {
|
|
1844
|
+
return {
|
|
1845
|
+
'--tw-gradient-via-position': value,
|
|
1846
|
+
}
|
|
1847
|
+
},
|
|
1848
|
+
},
|
|
1849
|
+
positionOptions
|
|
1850
|
+
)
|
|
1851
|
+
|
|
1852
|
+
matchUtilities(
|
|
1853
|
+
{
|
|
1854
|
+
to: (value) => ({
|
|
1855
|
+
'@defaults gradient-color-stops': {},
|
|
1856
|
+
'--tw-gradient-to': `${toColorValue(value)} var(--tw-gradient-to-position)`,
|
|
1857
|
+
}),
|
|
1858
|
+
},
|
|
1392
1859
|
options
|
|
1393
1860
|
)
|
|
1861
|
+
|
|
1862
|
+
matchUtilities(
|
|
1863
|
+
{
|
|
1864
|
+
to: (value) => {
|
|
1865
|
+
return {
|
|
1866
|
+
'--tw-gradient-to-position': value,
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
},
|
|
1870
|
+
positionOptions
|
|
1871
|
+
)
|
|
1394
1872
|
}
|
|
1395
1873
|
})(),
|
|
1396
1874
|
|
|
@@ -1404,7 +1882,7 @@ export let corePlugins = {
|
|
|
1404
1882
|
},
|
|
1405
1883
|
|
|
1406
1884
|
backgroundSize: createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], {
|
|
1407
|
-
type: ['lookup', 'length', 'percentage'],
|
|
1885
|
+
type: ['lookup', 'length', 'percentage', 'size'],
|
|
1408
1886
|
}),
|
|
1409
1887
|
|
|
1410
1888
|
backgroundAttachment: ({ addUtilities }) => {
|
|
@@ -1425,7 +1903,7 @@ export let corePlugins = {
|
|
|
1425
1903
|
},
|
|
1426
1904
|
|
|
1427
1905
|
backgroundPosition: createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], {
|
|
1428
|
-
type: ['lookup', 'position'],
|
|
1906
|
+
type: ['lookup', ['position', { preferOnConflict: true }]],
|
|
1429
1907
|
}),
|
|
1430
1908
|
|
|
1431
1909
|
backgroundRepeat: ({ addUtilities }) => {
|
|
@@ -1465,7 +1943,7 @@ export let corePlugins = {
|
|
|
1465
1943
|
return { stroke: toColorValue(value) }
|
|
1466
1944
|
},
|
|
1467
1945
|
},
|
|
1468
|
-
{ values: flattenColorPalette(theme('stroke')), type: ['color', 'url'] }
|
|
1946
|
+
{ values: flattenColorPalette(theme('stroke')), type: ['color', 'url', 'any'] }
|
|
1469
1947
|
)
|
|
1470
1948
|
},
|
|
1471
1949
|
|
|
@@ -1491,6 +1969,8 @@ export let corePlugins = {
|
|
|
1491
1969
|
['py', ['padding-top', 'padding-bottom']],
|
|
1492
1970
|
],
|
|
1493
1971
|
[
|
|
1972
|
+
['ps', ['padding-inline-start']],
|
|
1973
|
+
['pe', ['padding-inline-end']],
|
|
1494
1974
|
['pt', ['padding-top']],
|
|
1495
1975
|
['pr', ['padding-right']],
|
|
1496
1976
|
['pb', ['padding-bottom']],
|
|
@@ -1504,6 +1984,8 @@ export let corePlugins = {
|
|
|
1504
1984
|
'.text-center': { 'text-align': 'center' },
|
|
1505
1985
|
'.text-right': { 'text-align': 'right' },
|
|
1506
1986
|
'.text-justify': { 'text-align': 'justify' },
|
|
1987
|
+
'.text-start': { 'text-align': 'start' },
|
|
1988
|
+
'.text-end': { 'text-align': 'end' },
|
|
1507
1989
|
})
|
|
1508
1990
|
},
|
|
1509
1991
|
|
|
@@ -1526,16 +2008,46 @@ export let corePlugins = {
|
|
|
1526
2008
|
matchUtilities({ align: (value) => ({ 'vertical-align': value }) })
|
|
1527
2009
|
},
|
|
1528
2010
|
|
|
1529
|
-
fontFamily:
|
|
1530
|
-
|
|
1531
|
-
|
|
2011
|
+
fontFamily: ({ matchUtilities, theme }) => {
|
|
2012
|
+
matchUtilities(
|
|
2013
|
+
{
|
|
2014
|
+
font: (value) => {
|
|
2015
|
+
let [families, options = {}] =
|
|
2016
|
+
Array.isArray(value) && isPlainObject(value[1]) ? value : [value]
|
|
2017
|
+
let { fontFeatureSettings, fontVariationSettings } = options
|
|
2018
|
+
|
|
2019
|
+
return {
|
|
2020
|
+
'font-family': Array.isArray(families) ? families.join(', ') : families,
|
|
2021
|
+
...(fontFeatureSettings === undefined
|
|
2022
|
+
? {}
|
|
2023
|
+
: { 'font-feature-settings': fontFeatureSettings }),
|
|
2024
|
+
...(fontVariationSettings === undefined
|
|
2025
|
+
? {}
|
|
2026
|
+
: { 'font-variation-settings': fontVariationSettings }),
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
2029
|
+
},
|
|
2030
|
+
{
|
|
2031
|
+
values: theme('fontFamily'),
|
|
2032
|
+
type: ['lookup', 'generic-name', 'family-name'],
|
|
2033
|
+
}
|
|
2034
|
+
)
|
|
2035
|
+
},
|
|
1532
2036
|
|
|
1533
2037
|
fontSize: ({ matchUtilities, theme }) => {
|
|
1534
2038
|
matchUtilities(
|
|
1535
2039
|
{
|
|
1536
|
-
text: (value) => {
|
|
2040
|
+
text: (value, { modifier }) => {
|
|
1537
2041
|
let [fontSize, options] = Array.isArray(value) ? value : [value]
|
|
1538
|
-
|
|
2042
|
+
|
|
2043
|
+
if (modifier) {
|
|
2044
|
+
return {
|
|
2045
|
+
'font-size': fontSize,
|
|
2046
|
+
'line-height': modifier,
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
|
|
1539
2051
|
? options
|
|
1540
2052
|
: { lineHeight: options }
|
|
1541
2053
|
|
|
@@ -1543,18 +2055,20 @@ export let corePlugins = {
|
|
|
1543
2055
|
'font-size': fontSize,
|
|
1544
2056
|
...(lineHeight === undefined ? {} : { 'line-height': lineHeight }),
|
|
1545
2057
|
...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }),
|
|
2058
|
+
...(fontWeight === undefined ? {} : { 'font-weight': fontWeight }),
|
|
1546
2059
|
}
|
|
1547
2060
|
},
|
|
1548
2061
|
},
|
|
1549
2062
|
{
|
|
1550
2063
|
values: theme('fontSize'),
|
|
2064
|
+
modifiers: theme('lineHeight'),
|
|
1551
2065
|
type: ['absolute-size', 'relative-size', 'length', 'percentage'],
|
|
1552
2066
|
}
|
|
1553
2067
|
)
|
|
1554
2068
|
},
|
|
1555
2069
|
|
|
1556
2070
|
fontWeight: createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
|
|
1557
|
-
type: ['lookup', 'number'],
|
|
2071
|
+
type: ['lookup', 'number', 'any'],
|
|
1558
2072
|
}),
|
|
1559
2073
|
|
|
1560
2074
|
textTransform: ({ addUtilities }) => {
|
|
@@ -1573,57 +2087,59 @@ export let corePlugins = {
|
|
|
1573
2087
|
})
|
|
1574
2088
|
},
|
|
1575
2089
|
|
|
1576
|
-
fontVariantNumeric: ({ addUtilities }) => {
|
|
2090
|
+
fontVariantNumeric: ({ addDefaults, addUtilities }) => {
|
|
2091
|
+
let cssFontVariantNumericValue =
|
|
2092
|
+
'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
|
|
2093
|
+
|
|
2094
|
+
addDefaults('font-variant-numeric', {
|
|
2095
|
+
'--tw-ordinal': ' ',
|
|
2096
|
+
'--tw-slashed-zero': ' ',
|
|
2097
|
+
'--tw-numeric-figure': ' ',
|
|
2098
|
+
'--tw-numeric-spacing': ' ',
|
|
2099
|
+
'--tw-numeric-fraction': ' ',
|
|
2100
|
+
})
|
|
2101
|
+
|
|
1577
2102
|
addUtilities({
|
|
1578
|
-
'@defaults font-variant-numeric': {
|
|
1579
|
-
'--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1580
|
-
'--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1581
|
-
'--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1582
|
-
'--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1583
|
-
'--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1584
|
-
'--tw-font-variant-numeric':
|
|
1585
|
-
'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
|
|
1586
|
-
},
|
|
1587
2103
|
'.normal-nums': { 'font-variant-numeric': 'normal' },
|
|
1588
2104
|
'.ordinal': {
|
|
1589
2105
|
'@defaults font-variant-numeric': {},
|
|
1590
2106
|
'--tw-ordinal': 'ordinal',
|
|
1591
|
-
'font-variant-numeric':
|
|
2107
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1592
2108
|
},
|
|
1593
2109
|
'.slashed-zero': {
|
|
1594
2110
|
'@defaults font-variant-numeric': {},
|
|
1595
2111
|
'--tw-slashed-zero': 'slashed-zero',
|
|
1596
|
-
'font-variant-numeric':
|
|
2112
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1597
2113
|
},
|
|
1598
2114
|
'.lining-nums': {
|
|
1599
2115
|
'@defaults font-variant-numeric': {},
|
|
1600
2116
|
'--tw-numeric-figure': 'lining-nums',
|
|
1601
|
-
'font-variant-numeric':
|
|
2117
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1602
2118
|
},
|
|
1603
2119
|
'.oldstyle-nums': {
|
|
1604
2120
|
'@defaults font-variant-numeric': {},
|
|
1605
2121
|
'--tw-numeric-figure': 'oldstyle-nums',
|
|
1606
|
-
'font-variant-numeric':
|
|
2122
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1607
2123
|
},
|
|
1608
2124
|
'.proportional-nums': {
|
|
1609
2125
|
'@defaults font-variant-numeric': {},
|
|
1610
2126
|
'--tw-numeric-spacing': 'proportional-nums',
|
|
1611
|
-
'font-variant-numeric':
|
|
2127
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1612
2128
|
},
|
|
1613
2129
|
'.tabular-nums': {
|
|
1614
2130
|
'@defaults font-variant-numeric': {},
|
|
1615
2131
|
'--tw-numeric-spacing': 'tabular-nums',
|
|
1616
|
-
'font-variant-numeric':
|
|
2132
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1617
2133
|
},
|
|
1618
2134
|
'.diagonal-fractions': {
|
|
1619
2135
|
'@defaults font-variant-numeric': {},
|
|
1620
2136
|
'--tw-numeric-fraction': 'diagonal-fractions',
|
|
1621
|
-
'font-variant-numeric':
|
|
2137
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1622
2138
|
},
|
|
1623
2139
|
'.stacked-fractions': {
|
|
1624
2140
|
'@defaults font-variant-numeric': {},
|
|
1625
2141
|
'--tw-numeric-fraction': 'stacked-fractions',
|
|
1626
|
-
'font-variant-numeric':
|
|
2142
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1627
2143
|
},
|
|
1628
2144
|
})
|
|
1629
2145
|
},
|
|
@@ -1648,7 +2164,7 @@ export let corePlugins = {
|
|
|
1648
2164
|
})
|
|
1649
2165
|
},
|
|
1650
2166
|
},
|
|
1651
|
-
{ values: flattenColorPalette(theme('textColor')), type: 'color' }
|
|
2167
|
+
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
|
|
1652
2168
|
)
|
|
1653
2169
|
},
|
|
1654
2170
|
|
|
@@ -1656,10 +2172,10 @@ export let corePlugins = {
|
|
|
1656
2172
|
|
|
1657
2173
|
textDecoration: ({ addUtilities }) => {
|
|
1658
2174
|
addUtilities({
|
|
1659
|
-
'.underline': { 'text-decoration': 'underline' },
|
|
1660
|
-
'.overline': { 'text-decoration': 'overline' },
|
|
1661
|
-
'.line-through': { 'text-decoration': 'line-through' },
|
|
1662
|
-
'.no-underline': { 'text-decoration': 'none' },
|
|
2175
|
+
'.underline': { 'text-decoration-line': 'underline' },
|
|
2176
|
+
'.overline': { 'text-decoration-line': 'overline' },
|
|
2177
|
+
'.line-through': { 'text-decoration-line': 'line-through' },
|
|
2178
|
+
'.no-underline': { 'text-decoration-line': 'none' },
|
|
1663
2179
|
})
|
|
1664
2180
|
},
|
|
1665
2181
|
|
|
@@ -1670,7 +2186,7 @@ export let corePlugins = {
|
|
|
1670
2186
|
return { 'text-decoration-color': toColorValue(value) }
|
|
1671
2187
|
},
|
|
1672
2188
|
},
|
|
1673
|
-
{ values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
|
|
2189
|
+
{ values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
|
|
1674
2190
|
)
|
|
1675
2191
|
},
|
|
1676
2192
|
|
|
@@ -1693,7 +2209,7 @@ export let corePlugins = {
|
|
|
1693
2209
|
textUnderlineOffset: createUtilityPlugin(
|
|
1694
2210
|
'textUnderlineOffset',
|
|
1695
2211
|
[['underline-offset', ['text-underline-offset']]],
|
|
1696
|
-
{ type: ['length', 'percentage'] }
|
|
2212
|
+
{ type: ['length', 'percentage', 'any'] }
|
|
1697
2213
|
),
|
|
1698
2214
|
|
|
1699
2215
|
fontSmoothing: ({ addUtilities }) => {
|
|
@@ -1808,6 +2324,7 @@ export let corePlugins = {
|
|
|
1808
2324
|
'.mix-blend-saturation': { 'mix-blend-mode': 'saturation' },
|
|
1809
2325
|
'.mix-blend-color': { 'mix-blend-mode': 'color' },
|
|
1810
2326
|
'.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' },
|
|
2327
|
+
'.mix-blend-plus-lighter': { 'mix-blend-mode': 'plus-lighter' },
|
|
1811
2328
|
})
|
|
1812
2329
|
},
|
|
1813
2330
|
|
|
@@ -1819,14 +2336,12 @@ export let corePlugins = {
|
|
|
1819
2336
|
`var(--tw-shadow)`,
|
|
1820
2337
|
].join(', ')
|
|
1821
2338
|
|
|
1822
|
-
return function ({ matchUtilities,
|
|
1823
|
-
|
|
1824
|
-
'
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
'--tw-shadow-colored': '0 0 #0000',
|
|
1829
|
-
},
|
|
2339
|
+
return function ({ matchUtilities, addDefaults, theme }) {
|
|
2340
|
+
addDefaults(' box-shadow', {
|
|
2341
|
+
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
2342
|
+
'--tw-ring-shadow': '0 0 #0000',
|
|
2343
|
+
'--tw-shadow': '0 0 #0000',
|
|
2344
|
+
'--tw-shadow-colored': '0 0 #0000',
|
|
1830
2345
|
})
|
|
1831
2346
|
|
|
1832
2347
|
matchUtilities(
|
|
@@ -1867,7 +2382,7 @@ export let corePlugins = {
|
|
|
1867
2382
|
}
|
|
1868
2383
|
},
|
|
1869
2384
|
},
|
|
1870
|
-
{ values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
|
|
2385
|
+
{ values: flattenColorPalette(theme('boxShadowColor')), type: ['color', 'any'] }
|
|
1871
2386
|
)
|
|
1872
2387
|
},
|
|
1873
2388
|
|
|
@@ -1881,7 +2396,6 @@ export let corePlugins = {
|
|
|
1881
2396
|
'.outline-dashed': { 'outline-style': 'dashed' },
|
|
1882
2397
|
'.outline-dotted': { 'outline-style': 'dotted' },
|
|
1883
2398
|
'.outline-double': { 'outline-style': 'double' },
|
|
1884
|
-
'.outline-hidden': { 'outline-style': 'hidden' },
|
|
1885
2399
|
})
|
|
1886
2400
|
},
|
|
1887
2401
|
|
|
@@ -1890,7 +2404,8 @@ export let corePlugins = {
|
|
|
1890
2404
|
}),
|
|
1891
2405
|
|
|
1892
2406
|
outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
|
|
1893
|
-
type: ['length', 'number', 'percentage'],
|
|
2407
|
+
type: ['length', 'number', 'percentage', 'any'],
|
|
2408
|
+
supportsNegativeValues: true,
|
|
1894
2409
|
}),
|
|
1895
2410
|
|
|
1896
2411
|
outlineColor: ({ matchUtilities, theme }) => {
|
|
@@ -1900,29 +2415,38 @@ export let corePlugins = {
|
|
|
1900
2415
|
return { 'outline-color': toColorValue(value) }
|
|
1901
2416
|
},
|
|
1902
2417
|
},
|
|
1903
|
-
{ values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
|
|
2418
|
+
{ values: flattenColorPalette(theme('outlineColor')), type: ['color', 'any'] }
|
|
1904
2419
|
)
|
|
1905
2420
|
},
|
|
1906
2421
|
|
|
1907
|
-
ringWidth: ({ matchUtilities,
|
|
1908
|
-
let
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
`rgb(147 197 253 / ${ringOpacityDefault})`
|
|
1913
|
-
)
|
|
2422
|
+
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
|
|
2423
|
+
let ringColorDefault = (() => {
|
|
2424
|
+
if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
|
|
2425
|
+
return theme('ringColor.DEFAULT')
|
|
2426
|
+
}
|
|
1914
2427
|
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
'
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
2428
|
+
let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
|
|
2429
|
+
|
|
2430
|
+
if (!theme('ringColor')?.DEFAULT) {
|
|
2431
|
+
return `rgb(147 197 253 / ${ringOpacityDefault})`
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
return withAlphaValue(
|
|
2435
|
+
theme('ringColor')?.DEFAULT,
|
|
2436
|
+
ringOpacityDefault,
|
|
2437
|
+
`rgb(147 197 253 / ${ringOpacityDefault})`
|
|
2438
|
+
)
|
|
2439
|
+
})()
|
|
2440
|
+
|
|
2441
|
+
addDefaults('ring-width', {
|
|
2442
|
+
'--tw-ring-inset': ' ',
|
|
2443
|
+
'--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
|
|
2444
|
+
'--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
|
|
2445
|
+
'--tw-ring-color': ringColorDefault,
|
|
2446
|
+
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
2447
|
+
'--tw-ring-shadow': '0 0 #0000',
|
|
2448
|
+
'--tw-shadow': '0 0 #0000',
|
|
2449
|
+
'--tw-shadow-colored': '0 0 #0000',
|
|
1926
2450
|
})
|
|
1927
2451
|
|
|
1928
2452
|
matchUtilities(
|
|
@@ -1948,10 +2472,16 @@ export let corePlugins = {
|
|
|
1948
2472
|
})
|
|
1949
2473
|
},
|
|
1950
2474
|
|
|
1951
|
-
ringColor: ({ matchUtilities, theme }) => {
|
|
2475
|
+
ringColor: ({ matchUtilities, theme, corePlugins }) => {
|
|
1952
2476
|
matchUtilities(
|
|
1953
2477
|
{
|
|
1954
2478
|
ring: (value) => {
|
|
2479
|
+
if (!corePlugins('ringOpacity')) {
|
|
2480
|
+
return {
|
|
2481
|
+
'--tw-ring-color': toColorValue(value),
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
|
|
1955
2485
|
return withAlphaVariable({
|
|
1956
2486
|
color: value,
|
|
1957
2487
|
property: '--tw-ring-color',
|
|
@@ -1965,14 +2495,18 @@ export let corePlugins = {
|
|
|
1965
2495
|
([modifier]) => modifier !== 'DEFAULT'
|
|
1966
2496
|
)
|
|
1967
2497
|
),
|
|
1968
|
-
type: 'color',
|
|
2498
|
+
type: ['color', 'any'],
|
|
1969
2499
|
}
|
|
1970
2500
|
)
|
|
1971
2501
|
},
|
|
1972
2502
|
|
|
1973
|
-
ringOpacity:
|
|
1974
|
-
|
|
1975
|
-
|
|
2503
|
+
ringOpacity: (helpers) => {
|
|
2504
|
+
let { config } = helpers
|
|
2505
|
+
|
|
2506
|
+
return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], {
|
|
2507
|
+
filterDefault: !flagEnabled(config(), 'respectDefaultRingColorOpacity'),
|
|
2508
|
+
})(helpers)
|
|
2509
|
+
},
|
|
1976
2510
|
ringOffsetWidth: createUtilityPlugin(
|
|
1977
2511
|
'ringOffsetWidth',
|
|
1978
2512
|
[['ring-offset', ['--tw-ring-offset-width']]],
|
|
@@ -1988,7 +2522,7 @@ export let corePlugins = {
|
|
|
1988
2522
|
}
|
|
1989
2523
|
},
|
|
1990
2524
|
},
|
|
1991
|
-
{ values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' }
|
|
2525
|
+
{ values: flattenColorPalette(theme('ringOffsetColor')), type: ['color', 'any'] }
|
|
1992
2526
|
)
|
|
1993
2527
|
},
|
|
1994
2528
|
|
|
@@ -1999,7 +2533,7 @@ export let corePlugins = {
|
|
|
1999
2533
|
return {
|
|
2000
2534
|
'--tw-blur': `blur(${value})`,
|
|
2001
2535
|
'@defaults filter': {},
|
|
2002
|
-
filter:
|
|
2536
|
+
filter: cssFilterValue,
|
|
2003
2537
|
}
|
|
2004
2538
|
},
|
|
2005
2539
|
},
|
|
@@ -2014,7 +2548,7 @@ export let corePlugins = {
|
|
|
2014
2548
|
return {
|
|
2015
2549
|
'--tw-brightness': `brightness(${value})`,
|
|
2016
2550
|
'@defaults filter': {},
|
|
2017
|
-
filter:
|
|
2551
|
+
filter: cssFilterValue,
|
|
2018
2552
|
}
|
|
2019
2553
|
},
|
|
2020
2554
|
},
|
|
@@ -2029,7 +2563,7 @@ export let corePlugins = {
|
|
|
2029
2563
|
return {
|
|
2030
2564
|
'--tw-contrast': `contrast(${value})`,
|
|
2031
2565
|
'@defaults filter': {},
|
|
2032
|
-
filter:
|
|
2566
|
+
filter: cssFilterValue,
|
|
2033
2567
|
}
|
|
2034
2568
|
},
|
|
2035
2569
|
},
|
|
@@ -2046,7 +2580,7 @@ export let corePlugins = {
|
|
|
2046
2580
|
? value.map((v) => `drop-shadow(${v})`).join(' ')
|
|
2047
2581
|
: `drop-shadow(${value})`,
|
|
2048
2582
|
'@defaults filter': {},
|
|
2049
|
-
filter:
|
|
2583
|
+
filter: cssFilterValue,
|
|
2050
2584
|
}
|
|
2051
2585
|
},
|
|
2052
2586
|
},
|
|
@@ -2061,7 +2595,7 @@ export let corePlugins = {
|
|
|
2061
2595
|
return {
|
|
2062
2596
|
'--tw-grayscale': `grayscale(${value})`,
|
|
2063
2597
|
'@defaults filter': {},
|
|
2064
|
-
filter:
|
|
2598
|
+
filter: cssFilterValue,
|
|
2065
2599
|
}
|
|
2066
2600
|
},
|
|
2067
2601
|
},
|
|
@@ -2076,7 +2610,7 @@ export let corePlugins = {
|
|
|
2076
2610
|
return {
|
|
2077
2611
|
'--tw-hue-rotate': `hue-rotate(${value})`,
|
|
2078
2612
|
'@defaults filter': {},
|
|
2079
|
-
filter:
|
|
2613
|
+
filter: cssFilterValue,
|
|
2080
2614
|
}
|
|
2081
2615
|
},
|
|
2082
2616
|
},
|
|
@@ -2091,7 +2625,7 @@ export let corePlugins = {
|
|
|
2091
2625
|
return {
|
|
2092
2626
|
'--tw-invert': `invert(${value})`,
|
|
2093
2627
|
'@defaults filter': {},
|
|
2094
|
-
filter:
|
|
2628
|
+
filter: cssFilterValue,
|
|
2095
2629
|
}
|
|
2096
2630
|
},
|
|
2097
2631
|
},
|
|
@@ -2106,7 +2640,7 @@ export let corePlugins = {
|
|
|
2106
2640
|
return {
|
|
2107
2641
|
'--tw-saturate': `saturate(${value})`,
|
|
2108
2642
|
'@defaults filter': {},
|
|
2109
|
-
filter:
|
|
2643
|
+
filter: cssFilterValue,
|
|
2110
2644
|
}
|
|
2111
2645
|
},
|
|
2112
2646
|
},
|
|
@@ -2121,7 +2655,7 @@ export let corePlugins = {
|
|
|
2121
2655
|
return {
|
|
2122
2656
|
'--tw-sepia': `sepia(${value})`,
|
|
2123
2657
|
'@defaults filter': {},
|
|
2124
|
-
filter:
|
|
2658
|
+
filter: cssFilterValue,
|
|
2125
2659
|
}
|
|
2126
2660
|
},
|
|
2127
2661
|
},
|
|
@@ -2129,33 +2663,20 @@ export let corePlugins = {
|
|
|
2129
2663
|
)
|
|
2130
2664
|
},
|
|
2131
2665
|
|
|
2132
|
-
filter: ({
|
|
2133
|
-
|
|
2134
|
-
'
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
'var(--tw-brightness)',
|
|
2147
|
-
'var(--tw-contrast)',
|
|
2148
|
-
'var(--tw-grayscale)',
|
|
2149
|
-
'var(--tw-hue-rotate)',
|
|
2150
|
-
'var(--tw-invert)',
|
|
2151
|
-
'var(--tw-saturate)',
|
|
2152
|
-
'var(--tw-sepia)',
|
|
2153
|
-
'var(--tw-drop-shadow)',
|
|
2154
|
-
].join(' '),
|
|
2155
|
-
},
|
|
2156
|
-
})
|
|
2157
|
-
addUtilities({
|
|
2158
|
-
'.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
|
|
2666
|
+
filter: ({ addDefaults, addUtilities }) => {
|
|
2667
|
+
addDefaults('filter', {
|
|
2668
|
+
'--tw-blur': ' ',
|
|
2669
|
+
'--tw-brightness': ' ',
|
|
2670
|
+
'--tw-contrast': ' ',
|
|
2671
|
+
'--tw-grayscale': ' ',
|
|
2672
|
+
'--tw-hue-rotate': ' ',
|
|
2673
|
+
'--tw-invert': ' ',
|
|
2674
|
+
'--tw-saturate': ' ',
|
|
2675
|
+
'--tw-sepia': ' ',
|
|
2676
|
+
'--tw-drop-shadow': ' ',
|
|
2677
|
+
})
|
|
2678
|
+
addUtilities({
|
|
2679
|
+
'.filter': { '@defaults filter': {}, filter: cssFilterValue },
|
|
2159
2680
|
'.filter-none': { filter: 'none' },
|
|
2160
2681
|
})
|
|
2161
2682
|
},
|
|
@@ -2167,7 +2688,7 @@ export let corePlugins = {
|
|
|
2167
2688
|
return {
|
|
2168
2689
|
'--tw-backdrop-blur': `blur(${value})`,
|
|
2169
2690
|
'@defaults backdrop-filter': {},
|
|
2170
|
-
'backdrop-filter':
|
|
2691
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2171
2692
|
}
|
|
2172
2693
|
},
|
|
2173
2694
|
},
|
|
@@ -2182,7 +2703,7 @@ export let corePlugins = {
|
|
|
2182
2703
|
return {
|
|
2183
2704
|
'--tw-backdrop-brightness': `brightness(${value})`,
|
|
2184
2705
|
'@defaults backdrop-filter': {},
|
|
2185
|
-
'backdrop-filter':
|
|
2706
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2186
2707
|
}
|
|
2187
2708
|
},
|
|
2188
2709
|
},
|
|
@@ -2197,7 +2718,7 @@ export let corePlugins = {
|
|
|
2197
2718
|
return {
|
|
2198
2719
|
'--tw-backdrop-contrast': `contrast(${value})`,
|
|
2199
2720
|
'@defaults backdrop-filter': {},
|
|
2200
|
-
'backdrop-filter':
|
|
2721
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2201
2722
|
}
|
|
2202
2723
|
},
|
|
2203
2724
|
},
|
|
@@ -2212,7 +2733,7 @@ export let corePlugins = {
|
|
|
2212
2733
|
return {
|
|
2213
2734
|
'--tw-backdrop-grayscale': `grayscale(${value})`,
|
|
2214
2735
|
'@defaults backdrop-filter': {},
|
|
2215
|
-
'backdrop-filter':
|
|
2736
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2216
2737
|
}
|
|
2217
2738
|
},
|
|
2218
2739
|
},
|
|
@@ -2227,7 +2748,7 @@ export let corePlugins = {
|
|
|
2227
2748
|
return {
|
|
2228
2749
|
'--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
|
|
2229
2750
|
'@defaults backdrop-filter': {},
|
|
2230
|
-
'backdrop-filter':
|
|
2751
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2231
2752
|
}
|
|
2232
2753
|
},
|
|
2233
2754
|
},
|
|
@@ -2242,7 +2763,7 @@ export let corePlugins = {
|
|
|
2242
2763
|
return {
|
|
2243
2764
|
'--tw-backdrop-invert': `invert(${value})`,
|
|
2244
2765
|
'@defaults backdrop-filter': {},
|
|
2245
|
-
'backdrop-filter':
|
|
2766
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2246
2767
|
}
|
|
2247
2768
|
},
|
|
2248
2769
|
},
|
|
@@ -2257,7 +2778,7 @@ export let corePlugins = {
|
|
|
2257
2778
|
return {
|
|
2258
2779
|
'--tw-backdrop-opacity': `opacity(${value})`,
|
|
2259
2780
|
'@defaults backdrop-filter': {},
|
|
2260
|
-
'backdrop-filter':
|
|
2781
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2261
2782
|
}
|
|
2262
2783
|
},
|
|
2263
2784
|
},
|
|
@@ -2272,7 +2793,7 @@ export let corePlugins = {
|
|
|
2272
2793
|
return {
|
|
2273
2794
|
'--tw-backdrop-saturate': `saturate(${value})`,
|
|
2274
2795
|
'@defaults backdrop-filter': {},
|
|
2275
|
-
'backdrop-filter':
|
|
2796
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2276
2797
|
}
|
|
2277
2798
|
},
|
|
2278
2799
|
},
|
|
@@ -2287,7 +2808,7 @@ export let corePlugins = {
|
|
|
2287
2808
|
return {
|
|
2288
2809
|
'--tw-backdrop-sepia': `sepia(${value})`,
|
|
2289
2810
|
'@defaults backdrop-filter': {},
|
|
2290
|
-
'backdrop-filter':
|
|
2811
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2291
2812
|
}
|
|
2292
2813
|
},
|
|
2293
2814
|
},
|
|
@@ -2295,35 +2816,22 @@ export let corePlugins = {
|
|
|
2295
2816
|
)
|
|
2296
2817
|
},
|
|
2297
2818
|
|
|
2298
|
-
backdropFilter: ({
|
|
2299
|
-
|
|
2300
|
-
'
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
'--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
2310
|
-
'--tw-backdrop-filter': [
|
|
2311
|
-
'var(--tw-backdrop-blur)',
|
|
2312
|
-
'var(--tw-backdrop-brightness)',
|
|
2313
|
-
'var(--tw-backdrop-contrast)',
|
|
2314
|
-
'var(--tw-backdrop-grayscale)',
|
|
2315
|
-
'var(--tw-backdrop-hue-rotate)',
|
|
2316
|
-
'var(--tw-backdrop-invert)',
|
|
2317
|
-
'var(--tw-backdrop-opacity)',
|
|
2318
|
-
'var(--tw-backdrop-saturate)',
|
|
2319
|
-
'var(--tw-backdrop-sepia)',
|
|
2320
|
-
].join(' '),
|
|
2321
|
-
},
|
|
2819
|
+
backdropFilter: ({ addDefaults, addUtilities }) => {
|
|
2820
|
+
addDefaults('backdrop-filter', {
|
|
2821
|
+
'--tw-backdrop-blur': ' ',
|
|
2822
|
+
'--tw-backdrop-brightness': ' ',
|
|
2823
|
+
'--tw-backdrop-contrast': ' ',
|
|
2824
|
+
'--tw-backdrop-grayscale': ' ',
|
|
2825
|
+
'--tw-backdrop-hue-rotate': ' ',
|
|
2826
|
+
'--tw-backdrop-invert': ' ',
|
|
2827
|
+
'--tw-backdrop-opacity': ' ',
|
|
2828
|
+
'--tw-backdrop-saturate': ' ',
|
|
2829
|
+
'--tw-backdrop-sepia': ' ',
|
|
2322
2830
|
})
|
|
2323
2831
|
addUtilities({
|
|
2324
2832
|
'.backdrop-filter': {
|
|
2325
2833
|
'@defaults backdrop-filter': {},
|
|
2326
|
-
'backdrop-filter':
|
|
2834
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2327
2835
|
},
|
|
2328
2836
|
'.backdrop-filter-none': { 'backdrop-filter': 'none' },
|
|
2329
2837
|
})
|