Skip to content

Commit

Permalink
feat(grid): update breakpoint-down with correct max width (#5791)
Browse files Browse the repository at this point in the history
Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
joshblack and tw15egan authored Apr 6, 2020
1 parent 7a2831f commit 033ba77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/layout/scss/_breakpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ $carbon--grid-breakpoints: (
@content;
}
} @else if map-has-key($breakpoints, $name) {
// We borrow this logic from bootstrap for specifying the value of the
// max-width. The maximum width is calculated by finding the breakpoint and
// subtracting .02 from its value. This value is used instead of .01 to
// avoid rounding issues in Safari
// https://github.com/twbs/bootstrap/blob/c5b1919deaf5393fcca9e9b9d7ce9c338160d99d/scss/mixins/_breakpoints.scss#L34-L46
$breakpoint: map-get($breakpoints, $name);
$width: map-get($breakpoint, width);
$width: map-get($breakpoint, width) - 0.02;
@media (max-width: $width) {
@content;
}
Expand Down

0 comments on commit 033ba77

Please sign in to comment.