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

off-by-one error for breakpoint mixins using max-width #5782

Closed
1 of 2 tasks
wkeese opened this issue Apr 1, 2020 · 0 comments · Fixed by #5791
Closed
1 of 2 tasks

off-by-one error for breakpoint mixins using max-width #5782

wkeese opened this issue Apr 1, 2020 · 0 comments · Fixed by #5791

Comments

@wkeese
Copy link
Contributor

wkeese commented Apr 1, 2020

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Looking at https://github.com/carbon-design-system/carbon/blob/master/packages/layout/scss/_breakpoint.scss, using a mixin like

@carbon--breakpoint-down(lg)

will generate CSS like below (or the equivalent in rem):

@media (max-width: 1056px) { ... }

IIUC, that means width <= 1056px, whereas what we want is width < 1056px. I.E. a query that doesn't match when width === 1056px.

Maybe it should be generating @media not (min-width: 1056px) instead?

Or by using media queries level 4 (not sure if that works for all browsers that carbon supports), generate:

@media (width < 1056) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants