Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always sort candidates #10382

Merged
merged 2 commits into from Jan 21, 2023
Merged

Always sort candidates #10382

merged 2 commits into from Jan 21, 2023

Conversation

adamwathan
Copy link
Member

The generated CSS order in Tailwind is not deterministic and depends on the order that Tailwind scans your template files, so if one machine happens to look at User.jsx first and another looks at Navbar.jsx first, some things in the CSS file might be in a slightly different order even if nothing in the project has actually changed.

Prior to this PR we would sort class candidates when running in a test environment to ensure identical output between our stable engine and new Rust engine for testing purposes. We didn't do this for real builds because sorting the class names detected in templates introduces a small performance penalty and doesn't impact the behavior of the final CSS, because we already sort the CSS to the degree it's actually necessary, for example ensuring all px-* utilities come before pl-*.

With this PR, we always sort the candidates, which ensures deterministic output across different systems.

Resolves #10378.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order of CSS selectors is inconsistent each time the same build is run with Vite
1 participant