tailwindcss 0.0.0-insiders.8259dfd → 0.0.0-insiders.8293c2d
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/CHANGELOG.md +207 -2
- package/README.md +8 -4
- package/colors.js +2 -1
- package/defaultConfig.js +2 -1
- package/defaultTheme.js +2 -1
- package/lib/cli.js +94 -61
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +8 -1
- package/lib/corePlugins.js +477 -517
- package/lib/css/preflight.css +18 -5
- package/lib/featureFlags.js +5 -6
- package/lib/index.js +1 -3
- package/lib/lib/collapseDuplicateDeclarations.js +80 -0
- package/lib/lib/defaultExtractor.js +42 -0
- package/lib/lib/detectNesting.js +17 -2
- package/lib/lib/evaluateTailwindFunctions.js +10 -6
- package/lib/lib/expandApplyAtRules.js +94 -45
- package/lib/lib/expandTailwindAtRules.js +32 -33
- package/lib/lib/generateRules.js +167 -21
- package/lib/lib/normalizeTailwindDirectives.js +8 -1
- package/lib/lib/partitionApplyAtRules.js +53 -0
- package/lib/lib/resolveDefaultsAtRules.js +28 -14
- package/lib/lib/setupContextUtils.js +153 -129
- package/lib/lib/setupTrackingContext.js +11 -10
- package/lib/lib/sharedState.js +34 -5
- package/lib/lib/substituteScreenAtRules.js +7 -4
- package/lib/processTailwindFeatures.js +7 -2
- package/lib/util/buildMediaQuery.js +13 -24
- package/lib/util/color.js +23 -8
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +6 -10
- package/lib/util/dataTypes.js +38 -7
- package/lib/util/defaults.js +6 -0
- package/lib/util/flattenColorPalette.js +1 -3
- package/lib/util/formatVariantSelector.js +186 -0
- package/lib/util/isValidArbitraryValue.js +64 -0
- package/lib/util/log.js +4 -0
- package/lib/util/nameClass.js +1 -0
- package/lib/util/normalizeConfig.js +63 -21
- package/lib/util/normalizeScreens.js +59 -0
- package/lib/util/parseBoxShadowValue.js +77 -0
- package/lib/util/pluginUtils.js +27 -158
- package/lib/util/prefixSelector.js +1 -3
- package/lib/util/resolveConfig.js +30 -31
- package/lib/util/resolveConfigPath.js +1 -2
- package/lib/util/toColorValue.js +1 -2
- package/lib/util/toPath.js +6 -1
- package/lib/util/transformThemeValue.js +19 -13
- package/nesting/plugin.js +4 -1
- package/package.json +19 -21
- package/peers/index.js +4621 -5626
- package/plugin.js +2 -1
- package/resolveConfig.js +2 -1
- package/src/cli.js +66 -14
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +406 -518
- package/src/css/preflight.css +18 -5
- package/src/featureFlags.js +1 -1
- package/src/index.js +1 -7
- package/src/lib/collapseDuplicateDeclarations.js +93 -0
- package/src/lib/defaultExtractor.js +48 -0
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/evaluateTailwindFunctions.js +6 -3
- package/src/lib/expandApplyAtRules.js +101 -45
- package/src/lib/expandTailwindAtRules.js +33 -27
- package/src/lib/generateRules.js +178 -11
- package/src/lib/normalizeTailwindDirectives.js +6 -1
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/resolveDefaultsAtRules.js +31 -10
- package/src/lib/setupContextUtils.js +140 -84
- package/src/lib/setupTrackingContext.js +11 -10
- package/src/lib/sharedState.js +40 -4
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/processTailwindFeatures.js +8 -2
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/color.js +20 -7
- package/src/util/dataTypes.js +43 -11
- package/src/util/defaults.js +6 -0
- package/src/util/formatVariantSelector.js +196 -0
- package/src/util/isValidArbitraryValue.js +61 -0
- package/src/util/log.js +4 -0
- package/src/util/nameClass.js +1 -1
- package/src/util/normalizeConfig.js +37 -2
- package/src/util/normalizeScreens.js +45 -0
- package/src/util/parseBoxShadowValue.js +71 -0
- package/src/util/pluginUtils.js +15 -138
- package/src/util/prefixSelector.js +1 -4
- package/src/util/resolveConfig.js +11 -1
- package/src/util/toPath.js +23 -1
- package/src/util/transformThemeValue.js +22 -7
- package/stubs/defaultConfig.stub.js +42 -16
- package/lib/lib/setupWatchingContext.js +0 -284
- package/src/lib/setupWatchingContext.js +0 -304
package/src/corePlugins.js
CHANGED
|
@@ -3,129 +3,61 @@ 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 prefixSelector from './util/prefixSelector'
|
|
7
6
|
import parseAnimationValue from './util/parseAnimationValue'
|
|
8
7
|
import flattenColorPalette from './util/flattenColorPalette'
|
|
9
8
|
import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable'
|
|
10
9
|
import toColorValue from './util/toColorValue'
|
|
11
10
|
import isPlainObject from './util/isPlainObject'
|
|
12
11
|
import transformThemeValue from './util/transformThemeValue'
|
|
13
|
-
import {
|
|
14
|
-
applyStateToMarker,
|
|
15
|
-
updateLastClasses,
|
|
16
|
-
updateAllClasses,
|
|
17
|
-
transformAllSelectors,
|
|
18
|
-
transformAllClasses,
|
|
19
|
-
transformLastClasses,
|
|
20
|
-
} from './util/pluginUtils'
|
|
21
12
|
import { version as tailwindVersion } from '../package.json'
|
|
22
13
|
import log from './util/log'
|
|
14
|
+
import { normalizeScreens } from './util/normalizeScreens'
|
|
15
|
+
import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
|
|
23
16
|
|
|
24
17
|
export let variantPlugins = {
|
|
25
|
-
pseudoElementVariants: ({
|
|
26
|
-
addVariant(
|
|
27
|
-
|
|
28
|
-
transformAllSelectors((selector) => {
|
|
29
|
-
return updateAllClasses(selector, (className, { withPseudo }) => {
|
|
30
|
-
return withPseudo(`first-letter${config('separator')}${className}`, '::first-letter')
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
)
|
|
18
|
+
pseudoElementVariants: ({ addVariant }) => {
|
|
19
|
+
addVariant('first-letter', '&::first-letter')
|
|
20
|
+
addVariant('first-line', '&::first-line')
|
|
34
21
|
|
|
35
|
-
addVariant(
|
|
36
|
-
|
|
37
|
-
transformAllSelectors((selector) => {
|
|
38
|
-
return updateAllClasses(selector, (className, { withPseudo }) => {
|
|
39
|
-
return withPseudo(`first-line${config('separator')}${className}`, '::first-line')
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
)
|
|
22
|
+
addVariant('marker', ['& *::marker', '&::marker'])
|
|
23
|
+
addVariant('selection', ['& *::selection', '&::selection'])
|
|
43
24
|
|
|
44
|
-
addVariant('
|
|
45
|
-
transformAllSelectors((selector) => {
|
|
46
|
-
let variantSelector = updateAllClasses(selector, (className) => {
|
|
47
|
-
return `marker${config('separator')}${className}`
|
|
48
|
-
})
|
|
25
|
+
addVariant('file', '&::file-selector-button')
|
|
49
26
|
|
|
50
|
-
|
|
51
|
-
}),
|
|
52
|
-
transformAllSelectors((selector) => {
|
|
53
|
-
return updateAllClasses(selector, (className, { withPseudo }) => {
|
|
54
|
-
return withPseudo(`marker${config('separator')}${className}`, '::marker')
|
|
55
|
-
})
|
|
56
|
-
}),
|
|
57
|
-
])
|
|
27
|
+
addVariant('placeholder', '&::placeholder')
|
|
58
28
|
|
|
59
|
-
addVariant('
|
|
60
|
-
|
|
61
|
-
let
|
|
62
|
-
|
|
29
|
+
addVariant('before', ({ container }) => {
|
|
30
|
+
container.walkRules((rule) => {
|
|
31
|
+
let foundContent = false
|
|
32
|
+
rule.walkDecls('content', () => {
|
|
33
|
+
foundContent = true
|
|
63
34
|
})
|
|
64
35
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return withPseudo(`selection${config('separator')}${className}`, '::selection')
|
|
70
|
-
})
|
|
71
|
-
}),
|
|
72
|
-
])
|
|
36
|
+
if (!foundContent) {
|
|
37
|
+
rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
|
|
38
|
+
}
|
|
39
|
+
})
|
|
73
40
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
41
|
+
return '&::before'
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
addVariant('after', ({ container }) => {
|
|
45
|
+
container.walkRules((rule) => {
|
|
46
|
+
let foundContent = false
|
|
47
|
+
rule.walkDecls('content', () => {
|
|
48
|
+
foundContent = true
|
|
79
49
|
})
|
|
80
|
-
})
|
|
81
|
-
)
|
|
82
50
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
transformAllSelectors(
|
|
86
|
-
(selector) => {
|
|
87
|
-
return updateAllClasses(selector, (className, { withPseudo }) => {
|
|
88
|
-
return withPseudo(`before${config('separator')}${className}`, '::before')
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
withRule: (rule) => {
|
|
93
|
-
let foundContent = false
|
|
94
|
-
rule.walkDecls('content', () => {
|
|
95
|
-
foundContent = true
|
|
96
|
-
})
|
|
97
|
-
if (!foundContent) {
|
|
98
|
-
rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
|
|
99
|
-
}
|
|
100
|
-
},
|
|
51
|
+
if (!foundContent) {
|
|
52
|
+
rule.prepend(postcss.decl({ prop: 'content', value: 'var(--tw-content)' }))
|
|
101
53
|
}
|
|
102
|
-
)
|
|
103
|
-
)
|
|
54
|
+
})
|
|
104
55
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
transformAllSelectors(
|
|
108
|
-
(selector) => {
|
|
109
|
-
return updateAllClasses(selector, (className, { withPseudo }) => {
|
|
110
|
-
return withPseudo(`after${config('separator')}${className}`, '::after')
|
|
111
|
-
})
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
withRule: (rule) => {
|
|
115
|
-
let foundContent = false
|
|
116
|
-
rule.walkDecls('content', () => {
|
|
117
|
-
foundContent = true
|
|
118
|
-
})
|
|
119
|
-
if (!foundContent) {
|
|
120
|
-
rule.prepend(postcss.decl({ prop: 'content', value: '""' }))
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
)
|
|
56
|
+
return '&::after'
|
|
57
|
+
})
|
|
126
58
|
},
|
|
127
59
|
|
|
128
|
-
pseudoClassVariants: ({
|
|
60
|
+
pseudoClassVariants: ({ addVariant }) => {
|
|
129
61
|
let pseudoVariants = [
|
|
130
62
|
// Positional
|
|
131
63
|
['first', ':first-child'],
|
|
@@ -165,137 +97,44 @@ export let variantPlugins = {
|
|
|
165
97
|
'focus-visible',
|
|
166
98
|
'active',
|
|
167
99
|
'disabled',
|
|
168
|
-
]
|
|
169
|
-
|
|
170
|
-
for (let variant of pseudoVariants) {
|
|
171
|
-
let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
|
|
172
|
-
|
|
173
|
-
addVariant(
|
|
174
|
-
variantName,
|
|
175
|
-
transformAllClasses((className, { withAttr, withPseudo }) => {
|
|
176
|
-
if (state.startsWith(':')) {
|
|
177
|
-
return withPseudo(`${variantName}${config('separator')}${className}`, state)
|
|
178
|
-
} else if (state.startsWith('[')) {
|
|
179
|
-
return withAttr(`${variantName}${config('separator')}${className}`, state)
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
let groupMarker = prefixSelector(config('prefix'), '.group')
|
|
186
|
-
for (let variant of pseudoVariants) {
|
|
187
|
-
let [variantName, state] = Array.isArray(variant) ? variant : [variant, `:${variant}`]
|
|
188
|
-
let groupVariantName = `group-${variantName}`
|
|
189
|
-
|
|
190
|
-
addVariant(
|
|
191
|
-
groupVariantName,
|
|
192
|
-
transformAllSelectors((selector) => {
|
|
193
|
-
let variantSelector = updateAllClasses(selector, (className) => {
|
|
194
|
-
if (`.${className}` === groupMarker) return className
|
|
195
|
-
return `${groupVariantName}${config('separator')}${className}`
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
if (variantSelector === selector) {
|
|
199
|
-
return null
|
|
200
|
-
}
|
|
100
|
+
].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
|
|
201
101
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
groupMarker,
|
|
205
|
-
state,
|
|
206
|
-
(marker, selector) => `${marker} ${selector}`
|
|
207
|
-
)
|
|
208
|
-
})
|
|
209
|
-
)
|
|
102
|
+
for (let [variantName, state] of pseudoVariants) {
|
|
103
|
+
addVariant(variantName, `&${state}`)
|
|
210
104
|
}
|
|
211
105
|
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
let peerVariantName = `peer-${variantName}`
|
|
216
|
-
|
|
217
|
-
addVariant(
|
|
218
|
-
peerVariantName,
|
|
219
|
-
transformAllSelectors((selector) => {
|
|
220
|
-
let variantSelector = updateAllClasses(selector, (className) => {
|
|
221
|
-
if (`.${className}` === peerMarker) return className
|
|
222
|
-
return `${peerVariantName}${config('separator')}${className}`
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
if (variantSelector === selector) {
|
|
226
|
-
return null
|
|
227
|
-
}
|
|
106
|
+
for (let [variantName, state] of pseudoVariants) {
|
|
107
|
+
addVariant(`group-${variantName}`, `:merge(.group)${state} &`)
|
|
108
|
+
}
|
|
228
109
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
)
|
|
232
|
-
})
|
|
233
|
-
)
|
|
110
|
+
for (let [variantName, state] of pseudoVariants) {
|
|
111
|
+
addVariant(`peer-${variantName}`, `:merge(.peer)${state} ~ &`)
|
|
234
112
|
}
|
|
235
113
|
},
|
|
236
114
|
|
|
237
|
-
directionVariants: ({
|
|
238
|
-
addVariant(
|
|
239
|
-
'
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
|
|
244
|
-
])
|
|
245
|
-
return `[dir="ltr"] ${updateAllClasses(
|
|
246
|
-
selector,
|
|
247
|
-
(className) => `ltr${config('separator')}${className}`
|
|
248
|
-
)}`
|
|
249
|
-
})
|
|
250
|
-
)
|
|
115
|
+
directionVariants: ({ addVariant }) => {
|
|
116
|
+
addVariant('ltr', () => {
|
|
117
|
+
log.warn('rtl-experimental', [
|
|
118
|
+
'The RTL features in Tailwind CSS are currently in preview.',
|
|
119
|
+
'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
|
|
120
|
+
])
|
|
251
121
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
transformAllSelectors((selector) => {
|
|
255
|
-
log.warn('rtl-experimental', [
|
|
256
|
-
'The RTL features in Tailwind CSS are currently in preview.',
|
|
257
|
-
'Preview features are not covered by semver, and may be improved in breaking ways at any time.',
|
|
258
|
-
])
|
|
259
|
-
return `[dir="rtl"] ${updateAllClasses(
|
|
260
|
-
selector,
|
|
261
|
-
(className) => `rtl${config('separator')}${className}`
|
|
262
|
-
)}`
|
|
263
|
-
})
|
|
264
|
-
)
|
|
265
|
-
},
|
|
122
|
+
return '[dir="ltr"] &'
|
|
123
|
+
})
|
|
266
124
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
return `motion-safe${config('separator')}${className}`
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
wrap: () =>
|
|
276
|
-
postcss.atRule({
|
|
277
|
-
name: 'media',
|
|
278
|
-
params: '(prefers-reduced-motion: no-preference)',
|
|
279
|
-
}),
|
|
280
|
-
}
|
|
281
|
-
)
|
|
282
|
-
)
|
|
125
|
+
addVariant('rtl', () => {
|
|
126
|
+
log.warn('rtl-experimental', [
|
|
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
|
+
])
|
|
283
130
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
wrap: () =>
|
|
292
|
-
postcss.atRule({
|
|
293
|
-
name: 'media',
|
|
294
|
-
params: '(prefers-reduced-motion: reduce)',
|
|
295
|
-
}),
|
|
296
|
-
}
|
|
297
|
-
)
|
|
298
|
-
)
|
|
131
|
+
return '[dir="rtl"] &'
|
|
132
|
+
})
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
reducedMotionVariants: ({ addVariant }) => {
|
|
136
|
+
addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)')
|
|
137
|
+
addVariant('motion-reduce', '@media (prefers-reduced-motion: reduce)')
|
|
299
138
|
},
|
|
300
139
|
|
|
301
140
|
darkVariants: ({ config, addVariant }) => {
|
|
@@ -309,59 +148,63 @@ export let variantPlugins = {
|
|
|
309
148
|
}
|
|
310
149
|
|
|
311
150
|
if (mode === 'class') {
|
|
312
|
-
addVariant(
|
|
313
|
-
'dark',
|
|
314
|
-
transformAllSelectors((selector) => {
|
|
315
|
-
let variantSelector = updateLastClasses(selector, (className) => {
|
|
316
|
-
return `dark${config('separator')}${className}`
|
|
317
|
-
})
|
|
318
|
-
|
|
319
|
-
if (variantSelector === selector) {
|
|
320
|
-
return null
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
let darkSelector = prefixSelector(config('prefix'), `.dark`)
|
|
324
|
-
|
|
325
|
-
return `${darkSelector} ${variantSelector}`
|
|
326
|
-
})
|
|
327
|
-
)
|
|
151
|
+
addVariant('dark', '.dark &')
|
|
328
152
|
} else if (mode === 'media') {
|
|
329
|
-
addVariant(
|
|
330
|
-
'dark',
|
|
331
|
-
transformLastClasses(
|
|
332
|
-
(className) => {
|
|
333
|
-
return `dark${config('separator')}${className}`
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
wrap: () =>
|
|
337
|
-
postcss.atRule({
|
|
338
|
-
name: 'media',
|
|
339
|
-
params: '(prefers-color-scheme: dark)',
|
|
340
|
-
}),
|
|
341
|
-
}
|
|
342
|
-
)
|
|
343
|
-
)
|
|
153
|
+
addVariant('dark', '@media (prefers-color-scheme: dark)')
|
|
344
154
|
}
|
|
345
155
|
},
|
|
346
156
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
let query = buildMediaQuery(size)
|
|
157
|
+
printVariant: ({ addVariant }) => {
|
|
158
|
+
addVariant('print', '@media print')
|
|
159
|
+
},
|
|
351
160
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
},
|
|
358
|
-
{ wrap: () => postcss.atRule({ name: 'media', params: query }) }
|
|
359
|
-
)
|
|
360
|
-
)
|
|
161
|
+
screenVariants: ({ theme, addVariant }) => {
|
|
162
|
+
for (let screen of normalizeScreens(theme('screens'))) {
|
|
163
|
+
let query = buildMediaQuery(screen)
|
|
164
|
+
|
|
165
|
+
addVariant(screen.name, `@media ${query}`)
|
|
361
166
|
}
|
|
362
167
|
},
|
|
168
|
+
|
|
169
|
+
orientationVariants: ({ addVariant }) => {
|
|
170
|
+
addVariant('portrait', '@media (orientation: portrait)')
|
|
171
|
+
addVariant('landscape', '@media (orientation: landscape)')
|
|
172
|
+
},
|
|
363
173
|
}
|
|
364
174
|
|
|
175
|
+
let cssTransformValue = [
|
|
176
|
+
'translate(var(--tw-translate-x), var(--tw-translate-y))',
|
|
177
|
+
'rotate(var(--tw-rotate))',
|
|
178
|
+
'skewX(var(--tw-skew-x))',
|
|
179
|
+
'skewY(var(--tw-skew-y))',
|
|
180
|
+
'scaleX(var(--tw-scale-x))',
|
|
181
|
+
'scaleY(var(--tw-scale-y))',
|
|
182
|
+
].join(' ')
|
|
183
|
+
|
|
184
|
+
let cssFilterValue = [
|
|
185
|
+
'var(--tw-blur)',
|
|
186
|
+
'var(--tw-brightness)',
|
|
187
|
+
'var(--tw-contrast)',
|
|
188
|
+
'var(--tw-grayscale)',
|
|
189
|
+
'var(--tw-hue-rotate)',
|
|
190
|
+
'var(--tw-invert)',
|
|
191
|
+
'var(--tw-saturate)',
|
|
192
|
+
'var(--tw-sepia)',
|
|
193
|
+
'var(--tw-drop-shadow)',
|
|
194
|
+
].join(' ')
|
|
195
|
+
|
|
196
|
+
let cssBackdropFilterValue = [
|
|
197
|
+
'var(--tw-backdrop-blur)',
|
|
198
|
+
'var(--tw-backdrop-brightness)',
|
|
199
|
+
'var(--tw-backdrop-contrast)',
|
|
200
|
+
'var(--tw-backdrop-grayscale)',
|
|
201
|
+
'var(--tw-backdrop-hue-rotate)',
|
|
202
|
+
'var(--tw-backdrop-invert)',
|
|
203
|
+
'var(--tw-backdrop-opacity)',
|
|
204
|
+
'var(--tw-backdrop-saturate)',
|
|
205
|
+
'var(--tw-backdrop-sepia)',
|
|
206
|
+
].join(' ')
|
|
207
|
+
|
|
365
208
|
export let corePlugins = {
|
|
366
209
|
preflight: ({ addBase }) => {
|
|
367
210
|
let preflightStyles = postcss.parse(
|
|
@@ -377,24 +220,10 @@ export let corePlugins = {
|
|
|
377
220
|
},
|
|
378
221
|
|
|
379
222
|
container: (() => {
|
|
380
|
-
function extractMinWidths(breakpoints) {
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
if (!Array.isArray(breakpoints)) {
|
|
387
|
-
breakpoints = [breakpoints]
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
return breakpoints
|
|
391
|
-
.filter((breakpoint) => {
|
|
392
|
-
return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
|
|
393
|
-
})
|
|
394
|
-
.map((breakpoint) => {
|
|
395
|
-
return breakpoint['min-width'] ?? breakpoint.min
|
|
396
|
-
})
|
|
397
|
-
})
|
|
223
|
+
function extractMinWidths(breakpoints = []) {
|
|
224
|
+
return breakpoints
|
|
225
|
+
.flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
|
|
226
|
+
.filter((v) => v !== undefined)
|
|
398
227
|
}
|
|
399
228
|
|
|
400
229
|
function mapMinWidthsToPadding(minWidths, screens, paddings) {
|
|
@@ -423,16 +252,11 @@ export let corePlugins = {
|
|
|
423
252
|
}
|
|
424
253
|
|
|
425
254
|
for (let minWidth of minWidths) {
|
|
426
|
-
for (let
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
mapping.push({
|
|
432
|
-
screen,
|
|
433
|
-
minWidth,
|
|
434
|
-
padding: paddings[screen],
|
|
435
|
-
})
|
|
255
|
+
for (let screen of screens) {
|
|
256
|
+
for (let { min } of screen.values) {
|
|
257
|
+
if (min === minWidth) {
|
|
258
|
+
mapping.push({ minWidth, padding: paddings[screen.name] })
|
|
259
|
+
}
|
|
436
260
|
}
|
|
437
261
|
}
|
|
438
262
|
}
|
|
@@ -441,12 +265,12 @@ export let corePlugins = {
|
|
|
441
265
|
}
|
|
442
266
|
|
|
443
267
|
return function ({ addComponents, theme }) {
|
|
444
|
-
let screens = theme('container.screens', theme('screens'))
|
|
268
|
+
let screens = normalizeScreens(theme('container.screens', theme('screens')))
|
|
445
269
|
let minWidths = extractMinWidths(screens)
|
|
446
270
|
let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
|
|
447
271
|
|
|
448
272
|
let generatePaddingFor = (minWidth) => {
|
|
449
|
-
let paddingConfig = paddings.find((padding) =>
|
|
273
|
+
let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
|
|
450
274
|
|
|
451
275
|
if (!paddingConfig) {
|
|
452
276
|
return {}
|
|
@@ -676,11 +500,11 @@ export let corePlugins = {
|
|
|
676
500
|
[
|
|
677
501
|
[
|
|
678
502
|
'translate-x',
|
|
679
|
-
[['@defaults transform', {}], '--tw-translate-x', ['transform',
|
|
503
|
+
[['@defaults transform', {}], '--tw-translate-x', ['transform', cssTransformValue]],
|
|
680
504
|
],
|
|
681
505
|
[
|
|
682
506
|
'translate-y',
|
|
683
|
-
[['@defaults transform', {}], '--tw-translate-y', ['transform',
|
|
507
|
+
[['@defaults transform', {}], '--tw-translate-y', ['transform', cssTransformValue]],
|
|
684
508
|
],
|
|
685
509
|
],
|
|
686
510
|
],
|
|
@@ -688,95 +512,66 @@ export let corePlugins = {
|
|
|
688
512
|
),
|
|
689
513
|
rotate: createUtilityPlugin(
|
|
690
514
|
'rotate',
|
|
691
|
-
[
|
|
692
|
-
[
|
|
693
|
-
'rotate',
|
|
694
|
-
[['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']],
|
|
695
|
-
],
|
|
696
|
-
],
|
|
515
|
+
[['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', cssTransformValue]]]],
|
|
697
516
|
{ supportsNegativeValues: true }
|
|
698
517
|
),
|
|
699
518
|
skew: createUtilityPlugin(
|
|
700
519
|
'skew',
|
|
701
520
|
[
|
|
702
521
|
[
|
|
703
|
-
[
|
|
704
|
-
|
|
705
|
-
[['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']],
|
|
706
|
-
],
|
|
707
|
-
[
|
|
708
|
-
'skew-y',
|
|
709
|
-
[['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']],
|
|
710
|
-
],
|
|
522
|
+
['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', cssTransformValue]]],
|
|
523
|
+
['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', cssTransformValue]]],
|
|
711
524
|
],
|
|
712
525
|
],
|
|
713
526
|
{ supportsNegativeValues: true }
|
|
714
527
|
),
|
|
715
|
-
scale: createUtilityPlugin(
|
|
716
|
-
|
|
717
|
-
'scale',
|
|
718
|
-
[
|
|
719
|
-
['@defaults transform', {}],
|
|
720
|
-
'--tw-scale-x',
|
|
721
|
-
'--tw-scale-y',
|
|
722
|
-
['transform', 'var(--tw-transform)'],
|
|
723
|
-
],
|
|
724
|
-
],
|
|
528
|
+
scale: createUtilityPlugin(
|
|
529
|
+
'scale',
|
|
725
530
|
[
|
|
726
531
|
[
|
|
727
|
-
'scale
|
|
728
|
-
[
|
|
532
|
+
'scale',
|
|
533
|
+
[
|
|
534
|
+
['@defaults transform', {}],
|
|
535
|
+
'--tw-scale-x',
|
|
536
|
+
'--tw-scale-y',
|
|
537
|
+
['transform', cssTransformValue],
|
|
538
|
+
],
|
|
729
539
|
],
|
|
730
540
|
[
|
|
731
|
-
|
|
732
|
-
|
|
541
|
+
[
|
|
542
|
+
'scale-x',
|
|
543
|
+
[['@defaults transform', {}], '--tw-scale-x', ['transform', cssTransformValue]],
|
|
544
|
+
],
|
|
545
|
+
[
|
|
546
|
+
'scale-y',
|
|
547
|
+
[['@defaults transform', {}], '--tw-scale-y', ['transform', cssTransformValue]],
|
|
548
|
+
],
|
|
733
549
|
],
|
|
734
550
|
],
|
|
735
|
-
|
|
551
|
+
{ supportsNegativeValues: true }
|
|
552
|
+
),
|
|
553
|
+
|
|
554
|
+
transform: ({ addDefaults, addUtilities }) => {
|
|
555
|
+
addDefaults('transform', {
|
|
556
|
+
'--tw-translate-x': '0',
|
|
557
|
+
'--tw-translate-y': '0',
|
|
558
|
+
'--tw-rotate': '0',
|
|
559
|
+
'--tw-skew-x': '0',
|
|
560
|
+
'--tw-skew-y': '0',
|
|
561
|
+
'--tw-scale-x': '1',
|
|
562
|
+
'--tw-scale-y': '1',
|
|
563
|
+
})
|
|
736
564
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
'@defaults transform': {
|
|
740
|
-
'--tw-translate-x': '0',
|
|
741
|
-
'--tw-translate-y': '0',
|
|
742
|
-
'--tw-rotate': '0',
|
|
743
|
-
'--tw-skew-x': '0',
|
|
744
|
-
'--tw-skew-y': '0',
|
|
745
|
-
'--tw-scale-x': '1',
|
|
746
|
-
'--tw-scale-y': '1',
|
|
747
|
-
'--tw-transform': [
|
|
748
|
-
'translateX(var(--tw-translate-x))',
|
|
749
|
-
'translateY(var(--tw-translate-y))',
|
|
750
|
-
'rotate(var(--tw-rotate))',
|
|
751
|
-
'skewX(var(--tw-skew-x))',
|
|
752
|
-
'skewY(var(--tw-skew-y))',
|
|
753
|
-
'scaleX(var(--tw-scale-x))',
|
|
754
|
-
'scaleY(var(--tw-scale-y))',
|
|
755
|
-
].join(' '),
|
|
756
|
-
},
|
|
757
|
-
})
|
|
758
|
-
addUtilities({
|
|
759
|
-
'.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' },
|
|
565
|
+
addUtilities({
|
|
566
|
+
'.transform': { '@defaults transform': {}, transform: cssTransformValue },
|
|
760
567
|
'.transform-cpu': {
|
|
761
|
-
|
|
762
|
-
'translateX(var(--tw-translate-x))',
|
|
763
|
-
'translateY(var(--tw-translate-y))',
|
|
764
|
-
'rotate(var(--tw-rotate))',
|
|
765
|
-
'skewX(var(--tw-skew-x))',
|
|
766
|
-
'skewY(var(--tw-skew-y))',
|
|
767
|
-
'scaleX(var(--tw-scale-x))',
|
|
768
|
-
'scaleY(var(--tw-scale-y))',
|
|
769
|
-
].join(' '),
|
|
568
|
+
transform: cssTransformValue,
|
|
770
569
|
},
|
|
771
570
|
'.transform-gpu': {
|
|
772
|
-
|
|
773
|
-
'
|
|
774
|
-
'
|
|
775
|
-
|
|
776
|
-
'skewY(var(--tw-skew-y))',
|
|
777
|
-
'scaleX(var(--tw-scale-x))',
|
|
778
|
-
'scaleY(var(--tw-scale-y))',
|
|
779
|
-
].join(' '),
|
|
571
|
+
transform: cssTransformValue.replace(
|
|
572
|
+
'translate(var(--tw-translate-x), var(--tw-translate-y))',
|
|
573
|
+
'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)'
|
|
574
|
+
),
|
|
780
575
|
},
|
|
781
576
|
'.transform-none': { transform: 'none' },
|
|
782
577
|
})
|
|
@@ -816,17 +611,53 @@ export let corePlugins = {
|
|
|
816
611
|
|
|
817
612
|
cursor: createUtilityPlugin('cursor'),
|
|
818
613
|
|
|
819
|
-
touchAction: ({ addUtilities }) => {
|
|
614
|
+
touchAction: ({ addDefaults, addUtilities }) => {
|
|
615
|
+
addDefaults('touch-action', {
|
|
616
|
+
'--tw-pan-x': ' ',
|
|
617
|
+
'--tw-pan-y': ' ',
|
|
618
|
+
'--tw-pinch-zoom': ' ',
|
|
619
|
+
})
|
|
620
|
+
|
|
621
|
+
let cssTouchActionValue = 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)'
|
|
622
|
+
|
|
820
623
|
addUtilities({
|
|
821
624
|
'.touch-auto': { 'touch-action': 'auto' },
|
|
822
625
|
'.touch-none': { 'touch-action': 'none' },
|
|
823
|
-
'.touch-pan-x': {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
'.touch-pan-
|
|
829
|
-
|
|
626
|
+
'.touch-pan-x': {
|
|
627
|
+
'@defaults touch-action': {},
|
|
628
|
+
'--tw-pan-x': 'pan-x',
|
|
629
|
+
'touch-action': cssTouchActionValue,
|
|
630
|
+
},
|
|
631
|
+
'.touch-pan-left': {
|
|
632
|
+
'@defaults touch-action': {},
|
|
633
|
+
'--tw-pan-x': 'pan-left',
|
|
634
|
+
'touch-action': cssTouchActionValue,
|
|
635
|
+
},
|
|
636
|
+
'.touch-pan-right': {
|
|
637
|
+
'@defaults touch-action': {},
|
|
638
|
+
'--tw-pan-x': 'pan-right',
|
|
639
|
+
'touch-action': cssTouchActionValue,
|
|
640
|
+
},
|
|
641
|
+
'.touch-pan-y': {
|
|
642
|
+
'@defaults touch-action': {},
|
|
643
|
+
'--tw-pan-y': 'pan-y',
|
|
644
|
+
'touch-action': cssTouchActionValue,
|
|
645
|
+
},
|
|
646
|
+
'.touch-pan-up': {
|
|
647
|
+
'@defaults touch-action': {},
|
|
648
|
+
'--tw-pan-y': 'pan-up',
|
|
649
|
+
'touch-action': cssTouchActionValue,
|
|
650
|
+
},
|
|
651
|
+
'.touch-pan-down': {
|
|
652
|
+
'@defaults touch-action': {},
|
|
653
|
+
'--tw-pan-y': 'pan-down',
|
|
654
|
+
'touch-action': cssTouchActionValue,
|
|
655
|
+
},
|
|
656
|
+
'.touch-pinch-zoom': {
|
|
657
|
+
'@defaults touch-action': {},
|
|
658
|
+
'--tw-pinch-zoom': 'pinch-zoom',
|
|
659
|
+
'touch-action': cssTouchActionValue,
|
|
660
|
+
},
|
|
830
661
|
'.touch-manipulation': { 'touch-action': 'manipulation' },
|
|
831
662
|
})
|
|
832
663
|
},
|
|
@@ -849,11 +680,9 @@ export let corePlugins = {
|
|
|
849
680
|
})
|
|
850
681
|
},
|
|
851
682
|
|
|
852
|
-
scrollSnapType: ({
|
|
853
|
-
|
|
854
|
-
'
|
|
855
|
-
'--tw-scroll-snap-strictness': 'proximity',
|
|
856
|
-
},
|
|
683
|
+
scrollSnapType: ({ addDefaults, addUtilities }) => {
|
|
684
|
+
addDefaults('scroll-snap-type', {
|
|
685
|
+
'--tw-scroll-snap-strictness': 'proximity',
|
|
857
686
|
})
|
|
858
687
|
|
|
859
688
|
addUtilities({
|
|
@@ -1350,24 +1179,7 @@ export let corePlugins = {
|
|
|
1350
1179
|
})
|
|
1351
1180
|
},
|
|
1352
1181
|
|
|
1353
|
-
borderColor: ({
|
|
1354
|
-
if (!corePlugins('borderOpacity')) {
|
|
1355
|
-
let value = theme('borderColor.DEFAULT', 'currentColor')
|
|
1356
|
-
addBase({
|
|
1357
|
-
'@defaults border-width': {
|
|
1358
|
-
'border-color': toColorValue(value),
|
|
1359
|
-
},
|
|
1360
|
-
})
|
|
1361
|
-
} else {
|
|
1362
|
-
addBase({
|
|
1363
|
-
'@defaults border-width': withAlphaVariable({
|
|
1364
|
-
color: theme('borderColor.DEFAULT', 'currentColor'),
|
|
1365
|
-
property: 'border-color',
|
|
1366
|
-
variable: '--tw-border-opacity',
|
|
1367
|
-
}),
|
|
1368
|
-
})
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1182
|
+
borderColor: ({ matchUtilities, theme, corePlugins }) => {
|
|
1371
1183
|
matchUtilities(
|
|
1372
1184
|
{
|
|
1373
1185
|
border: (value) => {
|
|
@@ -1568,8 +1380,10 @@ export let corePlugins = {
|
|
|
1568
1380
|
|
|
1569
1381
|
boxDecorationBreak: ({ addUtilities }) => {
|
|
1570
1382
|
addUtilities({
|
|
1571
|
-
'.decoration-slice': { 'box-decoration-break': 'slice' },
|
|
1572
|
-
'.decoration-clone': { 'box-decoration-break': 'clone' },
|
|
1383
|
+
'.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
|
|
1384
|
+
'.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
|
|
1385
|
+
'.box-decoration-slice': { 'box-decoration-break': 'slice' },
|
|
1386
|
+
'.box-decoration-clone': { 'box-decoration-break': 'clone' },
|
|
1573
1387
|
})
|
|
1574
1388
|
},
|
|
1575
1389
|
|
|
@@ -1743,27 +1557,60 @@ export let corePlugins = {
|
|
|
1743
1557
|
})
|
|
1744
1558
|
},
|
|
1745
1559
|
|
|
1746
|
-
fontVariantNumeric: ({ addUtilities }) => {
|
|
1560
|
+
fontVariantNumeric: ({ addDefaults, addUtilities }) => {
|
|
1561
|
+
let cssFontVariantNumericValue =
|
|
1562
|
+
'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)'
|
|
1563
|
+
|
|
1564
|
+
addDefaults('font-variant-numeric', {
|
|
1565
|
+
'--tw-ordinal': ' ',
|
|
1566
|
+
'--tw-slashed-zero': ' ',
|
|
1567
|
+
'--tw-numeric-figure': ' ',
|
|
1568
|
+
'--tw-numeric-spacing': ' ',
|
|
1569
|
+
'--tw-numeric-fraction': ' ',
|
|
1570
|
+
})
|
|
1571
|
+
|
|
1747
1572
|
addUtilities({
|
|
1748
|
-
'.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions':
|
|
1749
|
-
{
|
|
1750
|
-
'--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1751
|
-
'--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1752
|
-
'--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1753
|
-
'--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1754
|
-
'--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
1755
|
-
'font-variant-numeric':
|
|
1756
|
-
'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)',
|
|
1757
|
-
},
|
|
1758
1573
|
'.normal-nums': { 'font-variant-numeric': 'normal' },
|
|
1759
|
-
'.ordinal': {
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
'.
|
|
1765
|
-
|
|
1766
|
-
|
|
1574
|
+
'.ordinal': {
|
|
1575
|
+
'@defaults font-variant-numeric': {},
|
|
1576
|
+
'--tw-ordinal': 'ordinal',
|
|
1577
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1578
|
+
},
|
|
1579
|
+
'.slashed-zero': {
|
|
1580
|
+
'@defaults font-variant-numeric': {},
|
|
1581
|
+
'--tw-slashed-zero': 'slashed-zero',
|
|
1582
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1583
|
+
},
|
|
1584
|
+
'.lining-nums': {
|
|
1585
|
+
'@defaults font-variant-numeric': {},
|
|
1586
|
+
'--tw-numeric-figure': 'lining-nums',
|
|
1587
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1588
|
+
},
|
|
1589
|
+
'.oldstyle-nums': {
|
|
1590
|
+
'@defaults font-variant-numeric': {},
|
|
1591
|
+
'--tw-numeric-figure': 'oldstyle-nums',
|
|
1592
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1593
|
+
},
|
|
1594
|
+
'.proportional-nums': {
|
|
1595
|
+
'@defaults font-variant-numeric': {},
|
|
1596
|
+
'--tw-numeric-spacing': 'proportional-nums',
|
|
1597
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1598
|
+
},
|
|
1599
|
+
'.tabular-nums': {
|
|
1600
|
+
'@defaults font-variant-numeric': {},
|
|
1601
|
+
'--tw-numeric-spacing': 'tabular-nums',
|
|
1602
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1603
|
+
},
|
|
1604
|
+
'.diagonal-fractions': {
|
|
1605
|
+
'@defaults font-variant-numeric': {},
|
|
1606
|
+
'--tw-numeric-fraction': 'diagonal-fractions',
|
|
1607
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1608
|
+
},
|
|
1609
|
+
'.stacked-fractions': {
|
|
1610
|
+
'@defaults font-variant-numeric': {},
|
|
1611
|
+
'--tw-numeric-fraction': 'stacked-fractions',
|
|
1612
|
+
'font-variant-numeric': cssFontVariantNumericValue,
|
|
1613
|
+
},
|
|
1767
1614
|
})
|
|
1768
1615
|
},
|
|
1769
1616
|
|
|
@@ -1795,9 +1642,10 @@ export let corePlugins = {
|
|
|
1795
1642
|
|
|
1796
1643
|
textDecoration: ({ addUtilities }) => {
|
|
1797
1644
|
addUtilities({
|
|
1798
|
-
'.underline': { 'text-decoration': 'underline' },
|
|
1799
|
-
'.
|
|
1800
|
-
'.
|
|
1645
|
+
'.underline': { 'text-decoration-line': 'underline' },
|
|
1646
|
+
'.overline': { 'text-decoration-line': 'overline' },
|
|
1647
|
+
'.line-through': { 'text-decoration-line': 'line-through' },
|
|
1648
|
+
'.no-underline': { 'text-decoration-line': 'none' },
|
|
1801
1649
|
})
|
|
1802
1650
|
},
|
|
1803
1651
|
|
|
@@ -1808,10 +1656,32 @@ export let corePlugins = {
|
|
|
1808
1656
|
return { 'text-decoration-color': toColorValue(value) }
|
|
1809
1657
|
},
|
|
1810
1658
|
},
|
|
1811
|
-
{ values: flattenColorPalette(theme('textDecorationColor')), type: ['color'
|
|
1659
|
+
{ values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
|
|
1812
1660
|
)
|
|
1813
1661
|
},
|
|
1814
1662
|
|
|
1663
|
+
textDecorationStyle: ({ addUtilities }) => {
|
|
1664
|
+
addUtilities({
|
|
1665
|
+
'.decoration-solid': { 'text-decoration-style': 'solid' },
|
|
1666
|
+
'.decoration-double': { 'text-decoration-style': 'double' },
|
|
1667
|
+
'.decoration-dotted': { 'text-decoration-style': 'dotted' },
|
|
1668
|
+
'.decoration-dashed': { 'text-decoration-style': 'dashed' },
|
|
1669
|
+
'.decoration-wavy': { 'text-decoration-style': 'wavy' },
|
|
1670
|
+
})
|
|
1671
|
+
},
|
|
1672
|
+
|
|
1673
|
+
textDecorationThickness: createUtilityPlugin(
|
|
1674
|
+
'textDecorationThickness',
|
|
1675
|
+
[['decoration', ['text-decoration-thickness']]],
|
|
1676
|
+
{ type: ['length', 'percentage'] }
|
|
1677
|
+
),
|
|
1678
|
+
|
|
1679
|
+
textUnderlineOffset: createUtilityPlugin(
|
|
1680
|
+
'textUnderlineOffset',
|
|
1681
|
+
[['underline-offset', ['text-underline-offset']]],
|
|
1682
|
+
{ type: ['length', 'percentage'] }
|
|
1683
|
+
),
|
|
1684
|
+
|
|
1815
1685
|
fontSmoothing: ({ addUtilities }) => {
|
|
1816
1686
|
addUtilities({
|
|
1817
1687
|
'.antialiased': {
|
|
@@ -1935,13 +1805,12 @@ export let corePlugins = {
|
|
|
1935
1805
|
`var(--tw-shadow)`,
|
|
1936
1806
|
].join(', ')
|
|
1937
1807
|
|
|
1938
|
-
return function ({ matchUtilities,
|
|
1939
|
-
|
|
1940
|
-
'
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
},
|
|
1808
|
+
return function ({ matchUtilities, addDefaults, theme }) {
|
|
1809
|
+
addDefaults(' box-shadow', {
|
|
1810
|
+
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
1811
|
+
'--tw-ring-shadow': '0 0 #0000',
|
|
1812
|
+
'--tw-shadow': '0 0 #0000',
|
|
1813
|
+
'--tw-shadow-colored': '0 0 #0000',
|
|
1945
1814
|
})
|
|
1946
1815
|
|
|
1947
1816
|
matchUtilities(
|
|
@@ -1949,33 +1818,77 @@ export let corePlugins = {
|
|
|
1949
1818
|
shadow: (value) => {
|
|
1950
1819
|
value = transformValue(value)
|
|
1951
1820
|
|
|
1821
|
+
let ast = parseBoxShadowValue(value)
|
|
1822
|
+
for (let shadow of ast) {
|
|
1823
|
+
// Don't override color if the whole shadow is a variable
|
|
1824
|
+
if (!shadow.valid) {
|
|
1825
|
+
continue
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
shadow.color = 'var(--tw-shadow-color)'
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1952
1831
|
return {
|
|
1953
1832
|
'@defaults box-shadow': {},
|
|
1954
1833
|
'--tw-shadow': value === 'none' ? '0 0 #0000' : value,
|
|
1834
|
+
'--tw-shadow-colored': value === 'none' ? '0 0 #0000' : formatBoxShadowValue(ast),
|
|
1955
1835
|
'box-shadow': defaultBoxShadow,
|
|
1956
1836
|
}
|
|
1957
1837
|
},
|
|
1958
1838
|
},
|
|
1959
|
-
{ values: theme('boxShadow') }
|
|
1839
|
+
{ values: theme('boxShadow'), type: ['shadow'] }
|
|
1960
1840
|
)
|
|
1961
1841
|
}
|
|
1962
1842
|
})(),
|
|
1963
1843
|
|
|
1964
|
-
|
|
1844
|
+
boxShadowColor: ({ matchUtilities, theme }) => {
|
|
1965
1845
|
matchUtilities(
|
|
1966
1846
|
{
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1847
|
+
shadow: (value) => {
|
|
1848
|
+
return {
|
|
1849
|
+
'--tw-shadow-color': toColorValue(value),
|
|
1850
|
+
'--tw-shadow': 'var(--tw-shadow-colored)',
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
},
|
|
1854
|
+
{ values: flattenColorPalette(theme('boxShadowColor')), type: ['color'] }
|
|
1855
|
+
)
|
|
1856
|
+
},
|
|
1970
1857
|
|
|
1971
|
-
|
|
1858
|
+
outlineStyle: ({ addUtilities }) => {
|
|
1859
|
+
addUtilities({
|
|
1860
|
+
'.outline-none': {
|
|
1861
|
+
outline: '2px solid transparent',
|
|
1862
|
+
'outline-offset': '2px',
|
|
1863
|
+
},
|
|
1864
|
+
'.outline': { 'outline-style': 'solid' },
|
|
1865
|
+
'.outline-dashed': { 'outline-style': 'dashed' },
|
|
1866
|
+
'.outline-dotted': { 'outline-style': 'dotted' },
|
|
1867
|
+
'.outline-double': { 'outline-style': 'double' },
|
|
1868
|
+
'.outline-hidden': { 'outline-style': 'hidden' },
|
|
1869
|
+
})
|
|
1870
|
+
},
|
|
1871
|
+
|
|
1872
|
+
outlineWidth: createUtilityPlugin('outlineWidth', [['outline', ['outline-width']]], {
|
|
1873
|
+
type: ['length', 'number', 'percentage'],
|
|
1874
|
+
}),
|
|
1875
|
+
|
|
1876
|
+
outlineOffset: createUtilityPlugin('outlineOffset', [['outline-offset', ['outline-offset']]], {
|
|
1877
|
+
type: ['length', 'number', 'percentage'],
|
|
1878
|
+
}),
|
|
1879
|
+
|
|
1880
|
+
outlineColor: ({ matchUtilities, theme }) => {
|
|
1881
|
+
matchUtilities(
|
|
1882
|
+
{
|
|
1883
|
+
outline: (value) => {
|
|
1884
|
+
return { 'outline-color': toColorValue(value) }
|
|
1972
1885
|
},
|
|
1973
1886
|
},
|
|
1974
|
-
{ values: theme('
|
|
1887
|
+
{ values: flattenColorPalette(theme('outlineColor')), type: ['color'] }
|
|
1975
1888
|
)
|
|
1976
1889
|
},
|
|
1977
1890
|
|
|
1978
|
-
ringWidth: ({ matchUtilities,
|
|
1891
|
+
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
|
|
1979
1892
|
let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
|
|
1980
1893
|
let ringColorDefault = withAlphaValue(
|
|
1981
1894
|
theme('ringColor.DEFAULT'),
|
|
@@ -1983,16 +1896,15 @@ export let corePlugins = {
|
|
|
1983
1896
|
`rgb(147 197 253 / ${ringOpacityDefault})`
|
|
1984
1897
|
)
|
|
1985
1898
|
|
|
1986
|
-
|
|
1987
|
-
'
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
},
|
|
1899
|
+
addDefaults('ring-width', {
|
|
1900
|
+
'--tw-ring-inset': ' ',
|
|
1901
|
+
'--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'),
|
|
1902
|
+
'--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'),
|
|
1903
|
+
'--tw-ring-color': ringColorDefault,
|
|
1904
|
+
'--tw-ring-offset-shadow': '0 0 #0000',
|
|
1905
|
+
'--tw-ring-shadow': '0 0 #0000',
|
|
1906
|
+
'--tw-shadow': '0 0 #0000',
|
|
1907
|
+
'--tw-shadow-colored': '0 0 #0000',
|
|
1996
1908
|
})
|
|
1997
1909
|
|
|
1998
1910
|
matchUtilities(
|
|
@@ -2069,7 +1981,7 @@ export let corePlugins = {
|
|
|
2069
1981
|
return {
|
|
2070
1982
|
'--tw-blur': `blur(${value})`,
|
|
2071
1983
|
'@defaults filter': {},
|
|
2072
|
-
filter:
|
|
1984
|
+
filter: cssFilterValue,
|
|
2073
1985
|
}
|
|
2074
1986
|
},
|
|
2075
1987
|
},
|
|
@@ -2084,7 +1996,7 @@ export let corePlugins = {
|
|
|
2084
1996
|
return {
|
|
2085
1997
|
'--tw-brightness': `brightness(${value})`,
|
|
2086
1998
|
'@defaults filter': {},
|
|
2087
|
-
filter:
|
|
1999
|
+
filter: cssFilterValue,
|
|
2088
2000
|
}
|
|
2089
2001
|
},
|
|
2090
2002
|
},
|
|
@@ -2099,7 +2011,7 @@ export let corePlugins = {
|
|
|
2099
2011
|
return {
|
|
2100
2012
|
'--tw-contrast': `contrast(${value})`,
|
|
2101
2013
|
'@defaults filter': {},
|
|
2102
|
-
filter:
|
|
2014
|
+
filter: cssFilterValue,
|
|
2103
2015
|
}
|
|
2104
2016
|
},
|
|
2105
2017
|
},
|
|
@@ -2116,7 +2028,7 @@ export let corePlugins = {
|
|
|
2116
2028
|
? value.map((v) => `drop-shadow(${v})`).join(' ')
|
|
2117
2029
|
: `drop-shadow(${value})`,
|
|
2118
2030
|
'@defaults filter': {},
|
|
2119
|
-
filter:
|
|
2031
|
+
filter: cssFilterValue,
|
|
2120
2032
|
}
|
|
2121
2033
|
},
|
|
2122
2034
|
},
|
|
@@ -2131,7 +2043,7 @@ export let corePlugins = {
|
|
|
2131
2043
|
return {
|
|
2132
2044
|
'--tw-grayscale': `grayscale(${value})`,
|
|
2133
2045
|
'@defaults filter': {},
|
|
2134
|
-
filter:
|
|
2046
|
+
filter: cssFilterValue,
|
|
2135
2047
|
}
|
|
2136
2048
|
},
|
|
2137
2049
|
},
|
|
@@ -2146,7 +2058,7 @@ export let corePlugins = {
|
|
|
2146
2058
|
return {
|
|
2147
2059
|
'--tw-hue-rotate': `hue-rotate(${value})`,
|
|
2148
2060
|
'@defaults filter': {},
|
|
2149
|
-
filter:
|
|
2061
|
+
filter: cssFilterValue,
|
|
2150
2062
|
}
|
|
2151
2063
|
},
|
|
2152
2064
|
},
|
|
@@ -2161,7 +2073,7 @@ export let corePlugins = {
|
|
|
2161
2073
|
return {
|
|
2162
2074
|
'--tw-invert': `invert(${value})`,
|
|
2163
2075
|
'@defaults filter': {},
|
|
2164
|
-
filter:
|
|
2076
|
+
filter: cssFilterValue,
|
|
2165
2077
|
}
|
|
2166
2078
|
},
|
|
2167
2079
|
},
|
|
@@ -2176,7 +2088,7 @@ export let corePlugins = {
|
|
|
2176
2088
|
return {
|
|
2177
2089
|
'--tw-saturate': `saturate(${value})`,
|
|
2178
2090
|
'@defaults filter': {},
|
|
2179
|
-
filter:
|
|
2091
|
+
filter: cssFilterValue,
|
|
2180
2092
|
}
|
|
2181
2093
|
},
|
|
2182
2094
|
},
|
|
@@ -2191,7 +2103,7 @@ export let corePlugins = {
|
|
|
2191
2103
|
return {
|
|
2192
2104
|
'--tw-sepia': `sepia(${value})`,
|
|
2193
2105
|
'@defaults filter': {},
|
|
2194
|
-
filter:
|
|
2106
|
+
filter: cssFilterValue,
|
|
2195
2107
|
}
|
|
2196
2108
|
},
|
|
2197
2109
|
},
|
|
@@ -2199,33 +2111,20 @@ export let corePlugins = {
|
|
|
2199
2111
|
)
|
|
2200
2112
|
},
|
|
2201
2113
|
|
|
2202
|
-
filter: ({
|
|
2203
|
-
|
|
2204
|
-
'
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
'var(--tw-brightness)',
|
|
2217
|
-
'var(--tw-contrast)',
|
|
2218
|
-
'var(--tw-grayscale)',
|
|
2219
|
-
'var(--tw-hue-rotate)',
|
|
2220
|
-
'var(--tw-invert)',
|
|
2221
|
-
'var(--tw-saturate)',
|
|
2222
|
-
'var(--tw-sepia)',
|
|
2223
|
-
'var(--tw-drop-shadow)',
|
|
2224
|
-
].join(' '),
|
|
2225
|
-
},
|
|
2226
|
-
})
|
|
2227
|
-
addUtilities({
|
|
2228
|
-
'.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' },
|
|
2114
|
+
filter: ({ addDefaults, addUtilities }) => {
|
|
2115
|
+
addDefaults('filter', {
|
|
2116
|
+
'--tw-blur': ' ',
|
|
2117
|
+
'--tw-brightness': ' ',
|
|
2118
|
+
'--tw-contrast': ' ',
|
|
2119
|
+
'--tw-grayscale': ' ',
|
|
2120
|
+
'--tw-hue-rotate': ' ',
|
|
2121
|
+
'--tw-invert': ' ',
|
|
2122
|
+
'--tw-saturate': ' ',
|
|
2123
|
+
'--tw-sepia': ' ',
|
|
2124
|
+
'--tw-drop-shadow': ' ',
|
|
2125
|
+
})
|
|
2126
|
+
addUtilities({
|
|
2127
|
+
'.filter': { '@defaults filter': {}, filter: cssFilterValue },
|
|
2229
2128
|
'.filter-none': { filter: 'none' },
|
|
2230
2129
|
})
|
|
2231
2130
|
},
|
|
@@ -2237,7 +2136,7 @@ export let corePlugins = {
|
|
|
2237
2136
|
return {
|
|
2238
2137
|
'--tw-backdrop-blur': `blur(${value})`,
|
|
2239
2138
|
'@defaults backdrop-filter': {},
|
|
2240
|
-
'backdrop-filter':
|
|
2139
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2241
2140
|
}
|
|
2242
2141
|
},
|
|
2243
2142
|
},
|
|
@@ -2252,7 +2151,7 @@ export let corePlugins = {
|
|
|
2252
2151
|
return {
|
|
2253
2152
|
'--tw-backdrop-brightness': `brightness(${value})`,
|
|
2254
2153
|
'@defaults backdrop-filter': {},
|
|
2255
|
-
'backdrop-filter':
|
|
2154
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2256
2155
|
}
|
|
2257
2156
|
},
|
|
2258
2157
|
},
|
|
@@ -2267,7 +2166,7 @@ export let corePlugins = {
|
|
|
2267
2166
|
return {
|
|
2268
2167
|
'--tw-backdrop-contrast': `contrast(${value})`,
|
|
2269
2168
|
'@defaults backdrop-filter': {},
|
|
2270
|
-
'backdrop-filter':
|
|
2169
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2271
2170
|
}
|
|
2272
2171
|
},
|
|
2273
2172
|
},
|
|
@@ -2282,7 +2181,7 @@ export let corePlugins = {
|
|
|
2282
2181
|
return {
|
|
2283
2182
|
'--tw-backdrop-grayscale': `grayscale(${value})`,
|
|
2284
2183
|
'@defaults backdrop-filter': {},
|
|
2285
|
-
'backdrop-filter':
|
|
2184
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2286
2185
|
}
|
|
2287
2186
|
},
|
|
2288
2187
|
},
|
|
@@ -2297,7 +2196,7 @@ export let corePlugins = {
|
|
|
2297
2196
|
return {
|
|
2298
2197
|
'--tw-backdrop-hue-rotate': `hue-rotate(${value})`,
|
|
2299
2198
|
'@defaults backdrop-filter': {},
|
|
2300
|
-
'backdrop-filter':
|
|
2199
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2301
2200
|
}
|
|
2302
2201
|
},
|
|
2303
2202
|
},
|
|
@@ -2312,7 +2211,7 @@ export let corePlugins = {
|
|
|
2312
2211
|
return {
|
|
2313
2212
|
'--tw-backdrop-invert': `invert(${value})`,
|
|
2314
2213
|
'@defaults backdrop-filter': {},
|
|
2315
|
-
'backdrop-filter':
|
|
2214
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2316
2215
|
}
|
|
2317
2216
|
},
|
|
2318
2217
|
},
|
|
@@ -2327,7 +2226,7 @@ export let corePlugins = {
|
|
|
2327
2226
|
return {
|
|
2328
2227
|
'--tw-backdrop-opacity': `opacity(${value})`,
|
|
2329
2228
|
'@defaults backdrop-filter': {},
|
|
2330
|
-
'backdrop-filter':
|
|
2229
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2331
2230
|
}
|
|
2332
2231
|
},
|
|
2333
2232
|
},
|
|
@@ -2342,7 +2241,7 @@ export let corePlugins = {
|
|
|
2342
2241
|
return {
|
|
2343
2242
|
'--tw-backdrop-saturate': `saturate(${value})`,
|
|
2344
2243
|
'@defaults backdrop-filter': {},
|
|
2345
|
-
'backdrop-filter':
|
|
2244
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2346
2245
|
}
|
|
2347
2246
|
},
|
|
2348
2247
|
},
|
|
@@ -2357,7 +2256,7 @@ export let corePlugins = {
|
|
|
2357
2256
|
return {
|
|
2358
2257
|
'--tw-backdrop-sepia': `sepia(${value})`,
|
|
2359
2258
|
'@defaults backdrop-filter': {},
|
|
2360
|
-
'backdrop-filter':
|
|
2259
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2361
2260
|
}
|
|
2362
2261
|
},
|
|
2363
2262
|
},
|
|
@@ -2365,35 +2264,22 @@ export let corePlugins = {
|
|
|
2365
2264
|
)
|
|
2366
2265
|
},
|
|
2367
2266
|
|
|
2368
|
-
backdropFilter: ({
|
|
2369
|
-
|
|
2370
|
-
'
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
'--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)',
|
|
2380
|
-
'--tw-backdrop-filter': [
|
|
2381
|
-
'var(--tw-backdrop-blur)',
|
|
2382
|
-
'var(--tw-backdrop-brightness)',
|
|
2383
|
-
'var(--tw-backdrop-contrast)',
|
|
2384
|
-
'var(--tw-backdrop-grayscale)',
|
|
2385
|
-
'var(--tw-backdrop-hue-rotate)',
|
|
2386
|
-
'var(--tw-backdrop-invert)',
|
|
2387
|
-
'var(--tw-backdrop-opacity)',
|
|
2388
|
-
'var(--tw-backdrop-saturate)',
|
|
2389
|
-
'var(--tw-backdrop-sepia)',
|
|
2390
|
-
].join(' '),
|
|
2391
|
-
},
|
|
2267
|
+
backdropFilter: ({ addDefaults, addUtilities }) => {
|
|
2268
|
+
addDefaults('backdrop-filter', {
|
|
2269
|
+
'--tw-backdrop-blur': ' ',
|
|
2270
|
+
'--tw-backdrop-brightness': ' ',
|
|
2271
|
+
'--tw-backdrop-contrast': ' ',
|
|
2272
|
+
'--tw-backdrop-grayscale': ' ',
|
|
2273
|
+
'--tw-backdrop-hue-rotate': ' ',
|
|
2274
|
+
'--tw-backdrop-invert': ' ',
|
|
2275
|
+
'--tw-backdrop-opacity': ' ',
|
|
2276
|
+
'--tw-backdrop-saturate': ' ',
|
|
2277
|
+
'--tw-backdrop-sepia': ' ',
|
|
2392
2278
|
})
|
|
2393
2279
|
addUtilities({
|
|
2394
2280
|
'.backdrop-filter': {
|
|
2395
2281
|
'@defaults backdrop-filter': {},
|
|
2396
|
-
'backdrop-filter':
|
|
2282
|
+
'backdrop-filter': cssBackdropFilterValue,
|
|
2397
2283
|
},
|
|
2398
2284
|
'.backdrop-filter-none': { 'backdrop-filter': 'none' },
|
|
2399
2285
|
})
|
|
@@ -2433,5 +2319,7 @@ export let corePlugins = {
|
|
|
2433
2319
|
{ filterDefault: true }
|
|
2434
2320
|
),
|
|
2435
2321
|
willChange: createUtilityPlugin('willChange', [['will-change', ['will-change']]]),
|
|
2436
|
-
content: createUtilityPlugin('content'
|
|
2322
|
+
content: createUtilityPlugin('content', [
|
|
2323
|
+
['content', ['--tw-content', ['content', 'var(--tw-content)']]],
|
|
2324
|
+
]),
|
|
2437
2325
|
}
|