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

fix(preset-mini)!: fix pseudo variants generation order, close #2713 #2714

Merged
merged 5 commits into from Jun 4, 2023

Conversation

antfu
Copy link
Member

@antfu antfu commented Jun 3, 2023

fix #2713

  • Add sort based on the order of variants list
  • Disable CSS merge for pseudo variants
  • Align the list order of Tailwind

@netlify
Copy link

netlify bot commented Jun 3, 2023

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit 0f1c0f0
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/647c71420e4a0e000709bea9
😎 Deploy Preview https://deploy-preview-2714--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@sibbng sibbng left a 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:

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.

@antfu antfu changed the title fix(preset-mini): fix pseudo variants generation order, close #2713 fix(preset-mini)!: fix pseudo variants generation order, close #2713 Jun 4, 2023
@antfu antfu merged commit 5c68112 into main Jun 4, 2023
10 checks passed
@antfu antfu deleted the fix/pseudo-order branch June 4, 2023 12:36
BalbinaK added a commit to warp-ds/drive that referenced this pull request Aug 16, 2023
[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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover being triggered when disabled even with specified disabled: variants
2 participants