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
fix(preset-mini)!: fix pseudo variants generation order, close #2713 #2714
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not need the sort
option here:
unocss/packages/preset-mini/src/_variants/pseudo.ts
Lines 81 to 95 in 5c9fc99
function pseudoModifier(pseudo: string) { | |
if (pseudo === 'focus') { | |
return { | |
sort: 10, | |
noMerge: true, | |
} | |
} | |
if (pseudo === 'active') { | |
return { | |
sort: 20, | |
noMerge: true, | |
} | |
} | |
} |
Since the sort
value varies based on the pseudo's index in the array now, this is not safe to do anymore.
But, I would suggest keeping the noMerge
option here or we could disable merging for pseudos in general. In #1973 I explained why merging could be so dangerous.
[in this unocss PR](unocss/unocss#2714) pseudo variants generation order changes. That causes changes to css order for classes that control the same CSS properties, which results in bugs in our components (e.g. Button disabled). Before we update this package, we should change the way we assign utility classes to components when they control the same CSS properties.
fix #2713
sort
based on the order of variants list