tailwindcss 3.4.3 → 3.4.5
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 +22 -1
- package/lib/corePlugins.js +41 -13
- package/lib/lib/defaultExtractor.js +22 -2
- package/lib/lib/load-config.js +4 -0
- package/lib/util/dataTypes.js +7 -1
- package/lib/util/normalizeConfig.js +1 -2
- package/lib/util/parseAnimationValue.js +1 -1
- package/lib/util/parseGlob.js +1 -2
- package/lib/util/pluginUtils.js +1 -1
- package/lib/util/resolveConfigPath.js +3 -1
- package/lib/util/splitAtTopLevelOnly.js +1 -5
- package/package.json +1 -1
- package/peers/index.js +2080 -1912
- package/src/corePlugins.js +54 -16
- package/src/lib/defaultExtractor.js +25 -3
- package/src/lib/load-config.ts +11 -0
- package/src/util/dataTypes.js +6 -0
- package/src/util/normalizeConfig.js +1 -3
- package/src/util/parseAnimationValue.js +1 -1
- package/src/util/parseGlob.js +1 -2
- package/src/util/pluginUtils.js +1 -1
- package/src/util/resolveConfigPath.js +2 -0
- package/src/util/splitAtTopLevelOnly.js +1 -5
- package/stubs/config.full.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
- Nothing yet!
|
|
11
11
|
|
|
12
|
+
## [3.4.5] - 2024-07-15
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Disable automatic `var()` injection for anchor properties ([#13826](https://github.com/tailwindlabs/tailwindcss/pull/13826))
|
|
17
|
+
- Use no value instead of `blur(0px)` for `backdrop-blur-none` and `blur-none` utilities ([#13830](https://github.com/tailwindlabs/tailwindcss/pull/13830))
|
|
18
|
+
- Add `.mts` and `.cts` config file detection ([#13940](https://github.com/tailwindlabs/tailwindcss/pull/13940))
|
|
19
|
+
- Don't generate utilities like `px-1` unnecessarily when using utilities like `px-1.5` ([#13959](https://github.com/tailwindlabs/tailwindcss/pull/13959))
|
|
20
|
+
- Always generate `-webkit-backdrop-filter` for `backdrop-*` utilities ([#13997](https://github.com/tailwindlabs/tailwindcss/pull/13997))
|
|
21
|
+
|
|
22
|
+
## [3.4.4] - 2024-06-05
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Make it possible to use multiple `<alpha-value>` placeholders in a single color definition ([#13740](https://github.com/tailwindlabs/tailwindcss/pull/13740))
|
|
27
|
+
- Don't prefix classes in arbitrary values of `has-*`, `group-has-*`, and `peer-has-*` variants ([#13770](https://github.com/tailwindlabs/tailwindcss/pull/13770))
|
|
28
|
+
- Support negative values for `{col,row}-{start,end}` utilities ([#13781](https://github.com/tailwindlabs/tailwindcss/pull/13781))
|
|
29
|
+
- Update embedded browserslist database ([#13792](https://github.com/tailwindlabs/tailwindcss/pull/13792))
|
|
30
|
+
|
|
12
31
|
## [3.4.3] - 2024-03-27
|
|
13
32
|
|
|
14
33
|
### Fixed
|
|
@@ -2376,7 +2395,9 @@ No release notes
|
|
|
2376
2395
|
|
|
2377
2396
|
- Everything!
|
|
2378
2397
|
|
|
2379
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.
|
|
2398
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.5...HEAD
|
|
2399
|
+
[3.4.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.4...v3.4.5
|
|
2400
|
+
[3.4.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.3...v3.4.4
|
|
2380
2401
|
[3.4.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.2...v3.4.3
|
|
2381
2402
|
[3.4.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.1...v3.4.2
|
|
2382
2403
|
[3.4.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.0...v3.4.1
|
package/lib/corePlugins.js
CHANGED
|
@@ -443,7 +443,7 @@ let variantPlugins = {
|
|
|
443
443
|
matchVariant("supports", (value = "")=>{
|
|
444
444
|
let check = (0, _dataTypes.normalize)(value);
|
|
445
445
|
let isRaw = /^\w*\s*\(/.test(check);
|
|
446
|
-
// Chrome has a bug where `(
|
|
446
|
+
// Chrome has a bug where `(condition1)or(condition2)` is not valid
|
|
447
447
|
// But `(condition1) or (condition2)` is supported.
|
|
448
448
|
check = isRaw ? check.replace(/\b(and|or|not)\b/g, " $1 ") : check;
|
|
449
449
|
if (isRaw) {
|
|
@@ -460,15 +460,24 @@ let variantPlugins = {
|
|
|
460
460
|
values: (_theme = theme("supports")) !== null && _theme !== void 0 ? _theme : {}
|
|
461
461
|
});
|
|
462
462
|
},
|
|
463
|
-
hasVariants: ({ matchVariant })=>{
|
|
463
|
+
hasVariants: ({ matchVariant , prefix })=>{
|
|
464
464
|
matchVariant("has", (value)=>`&:has(${(0, _dataTypes.normalize)(value)})`, {
|
|
465
|
-
values: {}
|
|
465
|
+
values: {},
|
|
466
|
+
[_setupContextUtils.INTERNAL_FEATURES]: {
|
|
467
|
+
respectPrefix: false
|
|
468
|
+
}
|
|
466
469
|
});
|
|
467
|
-
matchVariant("group-has", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) &` : `:merge(.group):has(${(0, _dataTypes.normalize)(value)}) &`, {
|
|
468
|
-
values: {}
|
|
470
|
+
matchVariant("group-has", (value, { modifier })=>modifier ? `:merge(${prefix(".group")}\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) &` : `:merge(${prefix(".group")}):has(${(0, _dataTypes.normalize)(value)}) &`, {
|
|
471
|
+
values: {},
|
|
472
|
+
[_setupContextUtils.INTERNAL_FEATURES]: {
|
|
473
|
+
respectPrefix: false
|
|
474
|
+
}
|
|
469
475
|
});
|
|
470
|
-
matchVariant("peer-has", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) ~ &` : `:merge(.peer):has(${(0, _dataTypes.normalize)(value)}) ~ &`, {
|
|
471
|
-
values: {}
|
|
476
|
+
matchVariant("peer-has", (value, { modifier })=>modifier ? `:merge(${prefix(".peer")}\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) ~ &` : `:merge(${prefix(".peer")}):has(${(0, _dataTypes.normalize)(value)}) ~ &`, {
|
|
477
|
+
values: {},
|
|
478
|
+
[_setupContextUtils.INTERNAL_FEATURES]: {
|
|
479
|
+
respectPrefix: false
|
|
480
|
+
}
|
|
472
481
|
});
|
|
473
482
|
},
|
|
474
483
|
ariaVariants: ({ matchVariant , theme })=>{
|
|
@@ -794,7 +803,9 @@ let corePlugins = {
|
|
|
794
803
|
"gridColumnStart"
|
|
795
804
|
]
|
|
796
805
|
]
|
|
797
|
-
]
|
|
806
|
+
], {
|
|
807
|
+
supportsNegativeValues: true
|
|
808
|
+
}),
|
|
798
809
|
gridColumnEnd: (0, _createUtilityPlugin.default)("gridColumnEnd", [
|
|
799
810
|
[
|
|
800
811
|
"col-end",
|
|
@@ -802,7 +813,9 @@ let corePlugins = {
|
|
|
802
813
|
"gridColumnEnd"
|
|
803
814
|
]
|
|
804
815
|
]
|
|
805
|
-
]
|
|
816
|
+
], {
|
|
817
|
+
supportsNegativeValues: true
|
|
818
|
+
}),
|
|
806
819
|
gridRow: (0, _createUtilityPlugin.default)("gridRow", [
|
|
807
820
|
[
|
|
808
821
|
"row",
|
|
@@ -818,7 +831,9 @@ let corePlugins = {
|
|
|
818
831
|
"gridRowStart"
|
|
819
832
|
]
|
|
820
833
|
]
|
|
821
|
-
]
|
|
834
|
+
], {
|
|
835
|
+
supportsNegativeValues: true
|
|
836
|
+
}),
|
|
822
837
|
gridRowEnd: (0, _createUtilityPlugin.default)("gridRowEnd", [
|
|
823
838
|
[
|
|
824
839
|
"row-end",
|
|
@@ -826,7 +841,9 @@ let corePlugins = {
|
|
|
826
841
|
"gridRowEnd"
|
|
827
842
|
]
|
|
828
843
|
]
|
|
829
|
-
]
|
|
844
|
+
], {
|
|
845
|
+
supportsNegativeValues: true
|
|
846
|
+
}),
|
|
830
847
|
float: ({ addUtilities })=>{
|
|
831
848
|
addUtilities({
|
|
832
849
|
".float-start": {
|
|
@@ -3912,7 +3929,7 @@ let corePlugins = {
|
|
|
3912
3929
|
matchUtilities({
|
|
3913
3930
|
blur: (value)=>{
|
|
3914
3931
|
return {
|
|
3915
|
-
"--tw-blur": `blur(${value})`,
|
|
3932
|
+
"--tw-blur": value.trim() === "" ? " " : `blur(${value})`,
|
|
3916
3933
|
"@defaults filter": {},
|
|
3917
3934
|
filter: cssFilterValue
|
|
3918
3935
|
};
|
|
@@ -4052,8 +4069,9 @@ let corePlugins = {
|
|
|
4052
4069
|
matchUtilities({
|
|
4053
4070
|
"backdrop-blur": (value)=>{
|
|
4054
4071
|
return {
|
|
4055
|
-
"--tw-backdrop-blur": `blur(${value})`,
|
|
4072
|
+
"--tw-backdrop-blur": value.trim() === "" ? " " : `blur(${value})`,
|
|
4056
4073
|
"@defaults backdrop-filter": {},
|
|
4074
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4057
4075
|
"backdrop-filter": cssBackdropFilterValue
|
|
4058
4076
|
};
|
|
4059
4077
|
}
|
|
@@ -4067,6 +4085,7 @@ let corePlugins = {
|
|
|
4067
4085
|
return {
|
|
4068
4086
|
"--tw-backdrop-brightness": `brightness(${value})`,
|
|
4069
4087
|
"@defaults backdrop-filter": {},
|
|
4088
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4070
4089
|
"backdrop-filter": cssBackdropFilterValue
|
|
4071
4090
|
};
|
|
4072
4091
|
}
|
|
@@ -4080,6 +4099,7 @@ let corePlugins = {
|
|
|
4080
4099
|
return {
|
|
4081
4100
|
"--tw-backdrop-contrast": `contrast(${value})`,
|
|
4082
4101
|
"@defaults backdrop-filter": {},
|
|
4102
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4083
4103
|
"backdrop-filter": cssBackdropFilterValue
|
|
4084
4104
|
};
|
|
4085
4105
|
}
|
|
@@ -4093,6 +4113,7 @@ let corePlugins = {
|
|
|
4093
4113
|
return {
|
|
4094
4114
|
"--tw-backdrop-grayscale": `grayscale(${value})`,
|
|
4095
4115
|
"@defaults backdrop-filter": {},
|
|
4116
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4096
4117
|
"backdrop-filter": cssBackdropFilterValue
|
|
4097
4118
|
};
|
|
4098
4119
|
}
|
|
@@ -4106,6 +4127,7 @@ let corePlugins = {
|
|
|
4106
4127
|
return {
|
|
4107
4128
|
"--tw-backdrop-hue-rotate": `hue-rotate(${value})`,
|
|
4108
4129
|
"@defaults backdrop-filter": {},
|
|
4130
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4109
4131
|
"backdrop-filter": cssBackdropFilterValue
|
|
4110
4132
|
};
|
|
4111
4133
|
}
|
|
@@ -4120,6 +4142,7 @@ let corePlugins = {
|
|
|
4120
4142
|
return {
|
|
4121
4143
|
"--tw-backdrop-invert": `invert(${value})`,
|
|
4122
4144
|
"@defaults backdrop-filter": {},
|
|
4145
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4123
4146
|
"backdrop-filter": cssBackdropFilterValue
|
|
4124
4147
|
};
|
|
4125
4148
|
}
|
|
@@ -4133,6 +4156,7 @@ let corePlugins = {
|
|
|
4133
4156
|
return {
|
|
4134
4157
|
"--tw-backdrop-opacity": `opacity(${value})`,
|
|
4135
4158
|
"@defaults backdrop-filter": {},
|
|
4159
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4136
4160
|
"backdrop-filter": cssBackdropFilterValue
|
|
4137
4161
|
};
|
|
4138
4162
|
}
|
|
@@ -4146,6 +4170,7 @@ let corePlugins = {
|
|
|
4146
4170
|
return {
|
|
4147
4171
|
"--tw-backdrop-saturate": `saturate(${value})`,
|
|
4148
4172
|
"@defaults backdrop-filter": {},
|
|
4173
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4149
4174
|
"backdrop-filter": cssBackdropFilterValue
|
|
4150
4175
|
};
|
|
4151
4176
|
}
|
|
@@ -4159,6 +4184,7 @@ let corePlugins = {
|
|
|
4159
4184
|
return {
|
|
4160
4185
|
"--tw-backdrop-sepia": `sepia(${value})`,
|
|
4161
4186
|
"@defaults backdrop-filter": {},
|
|
4187
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4162
4188
|
"backdrop-filter": cssBackdropFilterValue
|
|
4163
4189
|
};
|
|
4164
4190
|
}
|
|
@@ -4181,9 +4207,11 @@ let corePlugins = {
|
|
|
4181
4207
|
addUtilities({
|
|
4182
4208
|
".backdrop-filter": {
|
|
4183
4209
|
"@defaults backdrop-filter": {},
|
|
4210
|
+
"-webkit-backdrop-filter": cssBackdropFilterValue,
|
|
4184
4211
|
"backdrop-filter": cssBackdropFilterValue
|
|
4185
4212
|
},
|
|
4186
4213
|
".backdrop-filter-none": {
|
|
4214
|
+
"-webkit-backdrop-filter": "none",
|
|
4187
4215
|
"backdrop-filter": "none"
|
|
4188
4216
|
}
|
|
4189
4217
|
});
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "defaultExtractor", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
|
|
12
|
+
const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly");
|
|
12
13
|
function _getRequireWildcardCache(nodeInterop) {
|
|
13
14
|
if (typeof WeakMap !== "function") return null;
|
|
14
15
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -60,6 +61,27 @@ function defaultExtractor(context) {
|
|
|
60
61
|
results.push(clipAtBalancedParens(result));
|
|
61
62
|
}
|
|
62
63
|
}
|
|
64
|
+
// Extract any subclasses from languages like Slim and Pug, eg:
|
|
65
|
+
// div.flex.px-5.underline
|
|
66
|
+
for (let result of results.slice()){
|
|
67
|
+
let segments = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(result, ".");
|
|
68
|
+
for(let idx = 0; idx < segments.length; idx++){
|
|
69
|
+
let segment = segments[idx];
|
|
70
|
+
if (idx >= segments.length - 1) {
|
|
71
|
+
results.push(segment);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// If the next segment is a number, discard both, for example seeing
|
|
75
|
+
// `px-1` and `5` means the real candidate was `px-1.5` which is already
|
|
76
|
+
// captured.
|
|
77
|
+
let next = parseInt(segments[idx + 1]);
|
|
78
|
+
if (isNaN(next)) {
|
|
79
|
+
results.push(segment);
|
|
80
|
+
} else {
|
|
81
|
+
idx++;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
63
85
|
return results;
|
|
64
86
|
};
|
|
65
87
|
}
|
|
@@ -169,8 +191,6 @@ function* buildRegExps(context) {
|
|
|
169
191
|
utility
|
|
170
192
|
]);
|
|
171
193
|
}
|
|
172
|
-
// 5. Inner matches
|
|
173
|
-
yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
|
|
174
194
|
}
|
|
175
195
|
// We want to capture any "special" characters
|
|
176
196
|
// AND the characters immediately following them (if there is one)
|
package/lib/lib/load-config.js
CHANGED
|
@@ -46,6 +46,10 @@ function lazyJiti() {
|
|
|
46
46
|
}
|
|
47
47
|
function loadConfig(path) {
|
|
48
48
|
let config = function() {
|
|
49
|
+
// Always use jiti for ESM or TS files
|
|
50
|
+
if (path && (path.endsWith(".mjs") || path.endsWith(".ts") || path.endsWith(".cts") || path.endsWith(".mts"))) {
|
|
51
|
+
return lazyJiti()(path);
|
|
52
|
+
}
|
|
49
53
|
try {
|
|
50
54
|
return path ? require(path) : {};
|
|
51
55
|
} catch {
|
package/lib/util/dataTypes.js
CHANGED
|
@@ -77,6 +77,7 @@ function isCSSFunction(value) {
|
|
|
77
77
|
// More info:
|
|
78
78
|
// - https://drafts.csswg.org/scroll-animations/#propdef-timeline-scope
|
|
79
79
|
// - https://developer.mozilla.org/en-US/docs/Web/CSS/timeline-scope#dashed-ident
|
|
80
|
+
// - https://www.w3.org/TR/css-anchor-position-1
|
|
80
81
|
//
|
|
81
82
|
const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([
|
|
82
83
|
// Concrete properties
|
|
@@ -84,10 +85,15 @@ const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([
|
|
|
84
85
|
"timeline-scope",
|
|
85
86
|
"view-timeline-name",
|
|
86
87
|
"font-palette",
|
|
88
|
+
"anchor-name",
|
|
89
|
+
"anchor-scope",
|
|
90
|
+
"position-anchor",
|
|
91
|
+
"position-try-options",
|
|
87
92
|
// Shorthand properties
|
|
88
93
|
"scroll-timeline",
|
|
89
94
|
"animation-timeline",
|
|
90
|
-
"view-timeline"
|
|
95
|
+
"view-timeline",
|
|
96
|
+
"position-try"
|
|
91
97
|
]);
|
|
92
98
|
function normalize(value, context = null, isRoot = true) {
|
|
93
99
|
let isVarException = context && AUTO_VAR_INJECTION_EXCEPTIONS.has(context.property);
|
|
@@ -260,8 +260,7 @@ function normalizeConfig(config) {
|
|
|
260
260
|
let transformers = {};
|
|
261
261
|
if (typeof transform === "function") {
|
|
262
262
|
transformers.DEFAULT = transform;
|
|
263
|
-
}
|
|
264
|
-
if (typeof transform === "object" && transform !== null) {
|
|
263
|
+
} else if (typeof transform === "object" && transform !== null) {
|
|
265
264
|
Object.assign(transformers, transform);
|
|
266
265
|
}
|
|
267
266
|
return transformers;
|
|
@@ -40,7 +40,7 @@ const TIMING_FNS = [
|
|
|
40
40
|
"cubic-bezier",
|
|
41
41
|
"steps"
|
|
42
42
|
];
|
|
43
|
-
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `
|
|
43
|
+
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubic-bezier(a, b, c)` these don't count.
|
|
44
44
|
;
|
|
45
45
|
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
|
|
46
46
|
;
|
package/lib/util/parseGlob.js
CHANGED
package/lib/util/pluginUtils.js
CHANGED
|
@@ -129,7 +129,7 @@ function splitUtilityModifier(modifier) {
|
|
|
129
129
|
function parseColorFormat(value) {
|
|
130
130
|
if (typeof value === "string" && value.includes("<alpha-value>")) {
|
|
131
131
|
let oldValue = value;
|
|
132
|
-
return ({ opacityValue =1 })=>oldValue.replace(
|
|
132
|
+
return ({ opacityValue =1 })=>oldValue.replace(/<alpha-value>/g, opacityValue);
|
|
133
133
|
}
|
|
134
134
|
return value;
|
|
135
135
|
}
|
|
@@ -27,7 +27,9 @@ const defaultConfigFiles = [
|
|
|
27
27
|
"./tailwind.config.js",
|
|
28
28
|
"./tailwind.config.cjs",
|
|
29
29
|
"./tailwind.config.mjs",
|
|
30
|
-
"./tailwind.config.ts"
|
|
30
|
+
"./tailwind.config.ts",
|
|
31
|
+
"./tailwind.config.cts",
|
|
32
|
+
"./tailwind.config.mts"
|
|
31
33
|
];
|
|
32
34
|
function isObject(value) {
|
|
33
35
|
return typeof value === "object" && value !== null;
|
|
@@ -35,11 +35,7 @@ function splitAtTopLevelOnly(input, separator) {
|
|
|
35
35
|
lastPos = idx + separator.length;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
isEscaped = false;
|
|
40
|
-
} else if (char === "\\") {
|
|
41
|
-
isEscaped = true;
|
|
42
|
-
}
|
|
38
|
+
isEscaped = isEscaped ? false : char === "\\";
|
|
43
39
|
if (char === "(" || char === "[" || char === "{") {
|
|
44
40
|
stack.push(char);
|
|
45
41
|
} else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
|