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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fractional viewport sizes for max-width media queries #1827

Merged
merged 6 commits into from
Dec 15, 2021

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Dec 14, 2021

What are you trying to accomplish?

This came up in #1737 (comment) and adds support for "fractional viewport sizes" where we use max-width media queries. Like for the hide utilities.

What approach did you choose and why?

Using - 0.02px instead of - 1px should add better support for hi-dpi screens or zooming. From https://www.w3.org/TR/mediaqueries-4/#mq-min-max

the possibility of fractional viewport sizes which can occur as a result of non-integer pixel densities (e.g. on high-dpi displays or as a result of zooming/scaling)

In case you're wondering why - 0.02px and not - 0.01px:

// Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.
// See https://bugs.webkit.org/show_bug.cgi?id=178261

What should reviewers focus on?

Should this rather be a variable? How should we call it?

Are additional changes needed?

  • No, this PR should be ok to ship as is. 馃殺

@simurai simurai requested a review from a team as a code owner December 14, 2021 02:39
@changeset-bot
Copy link

changeset-bot bot commented Dec 14, 2021

馃 Changeset detected

Latest commit: df025fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simurai simurai changed the title Support fractional viewport sizes for the hide utilities Support fractional viewport sizes for max-width media queries Dec 15, 2021
@simurai simurai enabled auto-merge (squash) December 15, 2021 12:08
@simurai simurai merged commit 69e1fc5 into main Dec 15, 2021
@simurai simurai deleted the hide-utilities branch December 15, 2021 12:10
@primer-css primer-css mentioned this pull request Dec 15, 2021
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.

None yet

2 participants