Variable for subtract .02px
Prerequisites
- [x] I have searched for duplicate or closed feature requests
- [x] I have read the contributing guidelines
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?
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?
https://github.com/twbs/bootstrap/blob/5708adc816b9a6b07fb2b4f07c3b562935bd0a54/scss/mixins/_breakpoints.scss#L45
Yes, exactly.
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! 🙂
Do we still need this at all? Feel like #41046 was hinting at not needing it.
@mdo Yes, I know about that, but it's planned for v6.
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. 🤷
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.
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.
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.