bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Variable for subtract .02px

Open illycz opened this issue 10 months ago • 9 comments

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 avatar Jan 30 '25 11:01 illycz

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

julien-deramond avatar Jan 30 '25 12:01 julien-deramond

Yes, exactly.

illycz avatar Jan 30 '25 13:01 illycz

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! 🙂

julien-deramond avatar Jan 30 '25 15:01 julien-deramond

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

mdo avatar Jan 31 '25 21:01 mdo

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

illycz avatar Feb 01 '25 14:02 illycz

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. 🤷

julien-deramond avatar Feb 06 '25 21:02 julien-deramond

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.

voltaek avatar Mar 24 '25 13:03 voltaek

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 avatar Apr 11 '25 04:04 mdo

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.

mdo avatar Apr 11 '25 04:04 mdo