tailwindcss 0.0.0-insiders.ddec022 → 0.0.0-insiders.de00a62
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/cli/build/plugin.js +6 -6
- package/lib/cli/build/watching.js +1 -1
- package/lib/corePluginList.js +5 -1
- package/lib/corePlugins.js +170 -13
- package/lib/css/preflight.css +24 -8
- package/lib/lib/content.js +36 -3
- package/lib/lib/defaultExtractor.js +33 -25
- package/lib/lib/evaluateTailwindFunctions.js +5 -3
- package/lib/lib/expandApplyAtRules.js +6 -0
- package/lib/lib/expandTailwindAtRules.js +23 -6
- package/lib/lib/generateRules.js +47 -25
- package/lib/lib/load-config.js +14 -3
- package/lib/lib/offsets.js +51 -2
- package/lib/lib/resolveDefaultsAtRules.js +3 -1
- package/lib/lib/setupContextUtils.js +76 -37
- package/lib/lib/setupTrackingContext.js +2 -1
- package/lib/oxide/cli/build/plugin.js +6 -6
- package/lib/plugin.js +3 -3
- package/lib/processTailwindFeatures.js +2 -2
- package/lib/util/cloneNodes.js +33 -13
- package/lib/util/color.js +1 -1
- package/lib/util/dataTypes.js +135 -16
- package/lib/util/formatVariantSelector.js +10 -3
- package/lib/util/isPlainObject.js +1 -1
- package/lib/util/pluginUtils.js +13 -0
- package/lib/util/prefixSelector.js +1 -1
- package/lib/util/pseudoElements.js +21 -34
- 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/nesting/index.d.ts +4 -0
- package/package.json +5 -6
- package/peers/index.js +701 -617
- package/resolveConfig.d.ts +22 -3
- package/scripts/generate-types.js +1 -2
- package/src/cli/build/plugin.js +6 -6
- package/src/cli/build/watching.js +1 -1
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +149 -12
- package/src/css/preflight.css +24 -8
- package/src/featureFlags.js +1 -5
- package/src/lib/content.js +42 -1
- package/src/lib/defaultExtractor.js +30 -17
- package/src/lib/evaluateTailwindFunctions.js +4 -1
- package/src/lib/expandApplyAtRules.js +7 -0
- package/src/lib/expandTailwindAtRules.js +23 -6
- package/src/lib/generateRules.js +50 -26
- package/src/lib/load-config.ts +8 -0
- package/src/lib/offsets.js +61 -2
- package/src/lib/resolveDefaultsAtRules.js +5 -1
- package/src/lib/setupContextUtils.js +77 -38
- package/src/lib/setupTrackingContext.js +1 -3
- package/src/oxide/cli/build/plugin.ts +6 -6
- package/src/plugin.js +3 -3
- package/src/processTailwindFeatures.js +3 -2
- package/src/util/cloneNodes.js +35 -14
- package/src/util/color.js +1 -1
- package/src/util/dataTypes.js +143 -18
- package/src/util/formatVariantSelector.js +11 -3
- package/src/util/isPlainObject.js +1 -1
- package/src/util/pluginUtils.js +16 -0
- package/src/util/prefixSelector.js +1 -0
- package/src/util/pseudoElements.js +18 -17
- 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/config.full.js +86 -14
- package/types/config.d.ts +17 -9
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +35 -9
- package/types/index.d.ts +7 -3
package/lib/cli/build/plugin.js
CHANGED
|
@@ -192,14 +192,14 @@ let state = {
|
|
|
192
192
|
return content;
|
|
193
193
|
},
|
|
194
194
|
getContext ({ createContext , cliConfigPath , root , result , content }) {
|
|
195
|
-
if (this.context) {
|
|
196
|
-
this.context.changedContent = this.changedContent.splice(0);
|
|
197
|
-
return this.context;
|
|
198
|
-
}
|
|
199
195
|
_sharedState.env.DEBUG && console.time("Searching for config");
|
|
200
196
|
var _findAtConfigPath1;
|
|
201
197
|
let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath;
|
|
202
198
|
_sharedState.env.DEBUG && console.timeEnd("Searching for config");
|
|
199
|
+
if (this.context) {
|
|
200
|
+
this.context.changedContent = this.changedContent.splice(0);
|
|
201
|
+
return this.context;
|
|
202
|
+
}
|
|
203
203
|
_sharedState.env.DEBUG && console.time("Loading config");
|
|
204
204
|
let config = this.loadConfig(configPath, content);
|
|
205
205
|
_sharedState.env.DEBUG && console.timeEnd("Loading config");
|
|
@@ -245,9 +245,9 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
245
245
|
let tailwindPlugin = ()=>{
|
|
246
246
|
return {
|
|
247
247
|
postcssPlugin: "tailwindcss",
|
|
248
|
-
Once (root, { result }) {
|
|
248
|
+
async Once (root, { result }) {
|
|
249
249
|
_sharedState.env.DEBUG && console.time("Compiling CSS");
|
|
250
|
-
(0, _processTailwindFeatures.default)(({ createContext })=>{
|
|
250
|
+
await (0, _processTailwindFeatures.default)(({ createContext })=>{
|
|
251
251
|
console.error();
|
|
252
252
|
console.error("Rebuilding...");
|
|
253
253
|
return ()=>{
|
|
@@ -126,7 +126,7 @@ function createWatcher(args, { state , rebuild }) {
|
|
|
126
126
|
// This is very likely a chokidar bug but it's one we need to work around
|
|
127
127
|
// We treat this as a change event and rebuild the CSS
|
|
128
128
|
watcher.on("raw", (evt, filePath, meta)=>{
|
|
129
|
-
if (evt !== "rename") {
|
|
129
|
+
if (evt !== "rename" || filePath === null) {
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
let watchedPath = meta.watchedPath;
|
package/lib/corePluginList.js
CHANGED
|
@@ -32,6 +32,7 @@ const _default = [
|
|
|
32
32
|
"lineClamp",
|
|
33
33
|
"display",
|
|
34
34
|
"aspectRatio",
|
|
35
|
+
"size",
|
|
35
36
|
"height",
|
|
36
37
|
"maxHeight",
|
|
37
38
|
"minHeight",
|
|
@@ -98,6 +99,7 @@ const _default = [
|
|
|
98
99
|
"textOverflow",
|
|
99
100
|
"hyphens",
|
|
100
101
|
"whitespace",
|
|
102
|
+
"textWrap",
|
|
101
103
|
"wordBreak",
|
|
102
104
|
"borderRadius",
|
|
103
105
|
"borderWidth",
|
|
@@ -183,5 +185,7 @@ const _default = [
|
|
|
183
185
|
"transitionDuration",
|
|
184
186
|
"transitionTimingFunction",
|
|
185
187
|
"willChange",
|
|
186
|
-
"
|
|
188
|
+
"contain",
|
|
189
|
+
"content",
|
|
190
|
+
"forcedColorAdjust"
|
|
187
191
|
];
|
package/lib/corePlugins.js
CHANGED
|
@@ -35,6 +35,7 @@ const _parseBoxShadowValue = require("./util/parseBoxShadowValue");
|
|
|
35
35
|
const _removeAlphaVariables = require("./util/removeAlphaVariables");
|
|
36
36
|
const _featureFlags = require("./featureFlags");
|
|
37
37
|
const _dataTypes = require("./util/dataTypes");
|
|
38
|
+
const _setupContextUtils = require("./lib/setupContextUtils");
|
|
38
39
|
function _interop_require_default(obj) {
|
|
39
40
|
return obj && obj.__esModule ? obj : {
|
|
40
41
|
default: obj
|
|
@@ -80,6 +81,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
80
81
|
return newObj;
|
|
81
82
|
}
|
|
82
83
|
let variantPlugins = {
|
|
84
|
+
childVariant: ({ addVariant })=>{
|
|
85
|
+
addVariant("*", "& > *");
|
|
86
|
+
},
|
|
83
87
|
pseudoElementVariants: ({ addVariant })=>{
|
|
84
88
|
addVariant("first-letter", "&::first-letter");
|
|
85
89
|
addVariant("first-line", "&::first-line");
|
|
@@ -135,7 +139,7 @@ let variantPlugins = {
|
|
|
135
139
|
return "&::after";
|
|
136
140
|
});
|
|
137
141
|
},
|
|
138
|
-
pseudoClassVariants: ({ addVariant , matchVariant , config })=>{
|
|
142
|
+
pseudoClassVariants: ({ addVariant , matchVariant , config , prefix })=>{
|
|
139
143
|
let pseudoVariants = [
|
|
140
144
|
// Positional
|
|
141
145
|
[
|
|
@@ -216,17 +220,17 @@ let variantPlugins = {
|
|
|
216
220
|
}
|
|
217
221
|
let variants = {
|
|
218
222
|
group: (_, { modifier })=>modifier ? [
|
|
219
|
-
`:merge(.group\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
223
|
+
`:merge(${prefix(".group")}\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
220
224
|
" &"
|
|
221
225
|
] : [
|
|
222
|
-
`:merge(.group)`,
|
|
226
|
+
`:merge(${prefix(".group")})`,
|
|
223
227
|
" &"
|
|
224
228
|
],
|
|
225
229
|
peer: (_, { modifier })=>modifier ? [
|
|
226
|
-
`:merge(.peer\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
230
|
+
`:merge(${prefix(".peer")}\\/${(0, _escapeClassName.default)(modifier)})`,
|
|
227
231
|
" ~ &"
|
|
228
232
|
] : [
|
|
229
|
-
`:merge(.peer)`,
|
|
233
|
+
`:merge(${prefix(".peer")})`,
|
|
230
234
|
" ~ &"
|
|
231
235
|
]
|
|
232
236
|
};
|
|
@@ -255,20 +259,23 @@ let variantPlugins = {
|
|
|
255
259
|
// result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b)
|
|
256
260
|
return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end);
|
|
257
261
|
}, {
|
|
258
|
-
values: Object.fromEntries(pseudoVariants)
|
|
262
|
+
values: Object.fromEntries(pseudoVariants),
|
|
263
|
+
[_setupContextUtils.INTERNAL_FEATURES]: {
|
|
264
|
+
respectPrefix: false
|
|
265
|
+
}
|
|
259
266
|
});
|
|
260
267
|
}
|
|
261
268
|
},
|
|
262
269
|
directionVariants: ({ addVariant })=>{
|
|
263
|
-
addVariant("ltr", '
|
|
264
|
-
addVariant("rtl", '
|
|
270
|
+
addVariant("ltr", '&:where([dir="ltr"], [dir="ltr"] *)');
|
|
271
|
+
addVariant("rtl", '&:where([dir="rtl"], [dir="rtl"] *)');
|
|
265
272
|
},
|
|
266
273
|
reducedMotionVariants: ({ addVariant })=>{
|
|
267
274
|
addVariant("motion-safe", "@media (prefers-reduced-motion: no-preference)");
|
|
268
275
|
addVariant("motion-reduce", "@media (prefers-reduced-motion: reduce)");
|
|
269
276
|
},
|
|
270
277
|
darkVariants: ({ config , addVariant })=>{
|
|
271
|
-
let [mode,
|
|
278
|
+
let [mode, selector = ".dark"] = [].concat(config("darkMode", "media"));
|
|
272
279
|
if (mode === false) {
|
|
273
280
|
mode = "media";
|
|
274
281
|
_log.default.warn("darkmode-false", [
|
|
@@ -277,10 +284,48 @@ let variantPlugins = {
|
|
|
277
284
|
"https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration"
|
|
278
285
|
]);
|
|
279
286
|
}
|
|
280
|
-
if (mode === "
|
|
281
|
-
|
|
287
|
+
if (mode === "variant") {
|
|
288
|
+
let formats;
|
|
289
|
+
if (Array.isArray(selector)) {
|
|
290
|
+
formats = selector;
|
|
291
|
+
} else if (typeof selector === "function") {
|
|
292
|
+
formats = selector;
|
|
293
|
+
} else if (typeof selector === "string") {
|
|
294
|
+
formats = [
|
|
295
|
+
selector
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
// TODO: We could also add these warnings if the user passes a function that returns string | string[]
|
|
299
|
+
// But this is an advanced enough use case that it's probably not necessary
|
|
300
|
+
if (Array.isArray(formats)) {
|
|
301
|
+
for (let format of formats){
|
|
302
|
+
if (format === ".dark") {
|
|
303
|
+
mode = false;
|
|
304
|
+
_log.default.warn("darkmode-variant-without-selector", [
|
|
305
|
+
"When using `variant` for `darkMode`, you must provide a selector.",
|
|
306
|
+
'Example: `darkMode: ["variant", ".your-selector &"]`'
|
|
307
|
+
]);
|
|
308
|
+
} else if (!format.includes("&")) {
|
|
309
|
+
mode = false;
|
|
310
|
+
_log.default.warn("darkmode-variant-without-ampersand", [
|
|
311
|
+
"When using `variant` for `darkMode`, your selector must contain `&`.",
|
|
312
|
+
'Example `darkMode: ["variant", ".your-selector &"]`'
|
|
313
|
+
]);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
selector = formats;
|
|
318
|
+
}
|
|
319
|
+
if (mode === "selector") {
|
|
320
|
+
// New preferred behavior
|
|
321
|
+
addVariant("dark", `&:where(${selector}, ${selector} *)`);
|
|
282
322
|
} else if (mode === "media") {
|
|
283
323
|
addVariant("dark", "@media (prefers-color-scheme: dark)");
|
|
324
|
+
} else if (mode === "variant") {
|
|
325
|
+
addVariant("dark", selector);
|
|
326
|
+
} else if (mode === "class") {
|
|
327
|
+
// Old behavior
|
|
328
|
+
addVariant("dark", `:is(${selector} &)`);
|
|
284
329
|
}
|
|
285
330
|
},
|
|
286
331
|
printVariant: ({ addVariant })=>{
|
|
@@ -415,6 +460,17 @@ let variantPlugins = {
|
|
|
415
460
|
values: (_theme = theme("supports")) !== null && _theme !== void 0 ? _theme : {}
|
|
416
461
|
});
|
|
417
462
|
},
|
|
463
|
+
hasVariants: ({ matchVariant })=>{
|
|
464
|
+
matchVariant("has", (value)=>`&:has(${(0, _dataTypes.normalize)(value)})`, {
|
|
465
|
+
values: {}
|
|
466
|
+
});
|
|
467
|
+
matchVariant("group-has", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) &` : `:merge(.group):has(${(0, _dataTypes.normalize)(value)}) &`, {
|
|
468
|
+
values: {}
|
|
469
|
+
});
|
|
470
|
+
matchVariant("peer-has", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) ~ &` : `:merge(.peer):has(${(0, _dataTypes.normalize)(value)}) ~ &`, {
|
|
471
|
+
values: {}
|
|
472
|
+
});
|
|
473
|
+
},
|
|
418
474
|
ariaVariants: ({ matchVariant , theme })=>{
|
|
419
475
|
var _theme;
|
|
420
476
|
matchVariant("aria", (value)=>`&[aria-${(0, _dataTypes.normalize)(value)}]`, {
|
|
@@ -450,6 +506,9 @@ let variantPlugins = {
|
|
|
450
506
|
prefersContrastVariants: ({ addVariant })=>{
|
|
451
507
|
addVariant("contrast-more", "@media (prefers-contrast: more)");
|
|
452
508
|
addVariant("contrast-less", "@media (prefers-contrast: less)");
|
|
509
|
+
},
|
|
510
|
+
forcedColorsVariants: ({ addVariant })=>{
|
|
511
|
+
addVariant("forced-colors", "@media (forced-colors: active)");
|
|
453
512
|
}
|
|
454
513
|
};
|
|
455
514
|
let cssTransformValue = [
|
|
@@ -770,6 +829,12 @@ let corePlugins = {
|
|
|
770
829
|
]),
|
|
771
830
|
float: ({ addUtilities })=>{
|
|
772
831
|
addUtilities({
|
|
832
|
+
".float-start": {
|
|
833
|
+
float: "inline-start"
|
|
834
|
+
},
|
|
835
|
+
".float-end": {
|
|
836
|
+
float: "inline-end"
|
|
837
|
+
},
|
|
773
838
|
".float-right": {
|
|
774
839
|
float: "right"
|
|
775
840
|
},
|
|
@@ -783,6 +848,12 @@ let corePlugins = {
|
|
|
783
848
|
},
|
|
784
849
|
clear: ({ addUtilities })=>{
|
|
785
850
|
addUtilities({
|
|
851
|
+
".clear-start": {
|
|
852
|
+
clear: "inline-start"
|
|
853
|
+
},
|
|
854
|
+
".clear-end": {
|
|
855
|
+
clear: "inline-end"
|
|
856
|
+
},
|
|
786
857
|
".clear-left": {
|
|
787
858
|
clear: "left"
|
|
788
859
|
},
|
|
@@ -966,6 +1037,15 @@ let corePlugins = {
|
|
|
966
1037
|
]
|
|
967
1038
|
]
|
|
968
1039
|
]),
|
|
1040
|
+
size: (0, _createUtilityPlugin.default)("size", [
|
|
1041
|
+
[
|
|
1042
|
+
"size",
|
|
1043
|
+
[
|
|
1044
|
+
"width",
|
|
1045
|
+
"height"
|
|
1046
|
+
]
|
|
1047
|
+
]
|
|
1048
|
+
]),
|
|
969
1049
|
height: (0, _createUtilityPlugin.default)("height", [
|
|
970
1050
|
[
|
|
971
1051
|
"h",
|
|
@@ -1283,7 +1363,7 @@ let corePlugins = {
|
|
|
1283
1363
|
});
|
|
1284
1364
|
},
|
|
1285
1365
|
animation: ({ matchUtilities , theme , config })=>{
|
|
1286
|
-
let prefixName = (name)
|
|
1366
|
+
let prefixName = (name)=>(0, _escapeClassName.default)(config("prefix") + name);
|
|
1287
1367
|
var _theme;
|
|
1288
1368
|
let keyframes = Object.fromEntries(Object.entries((_theme = theme("keyframes")) !== null && _theme !== void 0 ? _theme : {}).map(([key, value])=>{
|
|
1289
1369
|
return [
|
|
@@ -1609,6 +1689,9 @@ let corePlugins = {
|
|
|
1609
1689
|
addUtilities({
|
|
1610
1690
|
".appearance-none": {
|
|
1611
1691
|
appearance: "none"
|
|
1692
|
+
},
|
|
1693
|
+
".appearance-auto": {
|
|
1694
|
+
appearance: "auto"
|
|
1612
1695
|
}
|
|
1613
1696
|
});
|
|
1614
1697
|
},
|
|
@@ -2293,6 +2376,22 @@ let corePlugins = {
|
|
|
2293
2376
|
}
|
|
2294
2377
|
});
|
|
2295
2378
|
},
|
|
2379
|
+
textWrap: ({ addUtilities })=>{
|
|
2380
|
+
addUtilities({
|
|
2381
|
+
".text-wrap": {
|
|
2382
|
+
"text-wrap": "wrap"
|
|
2383
|
+
},
|
|
2384
|
+
".text-nowrap": {
|
|
2385
|
+
"text-wrap": "nowrap"
|
|
2386
|
+
},
|
|
2387
|
+
".text-balance": {
|
|
2388
|
+
"text-wrap": "balance"
|
|
2389
|
+
},
|
|
2390
|
+
".text-pretty": {
|
|
2391
|
+
"text-wrap": "pretty"
|
|
2392
|
+
}
|
|
2393
|
+
});
|
|
2394
|
+
},
|
|
2296
2395
|
wordBreak: ({ addUtilities })=>{
|
|
2297
2396
|
addUtilities({
|
|
2298
2397
|
".break-normal": {
|
|
@@ -3593,6 +3692,9 @@ let corePlugins = {
|
|
|
3593
3692
|
".mix-blend-luminosity": {
|
|
3594
3693
|
"mix-blend-mode": "luminosity"
|
|
3595
3694
|
},
|
|
3695
|
+
".mix-blend-plus-darker": {
|
|
3696
|
+
"mix-blend-mode": "plus-darker"
|
|
3697
|
+
},
|
|
3596
3698
|
".mix-blend-plus-lighter": {
|
|
3597
3699
|
"mix-blend-mode": "plus-lighter"
|
|
3598
3700
|
}
|
|
@@ -4158,6 +4260,51 @@ let corePlugins = {
|
|
|
4158
4260
|
]
|
|
4159
4261
|
]
|
|
4160
4262
|
]),
|
|
4263
|
+
contain: ({ addDefaults , addUtilities })=>{
|
|
4264
|
+
let cssContainValue = "var(--tw-contain-size) var(--tw-contain-layout) var(--tw-contain-paint) var(--tw-contain-style)";
|
|
4265
|
+
addDefaults("contain", {
|
|
4266
|
+
"--tw-contain-size": " ",
|
|
4267
|
+
"--tw-contain-layout": " ",
|
|
4268
|
+
"--tw-contain-paint": " ",
|
|
4269
|
+
"--tw-contain-style": " "
|
|
4270
|
+
});
|
|
4271
|
+
addUtilities({
|
|
4272
|
+
".contain-none": {
|
|
4273
|
+
contain: "none"
|
|
4274
|
+
},
|
|
4275
|
+
".contain-content": {
|
|
4276
|
+
contain: "content"
|
|
4277
|
+
},
|
|
4278
|
+
".contain-strict": {
|
|
4279
|
+
contain: "strict"
|
|
4280
|
+
},
|
|
4281
|
+
".contain-size": {
|
|
4282
|
+
"@defaults contain": {},
|
|
4283
|
+
"--tw-contain-size": "size",
|
|
4284
|
+
contain: cssContainValue
|
|
4285
|
+
},
|
|
4286
|
+
".contain-inline-size": {
|
|
4287
|
+
"@defaults contain": {},
|
|
4288
|
+
"--tw-contain-size": "inline-size",
|
|
4289
|
+
contain: cssContainValue
|
|
4290
|
+
},
|
|
4291
|
+
".contain-layout": {
|
|
4292
|
+
"@defaults contain": {},
|
|
4293
|
+
"--tw-contain-layout": "layout",
|
|
4294
|
+
contain: cssContainValue
|
|
4295
|
+
},
|
|
4296
|
+
".contain-paint": {
|
|
4297
|
+
"@defaults contain": {},
|
|
4298
|
+
"--tw-contain-paint": "paint",
|
|
4299
|
+
contain: cssContainValue
|
|
4300
|
+
},
|
|
4301
|
+
".contain-style": {
|
|
4302
|
+
"@defaults contain": {},
|
|
4303
|
+
"--tw-contain-style": "style",
|
|
4304
|
+
contain: cssContainValue
|
|
4305
|
+
}
|
|
4306
|
+
});
|
|
4307
|
+
},
|
|
4161
4308
|
content: (0, _createUtilityPlugin.default)("content", [
|
|
4162
4309
|
[
|
|
4163
4310
|
"content",
|
|
@@ -4169,5 +4316,15 @@ let corePlugins = {
|
|
|
4169
4316
|
]
|
|
4170
4317
|
]
|
|
4171
4318
|
]
|
|
4172
|
-
])
|
|
4319
|
+
]),
|
|
4320
|
+
forcedColorAdjust: ({ addUtilities })=>{
|
|
4321
|
+
addUtilities({
|
|
4322
|
+
".forced-color-adjust-auto": {
|
|
4323
|
+
"forced-color-adjust": "auto"
|
|
4324
|
+
},
|
|
4325
|
+
".forced-color-adjust-none": {
|
|
4326
|
+
"forced-color-adjust": "none"
|
|
4327
|
+
}
|
|
4328
|
+
});
|
|
4329
|
+
}
|
|
4173
4330
|
};
|
package/lib/css/preflight.css
CHANGED
|
@@ -24,16 +24,19 @@
|
|
|
24
24
|
4. Use the user's configured `sans` font-family by default.
|
|
25
25
|
5. Use the user's configured `sans` font-feature-settings by default.
|
|
26
26
|
6. Use the user's configured `sans` font-variation-settings by default.
|
|
27
|
+
7. Disable tap highlights on iOS
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
|
-
html
|
|
30
|
+
html,
|
|
31
|
+
:host {
|
|
30
32
|
line-height: 1.5; /* 1 */
|
|
31
33
|
-webkit-text-size-adjust: 100%; /* 2 */
|
|
32
34
|
-moz-tab-size: 4; /* 3 */
|
|
33
35
|
tab-size: 4; /* 3 */
|
|
34
|
-
font-family: theme('fontFamily.sans', ui-sans-serif, system-ui,
|
|
36
|
+
font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */
|
|
35
37
|
font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */
|
|
36
38
|
font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */
|
|
39
|
+
-webkit-tap-highlight-color: transparent; /* 7 */
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
/*
|
|
@@ -99,8 +102,10 @@ strong {
|
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
/*
|
|
102
|
-
1. Use the user's configured `mono` font
|
|
103
|
-
2.
|
|
105
|
+
1. Use the user's configured `mono` font-family by default.
|
|
106
|
+
2. Use the user's configured `mono` font-feature-settings by default.
|
|
107
|
+
3. Use the user's configured `mono` font-variation-settings by default.
|
|
108
|
+
4. Correct the odd `em` font sizing in all browsers.
|
|
104
109
|
*/
|
|
105
110
|
|
|
106
111
|
code,
|
|
@@ -108,7 +113,9 @@ kbd,
|
|
|
108
113
|
samp,
|
|
109
114
|
pre {
|
|
110
115
|
font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */
|
|
111
|
-
font-
|
|
116
|
+
font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); /* 2 */
|
|
117
|
+
font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); /* 3 */
|
|
118
|
+
font-size: 1em; /* 4 */
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
/*
|
|
@@ -163,6 +170,8 @@ optgroup,
|
|
|
163
170
|
select,
|
|
164
171
|
textarea {
|
|
165
172
|
font-family: inherit; /* 1 */
|
|
173
|
+
font-feature-settings: inherit; /* 1 */
|
|
174
|
+
font-variation-settings: inherit; /* 1 */
|
|
166
175
|
font-size: 100%; /* 1 */
|
|
167
176
|
font-weight: inherit; /* 1 */
|
|
168
177
|
line-height: inherit; /* 1 */
|
|
@@ -186,9 +195,9 @@ select {
|
|
|
186
195
|
*/
|
|
187
196
|
|
|
188
197
|
button,
|
|
189
|
-
[type='button'],
|
|
190
|
-
[type='reset'],
|
|
191
|
-
[type='submit'] {
|
|
198
|
+
input:where([type='button']),
|
|
199
|
+
input:where([type='reset']),
|
|
200
|
+
input:where([type='submit']) {
|
|
192
201
|
-webkit-appearance: button; /* 1 */
|
|
193
202
|
background-color: transparent; /* 2 */
|
|
194
203
|
background-image: none; /* 2 */
|
|
@@ -300,6 +309,13 @@ menu {
|
|
|
300
309
|
padding: 0;
|
|
301
310
|
}
|
|
302
311
|
|
|
312
|
+
/*
|
|
313
|
+
Reset default styling for dialogs.
|
|
314
|
+
*/
|
|
315
|
+
dialog {
|
|
316
|
+
padding: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
303
319
|
/*
|
|
304
320
|
Prevent resizing textareas horizontally by default.
|
|
305
321
|
*/
|
package/lib/lib/content.js
CHANGED
|
@@ -21,7 +21,6 @@ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
|
21
21
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
22
22
|
const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
|
|
23
23
|
const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
|
|
24
|
-
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
|
|
25
24
|
const _parseGlob = require("../util/parseGlob");
|
|
26
25
|
const _sharedState = require("./sharedState");
|
|
27
26
|
function _interop_require_default(obj) {
|
|
@@ -29,11 +28,42 @@ function _interop_require_default(obj) {
|
|
|
29
28
|
default: obj
|
|
30
29
|
};
|
|
31
30
|
}
|
|
31
|
+
/*!
|
|
32
|
+
* Modified version of normalize-path, original license below
|
|
33
|
+
*
|
|
34
|
+
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
37
|
+
* Released under the MIT License.
|
|
38
|
+
*/ function normalizePath(path) {
|
|
39
|
+
if (typeof path !== "string") {
|
|
40
|
+
throw new TypeError("expected path to be a string");
|
|
41
|
+
}
|
|
42
|
+
if (path === "\\" || path === "/") return "/";
|
|
43
|
+
var len = path.length;
|
|
44
|
+
if (len <= 1) return path;
|
|
45
|
+
// ensure that win32 namespaces has two leading slashes, so that the path is
|
|
46
|
+
// handled properly by the win32 version of path.parse() after being normalized
|
|
47
|
+
// https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
|
|
48
|
+
var prefix = "";
|
|
49
|
+
if (len > 4 && path[3] === "\\") {
|
|
50
|
+
var ch = path[2];
|
|
51
|
+
if ((ch === "?" || ch === ".") && path.slice(0, 2) === "\\\\") {
|
|
52
|
+
path = path.slice(2);
|
|
53
|
+
prefix = "//";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Modified part: instead of purely splitting on `\\` and `/`, we split on
|
|
57
|
+
// `/` and `\\` that is _not_ followed by any of the following characters: ()[]
|
|
58
|
+
// This is to ensure that we keep the escaping of brackets and parentheses
|
|
59
|
+
let segs = path.split(/[/\\]+(?![\(\)\[\]])/);
|
|
60
|
+
return prefix + segs.join("/");
|
|
61
|
+
}
|
|
32
62
|
function parseCandidateFiles(context, tailwindConfig) {
|
|
33
63
|
let files = tailwindConfig.content.files;
|
|
34
64
|
// Normalize the file globs
|
|
35
65
|
files = files.filter((filePath)=>typeof filePath === "string");
|
|
36
|
-
files = files.map(
|
|
66
|
+
files = files.map(normalizePath);
|
|
37
67
|
// Split into included and excluded globs
|
|
38
68
|
let tasks = _fastglob.default.generateTasks(files);
|
|
39
69
|
/** @type {ContentPath[]} */ let included = [];
|
|
@@ -60,6 +90,9 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
60
90
|
* @param {boolean} ignore
|
|
61
91
|
* @returns {ContentPath}
|
|
62
92
|
*/ function parseFilePath(filePath, ignore) {
|
|
93
|
+
// Escape special characters in the file path such as: ()[]
|
|
94
|
+
// But only if the special character isn't already escaped
|
|
95
|
+
filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, "\\$1");
|
|
63
96
|
let contentPath = {
|
|
64
97
|
original: filePath,
|
|
65
98
|
base: filePath,
|
|
@@ -81,7 +114,7 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
81
114
|
// Afaik, this technically shouldn't be needed but there's probably
|
|
82
115
|
// some internal, direct path matching with a normalized path in
|
|
83
116
|
// a package which can't handle mixed directory separators
|
|
84
|
-
let base = (
|
|
117
|
+
let base = normalizePath(contentPath.base);
|
|
85
118
|
// If the user's file path contains any special characters (like parens) for instance fast-glob
|
|
86
119
|
// is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
|
|
87
120
|
base = _fastglob.default.escapePath(base);
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "defaultExtractor", {
|
|
|
8
8
|
return defaultExtractor;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _featureFlags = require("../featureFlags");
|
|
12
11
|
const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
|
|
13
12
|
function _getRequireWildcardCache(nodeInterop) {
|
|
14
13
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -57,17 +56,15 @@ function defaultExtractor(context) {
|
|
|
57
56
|
/** @type {(string|string)[]} */ let results = [];
|
|
58
57
|
for (let pattern of patterns){
|
|
59
58
|
var _content_match;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
];
|
|
59
|
+
for (let result of (_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : []){
|
|
60
|
+
results.push(clipAtBalancedParens(result));
|
|
61
|
+
}
|
|
64
62
|
}
|
|
65
|
-
return results
|
|
63
|
+
return results;
|
|
66
64
|
};
|
|
67
65
|
}
|
|
68
66
|
function* buildRegExps(context) {
|
|
69
67
|
let separator = context.tailwindConfig.separator;
|
|
70
|
-
let variantGroupingEnabled = (0, _featureFlags.flagEnabled)(context.tailwindConfig, "variantGrouping");
|
|
71
68
|
let prefix = context.tailwindConfig.prefix !== "" ? _regex.optional(_regex.pattern([
|
|
72
69
|
/-?/,
|
|
73
70
|
_regex.escape(context.tailwindConfig.prefix)
|
|
@@ -79,16 +76,25 @@ function* buildRegExps(context) {
|
|
|
79
76
|
// This is a targeted fix to continue to allow theme()
|
|
80
77
|
// with square brackets to work in arbitrary properties
|
|
81
78
|
// while fixing a problem with the regex matching too much
|
|
82
|
-
/\[[^\s:'"
|
|
79
|
+
/\[[^\s:'"`\]]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
|
|
83
80
|
// Utilities
|
|
84
81
|
_regex.pattern([
|
|
85
82
|
// Utility Name / Group Name
|
|
86
|
-
|
|
83
|
+
_regex.any([
|
|
84
|
+
/-?(?:\w+)/,
|
|
85
|
+
// This is here to make sure @container supports everything that other utilities do
|
|
86
|
+
/@(?:\w+)/
|
|
87
|
+
]),
|
|
87
88
|
// Normal/Arbitrary values
|
|
88
89
|
_regex.optional(_regex.any([
|
|
89
90
|
_regex.pattern([
|
|
90
91
|
// Arbitrary values
|
|
91
|
-
|
|
92
|
+
_regex.any([
|
|
93
|
+
/-(?:\w+-)*\['[^\s]+'\]/,
|
|
94
|
+
/-(?:\w+-)*\["[^\s]+"\]/,
|
|
95
|
+
/-(?:\w+-)*\[`[^\s]+`\]/,
|
|
96
|
+
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/
|
|
97
|
+
]),
|
|
92
98
|
// Not immediately followed by an `{[(`
|
|
93
99
|
/(?![{([]])/,
|
|
94
100
|
// optionally followed by an opacity modifier
|
|
@@ -96,7 +102,12 @@ function* buildRegExps(context) {
|
|
|
96
102
|
]),
|
|
97
103
|
_regex.pattern([
|
|
98
104
|
// Arbitrary values
|
|
99
|
-
|
|
105
|
+
_regex.any([
|
|
106
|
+
/-(?:\w+-)*\['[^\s]+'\]/,
|
|
107
|
+
/-(?:\w+-)*\["[^\s]+"\]/,
|
|
108
|
+
/-(?:\w+-)*\[`[^\s]+`\]/,
|
|
109
|
+
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s\[\]]+\]/
|
|
110
|
+
]),
|
|
100
111
|
// Not immediately followed by an `{[(`
|
|
101
112
|
/(?![{([]])/,
|
|
102
113
|
// optionally followed by an opacity modifier
|
|
@@ -115,6 +126,11 @@ function* buildRegExps(context) {
|
|
|
115
126
|
/@\[[^\s"'`]+\](\/[^\s"'`]+)?/,
|
|
116
127
|
separator
|
|
117
128
|
]),
|
|
129
|
+
// With variant modifier (e.g.: group-[..]/modifier)
|
|
130
|
+
_regex.pattern([
|
|
131
|
+
/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]\/\w+/,
|
|
132
|
+
separator
|
|
133
|
+
]),
|
|
118
134
|
_regex.pattern([
|
|
119
135
|
/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/,
|
|
120
136
|
separator
|
|
@@ -126,6 +142,11 @@ function* buildRegExps(context) {
|
|
|
126
142
|
]),
|
|
127
143
|
// With quotes allowed
|
|
128
144
|
_regex.any([
|
|
145
|
+
// With variant modifier (e.g.: group-[..]/modifier)
|
|
146
|
+
_regex.pattern([
|
|
147
|
+
/([^\s"'`\[\\]+-)?\[[^\s`]+\]\/\w+/,
|
|
148
|
+
separator
|
|
149
|
+
]),
|
|
129
150
|
_regex.pattern([
|
|
130
151
|
/([^\s"'`\[\\]+-)?\[[^\s`]+\]/,
|
|
131
152
|
separator
|
|
@@ -145,20 +166,7 @@ function* buildRegExps(context) {
|
|
|
145
166
|
// Important (optional)
|
|
146
167
|
/!?/,
|
|
147
168
|
prefix,
|
|
148
|
-
|
|
149
|
-
// Or any of those things but grouped separated by commas
|
|
150
|
-
_regex.pattern([
|
|
151
|
-
/\(/,
|
|
152
|
-
utility,
|
|
153
|
-
_regex.zeroOrMore([
|
|
154
|
-
/,/,
|
|
155
|
-
utility
|
|
156
|
-
]),
|
|
157
|
-
/\)/
|
|
158
|
-
]),
|
|
159
|
-
// Arbitrary properties, constrained utilities, arbitrary values, etc…
|
|
160
|
-
utility
|
|
161
|
-
]) : utility
|
|
169
|
+
utility
|
|
162
170
|
]);
|
|
163
171
|
}
|
|
164
172
|
// 5. Inner matches
|
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "default", {
|
|
|
11
11
|
const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv"));
|
|
12
12
|
const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean"));
|
|
13
13
|
const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue"));
|
|
14
|
-
const
|
|
14
|
+
const _index = /*#__PURE__*/ _interop_require_default(require("../value-parser/index"));
|
|
15
15
|
const _normalizeScreens = require("../util/normalizeScreens");
|
|
16
16
|
const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery"));
|
|
17
17
|
const _toPath = require("../util/toPath");
|
|
@@ -121,7 +121,7 @@ function extractArgs(node, vNodes, functions) {
|
|
|
121
121
|
if (vNode.type === "div" && vNode.value === ",") {
|
|
122
122
|
args.push("");
|
|
123
123
|
} else {
|
|
124
|
-
args[args.length - 1] +=
|
|
124
|
+
args[args.length - 1] += _index.default.stringify(vNode);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
return args;
|
|
@@ -135,7 +135,9 @@ function resolveVNode(node, vNode, functions) {
|
|
|
135
135
|
return vNode;
|
|
136
136
|
}
|
|
137
137
|
function resolveFunctions(node, input, functions) {
|
|
138
|
-
|
|
138
|
+
let hasAnyFn = Object.keys(functions).some((fn)=>input.includes(`${fn}(`));
|
|
139
|
+
if (!hasAnyFn) return input;
|
|
140
|
+
return (0, _index.default)(input).walk((vNode)=>{
|
|
139
141
|
resolveVNode(node, vNode, functions);
|
|
140
142
|
}).toString();
|
|
141
143
|
}
|