tailwindcss/packages
Robin Malfait 67c745efde
Fix bug in attribute selector parsing (#20303)
This PR fixes a bug in the selector parser where an attribute selector
followed by a type selector inside a compound selector resulted in the
wrong result.

Given you have this CSS:
```css
[data-foo]div {}
```

Then parsing it before this PR, would result in:
```ts
{
  kind: 'compound',
  nodes: [
    { kind: 'selector', value: '[data-foo]div' },
  ],
},
```

But with this PR, it's properly split:
```ts
{
  kind: 'compound',
  nodes: [
    { kind: 'selector', value: '[data-foo]' },
    { kind: 'selector', value: 'div' },
  ],
},
```

I also tweaked some of the comments in the parser that are unrelated,
but I was there already.

## Test plan

1. Added a regression test
2. All other tests should pass
2026-07-03 21:13:13 +02:00
..
@tailwindcss-browser 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-cli Add --poll option to @tailwindcss/cli (#20297) 2026-07-01 21:25:26 +02:00
@tailwindcss-node 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-postcss fix: exclude iframes from focus-visible auto outline in Preflight (#20292) 2026-07-02 10:39:28 +00:00
@tailwindcss-standalone Bump dependencies (#20300) 2026-07-02 11:45:49 +02:00
@tailwindcss-upgrade 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-vite 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-webpack 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Fix bug in attribute selector parsing (#20303) 2026-07-03 21:13:13 +02:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00