tailwindcss 3.0.24 → 3.1.0
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 +57 -3
- package/colors.d.ts +3 -0
- package/defaultConfig.d.ts +3 -0
- package/defaultTheme.d.ts +3 -0
- package/lib/cli-peer-dependencies.js +8 -3
- package/lib/cli.js +118 -77
- package/lib/corePluginList.js +1 -0
- package/lib/corePlugins.js +146 -117
- package/lib/css/preflight.css +1 -8
- package/lib/featureFlags.js +8 -6
- package/lib/index.js +10 -13
- package/lib/lib/cacheInvalidation.js +32 -14
- package/lib/lib/collapseAdjacentRules.js +5 -3
- package/lib/lib/defaultExtractor.js +191 -32
- package/lib/lib/evaluateTailwindFunctions.js +22 -13
- package/lib/lib/expandApplyAtRules.js +232 -195
- package/lib/lib/expandTailwindAtRules.js +40 -26
- package/lib/lib/generateRules.js +106 -42
- package/lib/lib/regex.js +52 -0
- package/lib/lib/resolveDefaultsAtRules.js +6 -9
- package/lib/lib/setupContextUtils.js +131 -79
- package/lib/lib/setupTrackingContext.js +7 -9
- package/lib/lib/sharedState.js +1 -2
- package/lib/lib/substituteScreenAtRules.js +1 -2
- package/lib/postcss-plugins/nesting/plugin.js +1 -2
- package/lib/util/buildMediaQuery.js +1 -2
- package/lib/util/cloneDeep.js +2 -4
- package/lib/util/color.js +26 -36
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +1 -2
- package/lib/util/dataTypes.js +14 -12
- package/lib/util/flattenColorPalette.js +2 -5
- package/lib/util/formatVariantSelector.js +64 -57
- package/lib/util/getAllConfigs.js +10 -5
- package/lib/util/isValidArbitraryValue.js +1 -2
- package/lib/util/log.js +2 -3
- package/lib/util/negateValue.js +1 -2
- package/lib/util/normalizeConfig.js +33 -23
- package/lib/util/normalizeScreens.js +1 -2
- package/lib/util/parseAnimationValue.js +1 -2
- package/lib/util/parseBoxShadowValue.js +2 -43
- package/lib/util/pluginUtils.js +11 -3
- package/lib/util/resolveConfig.js +57 -34
- package/lib/util/splitAtTopLevelOnly.js +90 -0
- package/lib/util/transformThemeValue.js +4 -2
- package/lib/util/validateConfig.js +21 -0
- package/lib/util/withAlphaVariable.js +5 -5
- package/package.json +21 -16
- package/peers/index.js +3264 -1330
- package/plugin.d.ts +11 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +97 -33
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +57 -40
- package/src/css/preflight.css +1 -8
- package/src/featureFlags.js +2 -2
- package/src/index.js +0 -2
- package/src/lib/collapseAdjacentRules.js +5 -1
- package/src/lib/defaultExtractor.js +177 -35
- package/src/lib/evaluateTailwindFunctions.js +20 -4
- package/src/lib/expandApplyAtRules.js +247 -188
- package/src/lib/expandTailwindAtRules.js +4 -4
- package/src/lib/generateRules.js +69 -5
- package/src/lib/regex.js +74 -0
- package/src/lib/resolveDefaultsAtRules.js +1 -1
- package/src/lib/setupContextUtils.js +103 -39
- package/src/lib/setupTrackingContext.js +4 -0
- package/src/util/color.js +20 -18
- package/src/util/dataTypes.js +11 -5
- package/src/util/formatVariantSelector.js +79 -62
- package/src/util/getAllConfigs.js +7 -0
- package/src/util/log.js +1 -1
- package/src/util/normalizeConfig.js +0 -8
- package/src/util/parseBoxShadowValue.js +3 -50
- package/src/util/pluginUtils.js +13 -1
- package/src/util/resolveConfig.js +66 -54
- package/src/util/splitAtTopLevelOnly.js +71 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +4 -2
- package/src/util/validateConfig.js +13 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +2 -3
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +325 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +276 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/index.d.ts +1 -0
package/lib/corePlugins.js
CHANGED
|
@@ -19,31 +19,50 @@ var _packageJson = require("../package.json");
|
|
|
19
19
|
var _log = _interopRequireDefault(require("./util/log"));
|
|
20
20
|
var _normalizeScreens = require("./util/normalizeScreens");
|
|
21
21
|
var _parseBoxShadowValue = require("./util/parseBoxShadowValue");
|
|
22
|
+
var _featureFlags = require("./featureFlags");
|
|
22
23
|
function _interopRequireDefault(obj) {
|
|
23
24
|
return obj && obj.__esModule ? obj : {
|
|
24
25
|
default: obj
|
|
25
26
|
};
|
|
26
27
|
}
|
|
28
|
+
function _getRequireWildcardCache() {
|
|
29
|
+
if (typeof WeakMap !== "function") return null;
|
|
30
|
+
var cache = new WeakMap();
|
|
31
|
+
_getRequireWildcardCache = function() {
|
|
32
|
+
return cache;
|
|
33
|
+
};
|
|
34
|
+
return cache;
|
|
35
|
+
}
|
|
27
36
|
function _interopRequireWildcard(obj) {
|
|
28
37
|
if (obj && obj.__esModule) {
|
|
29
38
|
return obj;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
}
|
|
40
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
+
return {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var cache = _getRequireWildcardCache();
|
|
46
|
+
if (cache && cache.has(obj)) {
|
|
47
|
+
return cache.get(obj);
|
|
48
|
+
}
|
|
49
|
+
var newObj = {};
|
|
50
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
|
+
for(var key in obj){
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
53
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
|
56
|
+
} else {
|
|
57
|
+
newObj[key] = obj[key];
|
|
42
58
|
}
|
|
43
59
|
}
|
|
44
|
-
newObj.default = obj;
|
|
45
|
-
return newObj;
|
|
46
60
|
}
|
|
61
|
+
newObj.default = obj;
|
|
62
|
+
if (cache) {
|
|
63
|
+
cache.set(obj, newObj);
|
|
64
|
+
}
|
|
65
|
+
return newObj;
|
|
47
66
|
}
|
|
48
67
|
let variantPlugins = {
|
|
49
68
|
pseudoElementVariants: ({ addVariant })=>{
|
|
@@ -59,9 +78,8 @@ let variantPlugins = {
|
|
|
59
78
|
]);
|
|
60
79
|
addVariant("file", "&::file-selector-button");
|
|
61
80
|
addVariant("placeholder", "&::placeholder");
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*/ addVariant("before", ({ container })=>{
|
|
81
|
+
addVariant("backdrop", "&::backdrop");
|
|
82
|
+
addVariant("before", ({ container })=>{
|
|
65
83
|
container.walkRules((rule)=>{
|
|
66
84
|
let foundContent = false;
|
|
67
85
|
rule.walkDecls("content", ()=>{
|
|
@@ -92,28 +110,28 @@ let variantPlugins = {
|
|
|
92
110
|
return "&::after";
|
|
93
111
|
});
|
|
94
112
|
},
|
|
95
|
-
pseudoClassVariants: ({ addVariant })=>{
|
|
113
|
+
pseudoClassVariants: ({ addVariant , config })=>{
|
|
96
114
|
let pseudoVariants = [
|
|
97
115
|
// Positional
|
|
98
116
|
[
|
|
99
117
|
"first",
|
|
100
|
-
"
|
|
118
|
+
"&:first-child"
|
|
101
119
|
],
|
|
102
120
|
[
|
|
103
121
|
"last",
|
|
104
|
-
"
|
|
122
|
+
"&:last-child"
|
|
105
123
|
],
|
|
106
124
|
[
|
|
107
125
|
"only",
|
|
108
|
-
"
|
|
126
|
+
"&:only-child"
|
|
109
127
|
],
|
|
110
128
|
[
|
|
111
129
|
"odd",
|
|
112
|
-
"
|
|
130
|
+
"&:nth-child(odd)"
|
|
113
131
|
],
|
|
114
132
|
[
|
|
115
133
|
"even",
|
|
116
|
-
"
|
|
134
|
+
"&:nth-child(even)"
|
|
117
135
|
],
|
|
118
136
|
"first-of-type",
|
|
119
137
|
"last-of-type",
|
|
@@ -138,13 +156,13 @@ let variantPlugins = {
|
|
|
138
156
|
}
|
|
139
157
|
}
|
|
140
158
|
});
|
|
141
|
-
return "
|
|
159
|
+
return "&:visited";
|
|
142
160
|
},
|
|
143
161
|
],
|
|
144
162
|
"target",
|
|
145
163
|
[
|
|
146
164
|
"open",
|
|
147
|
-
"[open]"
|
|
165
|
+
"&[open]"
|
|
148
166
|
],
|
|
149
167
|
// Forms
|
|
150
168
|
"default",
|
|
@@ -152,6 +170,7 @@ let variantPlugins = {
|
|
|
152
170
|
"indeterminate",
|
|
153
171
|
"placeholder-shown",
|
|
154
172
|
"autofill",
|
|
173
|
+
"optional",
|
|
155
174
|
"required",
|
|
156
175
|
"valid",
|
|
157
176
|
"invalid",
|
|
@@ -162,34 +181,35 @@ let variantPlugins = {
|
|
|
162
181
|
"empty",
|
|
163
182
|
// Interactive
|
|
164
183
|
"focus-within",
|
|
165
|
-
|
|
184
|
+
[
|
|
185
|
+
"hover",
|
|
186
|
+
!(0, _featureFlags).flagEnabled(config(), "hoverOnlyWhenSupported") ? "&:hover" : "@media (hover: hover) and (pointer: fine) { &:hover }",
|
|
187
|
+
],
|
|
166
188
|
"focus",
|
|
167
189
|
"focus-visible",
|
|
168
190
|
"active",
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
*/ "disabled",
|
|
191
|
+
"enabled",
|
|
192
|
+
"disabled",
|
|
172
193
|
].map((variant)=>Array.isArray(variant) ? variant : [
|
|
173
194
|
variant,
|
|
174
|
-
|
|
175
|
-
]
|
|
176
|
-
);
|
|
195
|
+
`&:${variant}`
|
|
196
|
+
]);
|
|
177
197
|
for (let [variantName, state] of pseudoVariants){
|
|
178
198
|
addVariant(variantName, (ctx)=>{
|
|
179
199
|
let result = typeof state === "function" ? state(ctx) : state;
|
|
180
|
-
return
|
|
200
|
+
return result;
|
|
181
201
|
});
|
|
182
202
|
}
|
|
183
203
|
for (let [variantName1, state1] of pseudoVariants){
|
|
184
204
|
addVariant(`group-${variantName1}`, (ctx)=>{
|
|
185
205
|
let result = typeof state1 === "function" ? state1(ctx) : state1;
|
|
186
|
-
return
|
|
206
|
+
return result.replace(/&(\S+)/, ":merge(.group)$1 &");
|
|
187
207
|
});
|
|
188
208
|
}
|
|
189
209
|
for (let [variantName2, state2] of pseudoVariants){
|
|
190
210
|
addVariant(`peer-${variantName2}`, (ctx)=>{
|
|
191
211
|
let result = typeof state2 === "function" ? state2(ctx) : state2;
|
|
192
|
-
return
|
|
212
|
+
return result.replace(/&(\S+)/, ":merge(.peer)$1 ~ &");
|
|
193
213
|
});
|
|
194
214
|
}
|
|
195
215
|
},
|
|
@@ -214,7 +234,7 @@ let variantPlugins = {
|
|
|
214
234
|
addVariant("motion-reduce", "@media (prefers-reduced-motion: reduce)");
|
|
215
235
|
},
|
|
216
236
|
darkVariants: ({ config , addVariant })=>{
|
|
217
|
-
let [mode] = [].concat(config("darkMode", "media"));
|
|
237
|
+
let [mode, className = ".dark"] = [].concat(config("darkMode", "media"));
|
|
218
238
|
if (mode === false) {
|
|
219
239
|
mode = "media";
|
|
220
240
|
_log.default.warn("darkmode-false", [
|
|
@@ -224,10 +244,8 @@ let variantPlugins = {
|
|
|
224
244
|
]);
|
|
225
245
|
}
|
|
226
246
|
if (mode === "class") {
|
|
227
|
-
addVariant("dark",
|
|
228
|
-
|
|
229
|
-
addVariant('dark', `${className} &`)
|
|
230
|
-
*/ } else if (mode === "media") {
|
|
247
|
+
addVariant("dark", `${className} &`);
|
|
248
|
+
} else if (mode === "media") {
|
|
231
249
|
addVariant("dark", "@media (prefers-color-scheme: dark)");
|
|
232
250
|
}
|
|
233
251
|
},
|
|
@@ -243,6 +261,10 @@ let variantPlugins = {
|
|
|
243
261
|
orientationVariants: ({ addVariant })=>{
|
|
244
262
|
addVariant("portrait", "@media (orientation: portrait)");
|
|
245
263
|
addVariant("landscape", "@media (orientation: landscape)");
|
|
264
|
+
},
|
|
265
|
+
prefersContrastVariants: ({ addVariant })=>{
|
|
266
|
+
addVariant("contrast-more", "@media (prefers-contrast: more)");
|
|
267
|
+
addVariant("contrast-less", "@media (prefers-contrast: less)");
|
|
246
268
|
}
|
|
247
269
|
};
|
|
248
270
|
exports.variantPlugins = variantPlugins;
|
|
@@ -288,10 +310,7 @@ let corePlugins = {
|
|
|
288
310
|
},
|
|
289
311
|
container: (()=>{
|
|
290
312
|
function extractMinWidths(breakpoints = []) {
|
|
291
|
-
return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min
|
|
292
|
-
)
|
|
293
|
-
).filter((v)=>v !== undefined
|
|
294
|
-
);
|
|
313
|
+
return breakpoints.flatMap((breakpoint1)=>breakpoint1.values.map((breakpoint)=>breakpoint.min)).filter((v)=>v !== undefined);
|
|
295
314
|
}
|
|
296
315
|
function mapMinWidthsToPadding(minWidths, screens, paddings) {
|
|
297
316
|
if (typeof paddings === "undefined") {
|
|
@@ -333,8 +352,7 @@ let corePlugins = {
|
|
|
333
352
|
let minWidths = extractMinWidths(screens);
|
|
334
353
|
let paddings = mapMinWidthsToPadding(minWidths, screens, theme("container.padding"));
|
|
335
354
|
let generatePaddingFor = (minWidth)=>{
|
|
336
|
-
let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth
|
|
337
|
-
);
|
|
355
|
+
let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth);
|
|
338
356
|
if (!paddingConfig) {
|
|
339
357
|
return {};
|
|
340
358
|
}
|
|
@@ -343,16 +361,14 @@ let corePlugins = {
|
|
|
343
361
|
paddingLeft: paddingConfig.padding
|
|
344
362
|
};
|
|
345
363
|
};
|
|
346
|
-
let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)
|
|
347
|
-
))).map((minWidth)=>({
|
|
364
|
+
let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)))).map((minWidth)=>({
|
|
348
365
|
[`@media (min-width: ${minWidth})`]: {
|
|
349
366
|
".container": {
|
|
350
367
|
"max-width": minWidth,
|
|
351
368
|
...generatePaddingFor(minWidth)
|
|
352
369
|
}
|
|
353
370
|
}
|
|
354
|
-
})
|
|
355
|
-
);
|
|
371
|
+
}));
|
|
356
372
|
addComponents([
|
|
357
373
|
{
|
|
358
374
|
".container": Object.assign({
|
|
@@ -827,42 +843,39 @@ let corePlugins = {
|
|
|
827
843
|
}
|
|
828
844
|
});
|
|
829
845
|
},
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
)
|
|
864
|
-
},
|
|
865
|
-
*/ transformOrigin: (0, _createUtilityPlugin).default("transformOrigin", [
|
|
846
|
+
borderSpacing: ({ addDefaults , matchUtilities , theme })=>{
|
|
847
|
+
addDefaults("border-spacing", {
|
|
848
|
+
"--tw-border-spacing-x": 0,
|
|
849
|
+
"--tw-border-spacing-y": 0
|
|
850
|
+
});
|
|
851
|
+
matchUtilities({
|
|
852
|
+
"border-spacing": (value)=>{
|
|
853
|
+
return {
|
|
854
|
+
"--tw-border-spacing-x": value,
|
|
855
|
+
"--tw-border-spacing-y": value,
|
|
856
|
+
"@defaults border-spacing": {},
|
|
857
|
+
"border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)"
|
|
858
|
+
};
|
|
859
|
+
},
|
|
860
|
+
"border-spacing-x": (value)=>{
|
|
861
|
+
return {
|
|
862
|
+
"--tw-border-spacing-x": value,
|
|
863
|
+
"@defaults border-spacing": {},
|
|
864
|
+
"border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)"
|
|
865
|
+
};
|
|
866
|
+
},
|
|
867
|
+
"border-spacing-y": (value)=>{
|
|
868
|
+
return {
|
|
869
|
+
"--tw-border-spacing-y": value,
|
|
870
|
+
"@defaults border-spacing": {},
|
|
871
|
+
"border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)"
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
}, {
|
|
875
|
+
values: theme("borderSpacing")
|
|
876
|
+
});
|
|
877
|
+
},
|
|
878
|
+
transformOrigin: (0, _createUtilityPlugin).default("transformOrigin", [
|
|
866
879
|
[
|
|
867
880
|
"origin",
|
|
868
881
|
[
|
|
@@ -1032,8 +1045,7 @@ let corePlugins = {
|
|
|
1032
1045
|
});
|
|
1033
1046
|
},
|
|
1034
1047
|
animation: ({ matchUtilities , theme , config })=>{
|
|
1035
|
-
let prefixName = (name)=>`${config("prefix")}${(0, _escapeClassName).default(name)}
|
|
1036
|
-
;
|
|
1048
|
+
let prefixName = (name)=>`${config("prefix")}${(0, _escapeClassName).default(name)}`;
|
|
1037
1049
|
var ref;
|
|
1038
1050
|
let keyframes = Object.fromEntries(Object.entries((ref = theme("keyframes")) !== null && ref !== void 0 ? ref : {}).map(([key, value])=>{
|
|
1039
1051
|
return [
|
|
@@ -1047,8 +1059,7 @@ let corePlugins = {
|
|
|
1047
1059
|
animate: (value1)=>{
|
|
1048
1060
|
let animations = (0, _parseAnimationValue).default(value1);
|
|
1049
1061
|
return [
|
|
1050
|
-
...animations.flatMap((animation)=>keyframes[animation.name]
|
|
1051
|
-
),
|
|
1062
|
+
...animations.flatMap((animation)=>keyframes[animation.name]),
|
|
1052
1063
|
{
|
|
1053
1064
|
animation: animations.map(({ name , value })=>{
|
|
1054
1065
|
if (name === undefined || keyframes[name] === undefined) {
|
|
@@ -1427,6 +1438,9 @@ let corePlugins = {
|
|
|
1427
1438
|
".grid-flow-col": {
|
|
1428
1439
|
gridAutoFlow: "column"
|
|
1429
1440
|
},
|
|
1441
|
+
".grid-flow-dense": {
|
|
1442
|
+
gridAutoFlow: "dense"
|
|
1443
|
+
},
|
|
1430
1444
|
".grid-flow-row-dense": {
|
|
1431
1445
|
gridAutoFlow: "row dense"
|
|
1432
1446
|
},
|
|
@@ -1745,8 +1759,7 @@ let corePlugins = {
|
|
|
1745
1759
|
};
|
|
1746
1760
|
}
|
|
1747
1761
|
}, {
|
|
1748
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
1749
|
-
)((0, _flattenColorPalette).default(theme("divideColor"))),
|
|
1762
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("divideColor"))),
|
|
1750
1763
|
type: "color"
|
|
1751
1764
|
});
|
|
1752
1765
|
},
|
|
@@ -2148,8 +2161,7 @@ let corePlugins = {
|
|
|
2148
2161
|
});
|
|
2149
2162
|
}
|
|
2150
2163
|
}, {
|
|
2151
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
2152
|
-
)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2164
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2153
2165
|
type: [
|
|
2154
2166
|
"color"
|
|
2155
2167
|
]
|
|
@@ -2188,8 +2200,7 @@ let corePlugins = {
|
|
|
2188
2200
|
});
|
|
2189
2201
|
}
|
|
2190
2202
|
}, {
|
|
2191
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
2192
|
-
)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2203
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2193
2204
|
type: "color"
|
|
2194
2205
|
});
|
|
2195
2206
|
matchUtilities({
|
|
@@ -2242,8 +2253,7 @@ let corePlugins = {
|
|
|
2242
2253
|
});
|
|
2243
2254
|
}
|
|
2244
2255
|
}, {
|
|
2245
|
-
values: (({ DEFAULT: _ , ...colors })=>colors
|
|
2246
|
-
)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2256
|
+
values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette).default(theme("borderColor"))),
|
|
2247
2257
|
type: "color"
|
|
2248
2258
|
});
|
|
2249
2259
|
},
|
|
@@ -2313,7 +2323,8 @@ let corePlugins = {
|
|
|
2313
2323
|
let transparentToValue = transparentTo(value);
|
|
2314
2324
|
return {
|
|
2315
2325
|
"--tw-gradient-from": (0, _toColorValue).default(value, "from"),
|
|
2316
|
-
"--tw-gradient-
|
|
2326
|
+
"--tw-gradient-to": transparentToValue,
|
|
2327
|
+
"--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)`
|
|
2317
2328
|
};
|
|
2318
2329
|
}
|
|
2319
2330
|
}, options);
|
|
@@ -2321,7 +2332,8 @@ let corePlugins = {
|
|
|
2321
2332
|
via: (value)=>{
|
|
2322
2333
|
let transparentToValue = transparentTo(value);
|
|
2323
2334
|
return {
|
|
2324
|
-
"--tw-gradient-
|
|
2335
|
+
"--tw-gradient-to": transparentToValue,
|
|
2336
|
+
"--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue).default(value, "via")}, var(--tw-gradient-to)`
|
|
2325
2337
|
};
|
|
2326
2338
|
}
|
|
2327
2339
|
}, options);
|
|
@@ -2573,6 +2585,12 @@ let corePlugins = {
|
|
|
2573
2585
|
},
|
|
2574
2586
|
".text-justify": {
|
|
2575
2587
|
"text-align": "justify"
|
|
2588
|
+
},
|
|
2589
|
+
".text-start": {
|
|
2590
|
+
"text-align": "start"
|
|
2591
|
+
},
|
|
2592
|
+
".text-end": {
|
|
2593
|
+
"text-align": "end"
|
|
2576
2594
|
}
|
|
2577
2595
|
});
|
|
2578
2596
|
},
|
|
@@ -3066,6 +3084,9 @@ let corePlugins = {
|
|
|
3066
3084
|
},
|
|
3067
3085
|
".mix-blend-luminosity": {
|
|
3068
3086
|
"mix-blend-mode": "luminosity"
|
|
3087
|
+
},
|
|
3088
|
+
".mix-blend-plus-lighter": {
|
|
3089
|
+
"mix-blend-mode": "plus-lighter"
|
|
3069
3090
|
}
|
|
3070
3091
|
});
|
|
3071
3092
|
},
|
|
@@ -3189,11 +3210,18 @@ let corePlugins = {
|
|
|
3189
3210
|
]
|
|
3190
3211
|
});
|
|
3191
3212
|
},
|
|
3192
|
-
ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme })=>{
|
|
3193
|
-
let
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3213
|
+
ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme , config })=>{
|
|
3214
|
+
let ringColorDefault = (()=>{
|
|
3215
|
+
var ref, ref1;
|
|
3216
|
+
if ((0, _featureFlags).flagEnabled(config(), "respectDefaultRingColorOpacity")) {
|
|
3217
|
+
return theme("ringColor.DEFAULT");
|
|
3218
|
+
}
|
|
3219
|
+
let ringOpacityDefault = theme("ringOpacity.DEFAULT", "0.5");
|
|
3220
|
+
if (!((ref = theme("ringColor")) === null || ref === void 0 ? void 0 : ref.DEFAULT)) {
|
|
3221
|
+
return `rgb(147 197 253 / ${ringOpacityDefault})`;
|
|
3222
|
+
}
|
|
3223
|
+
return (0, _withAlphaVariable).withAlphaValue((ref1 = theme("ringColor")) === null || ref1 === void 0 ? void 0 : ref1.DEFAULT, ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`);
|
|
3224
|
+
})();
|
|
3197
3225
|
addDefaults("ring-width", {
|
|
3198
3226
|
"--tw-ring-inset": " ",
|
|
3199
3227
|
"--tw-ring-offset-width": theme("ringOffsetWidth.DEFAULT", "0px"),
|
|
@@ -3243,21 +3271,23 @@ let corePlugins = {
|
|
|
3243
3271
|
});
|
|
3244
3272
|
}
|
|
3245
3273
|
}, {
|
|
3246
|
-
values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT"
|
|
3247
|
-
)),
|
|
3274
|
+
values: Object.fromEntries(Object.entries((0, _flattenColorPalette).default(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT")),
|
|
3248
3275
|
type: "color"
|
|
3249
3276
|
});
|
|
3250
3277
|
},
|
|
3251
|
-
ringOpacity: (
|
|
3252
|
-
|
|
3253
|
-
|
|
3278
|
+
ringOpacity: (helpers)=>{
|
|
3279
|
+
let { config } = helpers;
|
|
3280
|
+
return (0, _createUtilityPlugin).default("ringOpacity", [
|
|
3254
3281
|
[
|
|
3255
|
-
"
|
|
3282
|
+
"ring-opacity",
|
|
3283
|
+
[
|
|
3284
|
+
"--tw-ring-opacity"
|
|
3285
|
+
]
|
|
3256
3286
|
]
|
|
3257
|
-
]
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
}
|
|
3287
|
+
], {
|
|
3288
|
+
filterDefault: !(0, _featureFlags).flagEnabled(config(), "respectDefaultRingColorOpacity")
|
|
3289
|
+
})(helpers);
|
|
3290
|
+
},
|
|
3261
3291
|
ringOffsetWidth: (0, _createUtilityPlugin).default("ringOffsetWidth", [
|
|
3262
3292
|
[
|
|
3263
3293
|
"ring-offset",
|
|
@@ -3323,8 +3353,7 @@ let corePlugins = {
|
|
|
3323
3353
|
matchUtilities({
|
|
3324
3354
|
"drop-shadow": (value)=>{
|
|
3325
3355
|
return {
|
|
3326
|
-
"--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`
|
|
3327
|
-
).join(" ") : `drop-shadow(${value})`,
|
|
3356
|
+
"--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`).join(" ") : `drop-shadow(${value})`,
|
|
3328
3357
|
"@defaults filter": {},
|
|
3329
3358
|
filter: cssFilterValue
|
|
3330
3359
|
};
|
package/lib/css/preflight.css
CHANGED
|
@@ -160,6 +160,7 @@ select,
|
|
|
160
160
|
textarea {
|
|
161
161
|
font-family: inherit; /* 1 */
|
|
162
162
|
font-size: 100%; /* 1 */
|
|
163
|
+
font-weight: inherit; /* 1 */
|
|
163
164
|
line-height: inherit; /* 1 */
|
|
164
165
|
color: inherit; /* 1 */
|
|
165
166
|
margin: 0; /* 2 */
|
|
@@ -357,11 +358,3 @@ video {
|
|
|
357
358
|
max-width: 100%;
|
|
358
359
|
height: auto;
|
|
359
360
|
}
|
|
360
|
-
|
|
361
|
-
/*
|
|
362
|
-
Ensure the default browser behavior of the `hidden` attribute.
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
[hidden] {
|
|
366
|
-
display: none;
|
|
367
|
-
}
|
package/lib/featureFlags.js
CHANGED
|
@@ -16,9 +16,13 @@ let defaults = {
|
|
|
16
16
|
optimizeUniversalDefaults: false
|
|
17
17
|
};
|
|
18
18
|
let featureFlags = {
|
|
19
|
-
future: [
|
|
19
|
+
future: [
|
|
20
|
+
"hoverOnlyWhenSupported",
|
|
21
|
+
"respectDefaultRingColorOpacity"
|
|
22
|
+
],
|
|
20
23
|
experimental: [
|
|
21
|
-
"optimizeUniversalDefaults"
|
|
24
|
+
"optimizeUniversalDefaults",
|
|
25
|
+
"matchVariant" /* , 'variantGrouping' */
|
|
22
26
|
]
|
|
23
27
|
};
|
|
24
28
|
function flagEnabled(config, flag) {
|
|
@@ -39,16 +43,14 @@ function experimentalFlagsEnabled(config) {
|
|
|
39
43
|
return featureFlags.experimental;
|
|
40
44
|
}
|
|
41
45
|
var ref;
|
|
42
|
-
return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]
|
|
43
|
-
);
|
|
46
|
+
return Object.keys((ref = config === null || config === void 0 ? void 0 : config.experimental) !== null && ref !== void 0 ? ref : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]);
|
|
44
47
|
}
|
|
45
48
|
function issueFlagNotices(config) {
|
|
46
49
|
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
47
50
|
return;
|
|
48
51
|
}
|
|
49
52
|
if (experimentalFlagsEnabled(config).length > 0) {
|
|
50
|
-
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)
|
|
51
|
-
).join(", ");
|
|
53
|
+
let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", ");
|
|
52
54
|
_log.default.warn("experimental-flags-enabled", [
|
|
53
55
|
`You have enabled experimental features: ${changes}`,
|
|
54
56
|
"Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time.",
|
package/lib/index.js
CHANGED
|
@@ -18,19 +18,16 @@ module.exports = function tailwindcss(configOrPath) {
|
|
|
18
18
|
},
|
|
19
19
|
function(root, result) {
|
|
20
20
|
let context = (0, _setupTrackingContext).default(configOrPath);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
*/ (0, _processTailwindFeatures).default(context)(root, result);
|
|
21
|
+
if (root.type === "document") {
|
|
22
|
+
let roots = root.nodes.filter((node)=>node.type === "root");
|
|
23
|
+
for (const root1 of roots){
|
|
24
|
+
if (root1.type === "root") {
|
|
25
|
+
(0, _processTailwindFeatures).default(context)(root1, result);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
(0, _processTailwindFeatures).default(context)(root, result);
|
|
34
31
|
},
|
|
35
32
|
_sharedState.env.DEBUG && function(root) {
|
|
36
33
|
console.timeEnd("JIT TOTAL");
|
|
@@ -10,26 +10,44 @@ function _interopRequireDefault(obj) {
|
|
|
10
10
|
default: obj
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
function _getRequireWildcardCache() {
|
|
14
|
+
if (typeof WeakMap !== "function") return null;
|
|
15
|
+
var cache = new WeakMap();
|
|
16
|
+
_getRequireWildcardCache = function() {
|
|
17
|
+
return cache;
|
|
18
|
+
};
|
|
19
|
+
return cache;
|
|
20
|
+
}
|
|
13
21
|
function _interopRequireWildcard(obj) {
|
|
14
22
|
if (obj && obj.__esModule) {
|
|
15
23
|
return obj;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
}
|
|
25
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
26
|
+
return {
|
|
27
|
+
default: obj
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
var cache = _getRequireWildcardCache();
|
|
31
|
+
if (cache && cache.has(obj)) {
|
|
32
|
+
return cache.get(obj);
|
|
33
|
+
}
|
|
34
|
+
var newObj = {};
|
|
35
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
36
|
+
for(var key in obj){
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
38
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
39
|
+
if (desc && (desc.get || desc.set)) {
|
|
40
|
+
Object.defineProperty(newObj, key, desc);
|
|
41
|
+
} else {
|
|
42
|
+
newObj[key] = obj[key];
|
|
28
43
|
}
|
|
29
44
|
}
|
|
30
|
-
newObj.default = obj;
|
|
31
|
-
return newObj;
|
|
32
45
|
}
|
|
46
|
+
newObj.default = obj;
|
|
47
|
+
if (cache) {
|
|
48
|
+
cache.set(obj, newObj);
|
|
49
|
+
}
|
|
50
|
+
return newObj;
|
|
33
51
|
}
|
|
34
52
|
/**
|
|
35
53
|
* Calculate the hash of a string.
|
|
@@ -19,9 +19,11 @@ function collapseAdjacentRules() {
|
|
|
19
19
|
var _property, _property1;
|
|
20
20
|
if (node.type === "atrule" && node.name === "font-face") {
|
|
21
21
|
currentRule = node;
|
|
22
|
-
} else if (properties.every((property)=>((_property = node[property]) !== null && _property !== void 0 ? _property : "").replace(/\s+/g, " ") === ((_property1 = currentRule[property]) !== null && _property1 !== void 0 ? _property1 : "").replace(/\s+/g, " ")
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
} else if (properties.every((property)=>((_property = node[property]) !== null && _property !== void 0 ? _property : "").replace(/\s+/g, " ") === ((_property1 = currentRule[property]) !== null && _property1 !== void 0 ? _property1 : "").replace(/\s+/g, " "))) {
|
|
23
|
+
// An AtRule may not have children (for example if we encounter duplicate @import url(…) rules)
|
|
24
|
+
if (node.nodes) {
|
|
25
|
+
currentRule.append(node.nodes);
|
|
26
|
+
}
|
|
25
27
|
node.remove();
|
|
26
28
|
} else {
|
|
27
29
|
currentRule = node;
|