You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sort a class with a pseudo-class variant, such as hover:bg-w, by its own
position in the CSS file in --output-css-file and --vite-css. It no longer
goes in the variant group after the known classes.
Read hand-written CSS with the same rule. .card .title { now registers title. It registered card before. .btn:hover { now registers btn. It
registered btn:hover before.
Fixed
Read the class order in --output-css-file and --vite-css with a CSS scan
instead of a line regex. The scan finds the classes of rules that do not start
with .class {, such as :where(.divide-y > :not(:last-child)) {, and of
selectors that end in a pseudo-class, such as .hover\:bg-well:hover {.
Tailwind CSS 4.3.3 and later emit these flat rules in unminified output, #167, #168, thanks @NoobInTheNet
Decode the JSON string that Vite puts around the CSS (the output of JSON.stringify) in --vite-css before reading the class order. The line
regex read only the first rule of that one-line text.
Decode hexadecimal CSS escapes in the class names. .\32xl\:block now gives 2xl:block. It gave 32xl:block before.
Read a rule written without a space before {, such as .a{. The line regex
skipped it.
Breaking changes
In --output-css-file and --vite-css, classes that the CSS file does not
define now come first, in their input order, as in the built-in sorter and in prettier-plugin-tailwindcss. They came last before. The placeholders ...
and … now go last. The output of these options changes, so --check-formatted reports files with custom classes after the upgrade, until
you run --write. A class such as hover:flex that the CSS does not define,
but whose part after the first built-in variant prefix it does, goes after
the defined classes, #169, thanks @NoobInTheNet