tailwindcss/packages
Robin Malfait 8bbdb57457
CSS codemod: ensure we don't lose selectors (#14518)
This PR fixes an issue where a CSS rule with a selector that contains
multiple selectors lost everything but the last selector.

While testing the `npx @tailwindcss/upgrade` codemods on real world
projects, I noticed that we lost one of the selectors in the
`docker/docs` repository.

```diff
diff --git a/assets/css/toc.css b/assets/css/toc.css
index 91ff92d7cd..3b2432e913 100644
--- a/assets/css/toc.css
+++ b/assets/css/toc.css
@@ -2,7 +2,7 @@
   #TableOfContents {
     .toc a {
       @apply block max-w-full truncate py-1 pl-2 hover:font-medium hover:no-underline;
-      &[aria-current="true"],
+      
       &:hover {
         @apply border-l-2 border-l-gray-light bg-gradient-to-r from-gray-light-100 font-medium text-black dark:border-l-gray-dark dark:from-gray-dark-200 dark:text-white;
       }
```

This PR fixes the issue by not overriding the `node.selector` internally
with the last selector we handled. Instead, we let the selector parser
handle it entirely.
2024-09-25 18:39:00 +02:00
..
@tailwindcss-cli Release v4.0.0-alpha.25 (#14507) 2024-09-24 17:03:00 +00:00
@tailwindcss-node Add setup for template migrations (#14502) 2024-09-25 16:20:14 +02:00
@tailwindcss-postcss Release v4.0.0-alpha.25 (#14507) 2024-09-24 17:03:00 +00:00
@tailwindcss-standalone Release v4.0.0-alpha.25 (#14507) 2024-09-24 17:03:00 +00:00
@tailwindcss-upgrade CSS codemod: ensure we don't lose selectors (#14518) 2024-09-25 18:39:00 +02:00
@tailwindcss-vite Release v4.0.0-alpha.25 (#14507) 2024-09-24 17:03:00 +00:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Add setup for template migrations (#14502) 2024-09-25 16:20:14 +02:00
tsconfig.base.json introduce v4 codebase 2024-03-05 14:29:15 +01:00