Skip to content

Commit

Permalink
Support fractional viewport sizes for max-width media queries (#1827)
Browse files Browse the repository at this point in the history
* Support fractional viewport sizes

* Create serious-emus-worry.md

* Support fractional viewport sizes for Popover

* Support fractional viewport sizes for Layout

* Create afraid-jars-occur.md
  • Loading branch information
simurai authored Dec 15, 2021
1 parent 8ee1f01 commit 69e1fc5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-jars-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Support fractional viewport sizes for `max-width` media queries
5 changes: 5 additions & 0 deletions .changeset/serious-emus-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Support fractional viewport sizes for the `hide` utilities
6 changes: 3 additions & 3 deletions src/layout/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
--Layout-sidebar-width: #{map-get($sidebar-width, 'sm')};
--Layout-gutter: 16px;

@media (max-width: calc(#{$width-sm} - 1px)) {
@media (max-width: calc(#{$width-sm} - 0.02px)) {
@include flow-as-row;
}

&.Layout--flowRow-until-md {
@media (max-width: calc(#{$width-md} - 1px)) {
@media (max-width: calc(#{$width-md} - 0.02px)) {
@include flow-as-row;
}
}

&.Layout--flowRow-until-lg {
@media (max-width: calc(#{$width-lg} - 1px)) {
@media (max-width: calc(#{$width-lg} - 0.02px)) {
@include flow-as-row;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/popover/popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
// Responsive Popover
// For < md it will show full-width anchored to the bottom

@media (max-width: ($width-md - 1px)) {
@media (max-width: ($width-md - 0.02px)) {
.Popover {
position: fixed;
top: auto !important;
Expand Down
6 changes: 3 additions & 3 deletions src/utilities/visibility-display.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

// Hide utilities for each breakpoint
// Each hide utility only applies to one breakpoint range.
@media (max-width: $width-sm - 1px) {
@media (max-width: $width-sm - 0.02px) {
.hide-sm {
display: none !important;
}
}

@media (min-width: $width-sm) and (max-width: $width-md - 1px) {
@media (min-width: $width-sm) and (max-width: $width-md - 0.02px) {
.hide-md {
display: none !important;
}
}

@media (min-width: $width-md) and (max-width: $width-lg - 1px) {
@media (min-width: $width-md) and (max-width: $width-lg - 0.02px) {
.hide-lg {
display: none !important;
}
Expand Down

0 comments on commit 69e1fc5

Please sign in to comment.