tailwindcss 0.0.0-insiders.fb85c8f → 0.0.0-insiders.fbb86a2
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/lib/corePlugins.js +3 -3
- package/lib/lib/generateRules.js +8 -0
- package/lib/lib/load-config.js +1 -1
- package/lib/lib/setupContextUtils.js +4 -4
- package/lib/util/dataTypes.js +11 -1
- package/package.json +7 -7
- package/src/corePlugins.js +3 -3
- package/src/lib/generateRules.js +10 -0
- package/src/lib/load-config.ts +2 -2
- package/src/lib/setupContextUtils.js +3 -3
- package/src/util/dataTypes.js +12 -0
package/lib/corePlugins.js
CHANGED
|
@@ -268,8 +268,8 @@ let variantPlugins = {
|
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
directionVariants: ({ addVariant })=>{
|
|
271
|
-
addVariant('ltr', ':is([dir="ltr"] &)');
|
|
272
|
-
addVariant('rtl', ':is([dir="rtl"] &)');
|
|
271
|
+
addVariant('ltr', ':is(:where([dir="ltr"]) &)');
|
|
272
|
+
addVariant('rtl', ':is(:where([dir="rtl"]) &)');
|
|
273
273
|
},
|
|
274
274
|
reducedMotionVariants: ({ addVariant })=>{
|
|
275
275
|
addVariant('motion-safe', '@media (prefers-reduced-motion: no-preference)');
|
|
@@ -286,7 +286,7 @@ let variantPlugins = {
|
|
|
286
286
|
]);
|
|
287
287
|
}
|
|
288
288
|
if (mode === 'class') {
|
|
289
|
-
addVariant('dark', `:is(${className} &)`);
|
|
289
|
+
addVariant('dark', `:is(:where(${className}) &)`);
|
|
290
290
|
} else if (mode === 'media') {
|
|
291
291
|
addVariant('dark', '@media (prefers-color-scheme: dark)');
|
|
292
292
|
}
|
package/lib/lib/generateRules.js
CHANGED
|
@@ -163,6 +163,9 @@ function applyImportant(matches, classCandidate) {
|
|
|
163
163
|
return matches;
|
|
164
164
|
}
|
|
165
165
|
let result = [];
|
|
166
|
+
function isInKeyframes(rule) {
|
|
167
|
+
return rule.parent && rule.parent.type === 'atrule' && rule.parent.name === 'keyframes';
|
|
168
|
+
}
|
|
166
169
|
for (let [meta, rule] of matches){
|
|
167
170
|
let container = _postcss.default.root({
|
|
168
171
|
nodes: [
|
|
@@ -170,6 +173,11 @@ function applyImportant(matches, classCandidate) {
|
|
|
170
173
|
]
|
|
171
174
|
});
|
|
172
175
|
container.walkRules((r)=>{
|
|
176
|
+
// Declarations inside keyframes cannot be marked as important
|
|
177
|
+
// They will be ignored by the browser
|
|
178
|
+
if (isInKeyframes(r)) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
173
181
|
let ast = (0, _postcssselectorparser.default)().astSync(r.selector);
|
|
174
182
|
// Remove extraneous selectors that do not include the base candidate
|
|
175
183
|
ast.each((sel)=>(0, _formatVariantSelector.eliminateIrrelevantSelectors)(sel, classCandidate));
|
package/lib/lib/load-config.js
CHANGED
|
@@ -751,14 +751,14 @@ function resolvePlugins(context, root) {
|
|
|
751
751
|
];
|
|
752
752
|
let afterVariants = [
|
|
753
753
|
_corePlugins.variantPlugins['supportsVariants'],
|
|
754
|
-
_corePlugins.variantPlugins['directionVariants'],
|
|
755
754
|
_corePlugins.variantPlugins['reducedMotionVariants'],
|
|
756
755
|
_corePlugins.variantPlugins['prefersContrastVariants'],
|
|
757
|
-
_corePlugins.variantPlugins['darkVariants'],
|
|
758
|
-
_corePlugins.variantPlugins['forcedColorsVariants'],
|
|
759
756
|
_corePlugins.variantPlugins['printVariant'],
|
|
760
757
|
_corePlugins.variantPlugins['screenVariants'],
|
|
761
|
-
_corePlugins.variantPlugins['orientationVariants']
|
|
758
|
+
_corePlugins.variantPlugins['orientationVariants'],
|
|
759
|
+
_corePlugins.variantPlugins['directionVariants'],
|
|
760
|
+
_corePlugins.variantPlugins['darkVariants'],
|
|
761
|
+
_corePlugins.variantPlugins['forcedColorsVariants']
|
|
762
762
|
];
|
|
763
763
|
return [
|
|
764
764
|
...corePluginList,
|
package/lib/util/dataTypes.js
CHANGED
|
@@ -141,7 +141,13 @@ function normalize(value, context = null, isRoot = true) {
|
|
|
141
141
|
'keyboard-inset-bottom',
|
|
142
142
|
'keyboard-inset-left',
|
|
143
143
|
'keyboard-inset-width',
|
|
144
|
-
'keyboard-inset-height'
|
|
144
|
+
'keyboard-inset-height',
|
|
145
|
+
'radial-gradient',
|
|
146
|
+
'linear-gradient',
|
|
147
|
+
'conic-gradient',
|
|
148
|
+
'repeating-radial-gradient',
|
|
149
|
+
'repeating-linear-gradient',
|
|
150
|
+
'repeating-conic-gradient'
|
|
145
151
|
];
|
|
146
152
|
return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
|
|
147
153
|
let result = '';
|
|
@@ -187,6 +193,10 @@ function normalize(value, context = null, isRoot = true) {
|
|
|
187
193
|
result += consumeUntil([
|
|
188
194
|
')'
|
|
189
195
|
]);
|
|
196
|
+
} else if (peek('[')) {
|
|
197
|
+
result += consumeUntil([
|
|
198
|
+
']'
|
|
199
|
+
]);
|
|
190
200
|
} else if ([
|
|
191
201
|
'+',
|
|
192
202
|
'-',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss",
|
|
3
|
-
"version": "0.0.0-insiders.
|
|
3
|
+
"version": "0.0.0-insiders.fbb86a2",
|
|
4
4
|
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@swc/cli": "^0.1.63",
|
|
47
|
-
"@swc/core": "^1.3.
|
|
47
|
+
"@swc/core": "^1.3.101",
|
|
48
48
|
"@swc/jest": "^0.2.29",
|
|
49
49
|
"@swc/register": "^0.1.10",
|
|
50
50
|
"concurrently": "^8.0.1",
|
|
51
|
-
"eslint": "^8.
|
|
51
|
+
"eslint": "^8.56.0",
|
|
52
52
|
"eslint-config-prettier": "^9.1.0",
|
|
53
53
|
"eslint-plugin-prettier": "^4.2.1",
|
|
54
54
|
"jest": "^29.7.0",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"prettier": "^2.8.8",
|
|
57
57
|
"rimraf": "^5.0.0",
|
|
58
58
|
"source-map-js": "^1.0.2",
|
|
59
|
-
"turbo": "^1.
|
|
59
|
+
"turbo": "^1.11.2"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@alloc/quick-lru": "^5.2.0",
|
|
63
|
-
"@tailwindcss/oxide": "0.0.0-insiders.
|
|
63
|
+
"@tailwindcss/oxide": "0.0.0-insiders.fbb86a2",
|
|
64
64
|
"arg": "^5.0.2",
|
|
65
65
|
"browserslist": "^4.22.2",
|
|
66
66
|
"chokidar": "^3.5.3",
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"postcss-js": "^4.0.1",
|
|
82
82
|
"postcss-load-config": "^4.0.2",
|
|
83
83
|
"postcss-nested": "^6.0.1",
|
|
84
|
-
"postcss-selector-parser": "^6.0.
|
|
84
|
+
"postcss-selector-parser": "^6.0.15",
|
|
85
85
|
"postcss-value-parser": "^4.2.0",
|
|
86
86
|
"resolve": "^1.22.8",
|
|
87
|
-
"sucrase": "^3.
|
|
87
|
+
"sucrase": "^3.35.0"
|
|
88
88
|
},
|
|
89
89
|
"browserslist": [
|
|
90
90
|
"defaults and supports css-variables and supports css-matches-pseudo",
|
package/src/corePlugins.js
CHANGED
|
@@ -206,8 +206,8 @@ export let variantPlugins = {
|
|
|
206
206
|
},
|
|
207
207
|
|
|
208
208
|
directionVariants: ({ addVariant }) => {
|
|
209
|
-
addVariant('ltr', ':is([dir="ltr"] &)')
|
|
210
|
-
addVariant('rtl', ':is([dir="rtl"] &)')
|
|
209
|
+
addVariant('ltr', ':is(:where([dir="ltr"]) &)')
|
|
210
|
+
addVariant('rtl', ':is(:where([dir="rtl"]) &)')
|
|
211
211
|
},
|
|
212
212
|
|
|
213
213
|
reducedMotionVariants: ({ addVariant }) => {
|
|
@@ -228,7 +228,7 @@ export let variantPlugins = {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
if (mode === 'class') {
|
|
231
|
-
addVariant('dark', `:is(${className} &)`)
|
|
231
|
+
addVariant('dark', `:is(:where(${className}) &)`)
|
|
232
232
|
} else if (mode === 'media') {
|
|
233
233
|
addVariant('dark', '@media (prefers-color-scheme: dark)')
|
|
234
234
|
}
|
package/src/lib/generateRules.js
CHANGED
|
@@ -118,10 +118,20 @@ function applyImportant(matches, classCandidate) {
|
|
|
118
118
|
|
|
119
119
|
let result = []
|
|
120
120
|
|
|
121
|
+
function isInKeyframes(rule) {
|
|
122
|
+
return rule.parent && rule.parent.type === 'atrule' && rule.parent.name === 'keyframes'
|
|
123
|
+
}
|
|
124
|
+
|
|
121
125
|
for (let [meta, rule] of matches) {
|
|
122
126
|
let container = postcss.root({ nodes: [rule.clone()] })
|
|
123
127
|
|
|
124
128
|
container.walkRules((r) => {
|
|
129
|
+
// Declarations inside keyframes cannot be marked as important
|
|
130
|
+
// They will be ignored by the browser
|
|
131
|
+
if (isInKeyframes(r)) {
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
let ast = selectorParser().astSync(r.selector)
|
|
126
136
|
|
|
127
137
|
// Remove extraneous selectors that do not include the base candidate
|
package/src/lib/load-config.ts
CHANGED
|
@@ -8,8 +8,8 @@ let jiti: ReturnType<typeof jitiFactory> | null = null
|
|
|
8
8
|
// @internal
|
|
9
9
|
// This WILL be removed in some future release
|
|
10
10
|
// If you rely on this your stuff WILL break
|
|
11
|
-
export function useCustomJiti(_jiti: ReturnType<typeof jitiFactory>) {
|
|
12
|
-
jiti = _jiti
|
|
11
|
+
export function useCustomJiti(_jiti: () => ReturnType<typeof jitiFactory>) {
|
|
12
|
+
jiti = _jiti()
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function lazyJiti() {
|
|
@@ -755,14 +755,14 @@ function resolvePlugins(context, root) {
|
|
|
755
755
|
]
|
|
756
756
|
let afterVariants = [
|
|
757
757
|
variantPlugins['supportsVariants'],
|
|
758
|
-
variantPlugins['directionVariants'],
|
|
759
758
|
variantPlugins['reducedMotionVariants'],
|
|
760
759
|
variantPlugins['prefersContrastVariants'],
|
|
761
|
-
variantPlugins['darkVariants'],
|
|
762
|
-
variantPlugins['forcedColorsVariants'],
|
|
763
760
|
variantPlugins['printVariant'],
|
|
764
761
|
variantPlugins['screenVariants'],
|
|
765
762
|
variantPlugins['orientationVariants'],
|
|
763
|
+
variantPlugins['directionVariants'],
|
|
764
|
+
variantPlugins['darkVariants'],
|
|
765
|
+
variantPlugins['forcedColorsVariants'],
|
|
766
766
|
]
|
|
767
767
|
|
|
768
768
|
return [...corePluginList, ...beforeVariants, ...userPlugins, ...afterVariants, ...layerPlugins]
|
package/src/util/dataTypes.js
CHANGED
|
@@ -107,6 +107,13 @@ function normalizeMathOperatorSpacing(value) {
|
|
|
107
107
|
'keyboard-inset-left',
|
|
108
108
|
'keyboard-inset-width',
|
|
109
109
|
'keyboard-inset-height',
|
|
110
|
+
|
|
111
|
+
'radial-gradient',
|
|
112
|
+
'linear-gradient',
|
|
113
|
+
'conic-gradient',
|
|
114
|
+
'repeating-radial-gradient',
|
|
115
|
+
'repeating-linear-gradient',
|
|
116
|
+
'repeating-conic-gradient',
|
|
110
117
|
]
|
|
111
118
|
|
|
112
119
|
return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match) => {
|
|
@@ -162,6 +169,11 @@ function normalizeMathOperatorSpacing(value) {
|
|
|
162
169
|
result += consumeUntil([')'])
|
|
163
170
|
}
|
|
164
171
|
|
|
172
|
+
// Don't break CSS grid track names
|
|
173
|
+
else if (peek('[')) {
|
|
174
|
+
result += consumeUntil([']'])
|
|
175
|
+
}
|
|
176
|
+
|
|
165
177
|
// Handle operators
|
|
166
178
|
else if (
|
|
167
179
|
['+', '-', '*', '/'].includes(char) &&
|