Skip to content

Variable for subtract .02px #41192

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

Open
2 tasks done
illycz opened this issue Jan 30, 2025 · 9 comments · May be fixed by #41195
Open
2 tasks done

Variable for subtract .02px #41192

illycz opened this issue Jan 30, 2025 · 9 comments · May be fixed by #41195

Comments

@illycz
Copy link

illycz commented Jan 30, 2025

Prerequisites

Proposal

Switching px to em for media queries.

Motivation and context

When I want to switch units from px to em, I will also need convert 0.02 (for px) to 0.00125 (for em) in breakpoint-max function which is now hardcoded.

What do you think?

@illycz illycz added the feature label Jan 30, 2025
@julien-deramond
Copy link
Member

Just to be sure to understand the request, you'd like a new Sass variable set to .02 so you can override it on your side, instead of the following?

@return if($max and $max > 0, $max - .02, null);

@illycz
Copy link
Author

illycz commented Jan 30, 2025

Yes, exactly.

@julien-deramond julien-deramond moved this to Needs review in v5.4.0 Jan 30, 2025
@julien-deramond julien-deramond linked a pull request Jan 30, 2025 that will close this issue
4 tasks
@julien-deramond
Copy link
Member

I don’t mind making it customizable via a Sass variable. I’ve proposed a solution in #41195—let’s see what the other core team members think! 🙂

@mdo
Copy link
Member

mdo commented Jan 31, 2025

Do we still need this at all? Feel like #41046 was hinting at not needing it.

@illycz
Copy link
Author

illycz commented Feb 1, 2025

@mdo Yes, I know about that, but it's planned for v6.

@julien-deramond
Copy link
Member

Do we still need this at all?

Probably not. This could just be a temporary workaround for v5, and it could be removed entirely in v6. 🤷

@voltaek
Copy link
Contributor

voltaek commented Mar 24, 2025

Do we still need this at all?

Probably not. This could just be a temporary workaround for v5, and it could be removed entirely in v6. 🤷

This was actually a workaround for a Safari rounding bug that was an issue starting in v4: 4.0.0-beta.3 - breakpoints are broken in Safari with new support for fractional viewport widths.

Comments on the WebKit bug report linked in there appear to indicate the bug was fixes as of Safari 15-ish, but I haven't done any testing to confirm that.

@mdo
Copy link
Member

mdo commented Apr 11, 2025

We support Safari 12 unfortunately in v5, but @julien-deramond and I have been talking about making a change there in a v5.4.0 release or so that could bridge v5 and v6 in some way. Could be possible to remove it outright with that in mind.

Otherwise, I'm fine shipping a thing just to ignore it in v6 hah.

@mdo
Copy link
Member

mdo commented Apr 11, 2025

Slapping a new label on this and some other stuff—revisit browserslist—to collect a few things that could benefit from what I mentioned above by bumping browser support even a smidge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants