No description
This PR improves the canonicalization around arbitrary variants containing `[&:has(…)]`, by converting them to `has-[…]`. Essentially when you have a variant, with `&:has(…)`, we will convert it: ```diff - [&:has([role=checkbox])]:flex + has-[[role=checkbox]]:flex ``` This also means that if the arbitrary selector inside of the `&:has(…)` can be converted to something that aligns with known variants, then we will do that as well: ```diff // `data-*` can be hoisted outside of the arbitrary value - [&:has([data-slot=description])]:flex + has-data-[slot=description]:flex // `aria-visible="true"` can be entirely replaced by `aria-visible` - [&:has([aria-visible="true"])]:flex + has-aria-visible:flex ``` Noticed this while looking into: https://github.com/tailwindlabs/tailwindcss-intellisense/issues/1562 ## Test plan 1. Added additional tests for this use case 2. Existing tests still pass |
||
|---|---|---|
| .github | ||
| crates | ||
| integrations | ||
| packages | ||
| patches | ||
| playgrounds | ||
| scripts | ||
| .gitignore | ||
| .prettierignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| rust-toolchain.toml | ||
| turbo.json | ||
| vitest.config.ts | ||
A utility-first CSS framework for rapidly building custom user interfaces.
Documentation
For full documentation, visit tailwindcss.com.
Community
For help, discussion about best practices, or feature ideas:
Discuss Tailwind CSS on GitHub
Contributing
If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.