tailwindcss 3.4.5 → 3.4.6

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 CHANGED
@@ -9,6 +9,16 @@ 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.6] - 2024-07-16
13
+
14
+ ### Fixed
15
+
16
+ - Fix detection of some utilities in Slim/Pug templates ([#14006](https://github.com/tailwindlabs/tailwindcss/pull/14006))
17
+
18
+ ### Changed
19
+
20
+ - Loosen `:is()` wrapping rules when using an important selector ([#13900](https://github.com/tailwindlabs/tailwindcss/pull/13900))
21
+
12
22
  ## [3.4.5] - 2024-07-15
13
23
 
14
24
  ### Fixed
@@ -2395,7 +2405,8 @@ No release notes
2395
2405
 
2396
2406
  - Everything!
2397
2407
 
2398
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.5...HEAD
2408
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.6...HEAD
2409
+ [3.4.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.5...v3.4.6
2399
2410
  [3.4.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.4...v3.4.5
2400
2411
  [3.4.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.3...v3.4.4
2401
2412
  [3.4.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.2...v3.4.3
@@ -74,7 +74,7 @@ function defaultExtractor(context) {
74
74
  // If the next segment is a number, discard both, for example seeing
75
75
  // `px-1` and `5` means the real candidate was `px-1.5` which is already
76
76
  // captured.
77
- let next = parseInt(segments[idx + 1]);
77
+ let next = Number(segments[idx + 1]);
78
78
  if (isNaN(next)) {
79
79
  results.push(segment);
80
80
  } else {
@@ -18,9 +18,11 @@ function _interop_require_default(obj) {
18
18
  function applyImportantSelector(selector, important) {
19
19
  let sel = (0, _postcssselectorparser.default)().astSync(selector);
20
20
  sel.each((sel)=>{
21
- // Wrap with :is if it's not already wrapped
22
- let isWrapped = sel.nodes[0].type === "pseudo" && sel.nodes[0].value === ":is" && sel.nodes.every((node)=>node.type !== "combinator");
23
- if (!isWrapped) {
21
+ // For nesting, we only need to wrap a selector with :is() if it has a top-level combinator,
22
+ // e.g. `.dark .text-white`, to be independent of DOM order. Any other selector, including
23
+ // combinators inside of pseudos like `:where()`, are ok to nest.
24
+ let shouldWrap = sel.nodes.some((node)=>node.type === "combinator");
25
+ if (shouldWrap) {
24
26
  sel.nodes = [
25
27
  _postcssselectorparser.default.pseudo({
26
28
  value: ":is",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -32,7 +32,7 @@ export function defaultExtractor(context) {
32
32
  // If the next segment is a number, discard both, for example seeing
33
33
  // `px-1` and `5` means the real candidate was `px-1.5` which is already
34
34
  // captured.
35
- let next = parseInt(segments[idx + 1])
35
+ let next = Number(segments[idx + 1])
36
36
  if (isNaN(next)) {
37
37
  results.push(segment)
38
38
  } else {
@@ -5,13 +5,12 @@ export function applyImportantSelector(selector, important) {
5
5
  let sel = parser().astSync(selector)
6
6
 
7
7
  sel.each((sel) => {
8
- // Wrap with :is if it's not already wrapped
9
- let isWrapped =
10
- sel.nodes[0].type === 'pseudo' &&
11
- sel.nodes[0].value === ':is' &&
12
- sel.nodes.every((node) => node.type !== 'combinator')
8
+ // For nesting, we only need to wrap a selector with :is() if it has a top-level combinator,
9
+ // e.g. `.dark .text-white`, to be independent of DOM order. Any other selector, including
10
+ // combinators inside of pseudos like `:where()`, are ok to nest.
11
+ let shouldWrap = sel.nodes.some((node) => node.type === 'combinator')
13
12
 
14
- if (!isWrapped) {
13
+ if (shouldWrap) {
15
14
  sel.nodes = [
16
15
  parser.pseudo({
17
16
  value: ':is',