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): remove num === 0 in px handler to fix offset utility issues #3271

Merged
merged 2 commits into from Nov 2, 2023

Conversation

henrikvilhelmberglund
Copy link
Contributor

This PR removes a num === 0 check in the px handler which returned 0 which broke a bunch of offset-utilities (ring-offset-0, underline-offset-0). This means it returns 0px now and these utilities work again.

The num === 0 check is still there for the rem handler so inset-0 still gives a 0 result. (I'm not sure why this is better than 0px though)

It's possible there's a better way to fix this, in that case feel free to close this PR.

fixes #3196

@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 96041c7
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/6537ca81cdf06b0009f0a862
😎 Deploy Preview https://deploy-preview-3271--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 configuration.

@zyyv
Copy link
Member

zyyv commented Oct 24, 2023

The num === 0 check is still there for the rem handler so inset-0 still gives a 0 result. (I'm not sure why this is better than 0px though)

Cause #2153 changes to produce this issue that i'm not consided it. And thanks for your feedback, I'll consider if there's a better way to fix it or revert it.

@henrikvilhelmberglund
Copy link
Contributor Author

henrikvilhelmberglund commented Oct 24, 2023

A fun(?) thing I noticed is that decoration-offset-0 in UnoCSS seems broken in Chrome/Brave, I get something like this. Very strange...
image
edit: this seems caused by a missing text-underline-position: from-font; see https://bugs.chromium.org/p/chromium/issues/detail?id=1172623

@henrikvilhelmberglund
Copy link
Contributor Author

The num === 0 check is still there for the rem handler so inset-0 still gives a 0 result. (I'm not sure why this is better than 0px though)

Cause #2153 changes to produce this issue that i'm not consided it. And thanks for your feedback, I'll consider if there's a better way to fix it or revert it.

Do you want to merge it like this or did you have some other solution in mind?

@antfu antfu merged commit 0890f59 into unocss:main Nov 2, 2023
9 checks passed
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.

ring-offset-0 missing unit
3 participants