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

Add support for fractional viewport widths (zoom/high-dpi displays) #24299

Merged
merged 9 commits into from
Nov 20, 2017
2 changes: 1 addition & 1 deletion docs/4.0/content/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ Regular table background variants are not available with the dark table, however

## Responsive tables

Create responsive tables by adding `.table-responsive{-sm|-md|-lg|-xl}` to any `.table` to make them scroll horizontally at each `max-width` breakpoint 575px, 767px, 991px, and 1199px, respectively.
Create responsive tables by adding `.table-responsive{-sm|-md|-lg|-xl}` to any `.table` to make them scroll horizontally at each `max-width` breakpoint just below 576px, 768px, 992px, and 1200px, respectively.

For responsive tables that always scroll horizontally when the table is wider than its container, add the `.table-responsive` class on `.table`.

Expand Down
2 changes: 1 addition & 1 deletion docs/4.0/examples/offcanvas/offcanvas.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ footer {
* Off Canvas
* --------------------------------------------------
*/
@media screen and (max-width: 767px) {
@media screen and (max-width: 767.99px) {
.row-offcanvas {
position: relative;
transition: all .25s ease-out;
Expand Down
18 changes: 9 additions & 9 deletions docs/4.0/layout/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ We occasionally use media queries that go in the other direction (the given scre

{% highlight scss %}
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575px) { ... }
@media (max-width: 575.99px) { ... }

// Small devices (landscape phones, less than 768px)
@media (max-width: 767px) { ... }
@media (max-width: 767.99px) { ... }

// Medium devices (tablets, less than 992px)
@media (max-width: 991px) { ... }
@media (max-width: 991.99px) { ... }

// Large devices (desktops, less than 1200px)
@media (max-width: 1199px) { ... }
@media (max-width: 1199.99px) { ... }

// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
Expand All @@ -116,16 +116,16 @@ There are also media queries and mixins for targeting a single segment of screen

{% highlight scss %}
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575px) { ... }
@media (max-width: 575.99px) { ... }

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767px) { ... }
@media (min-width: 576px) and (max-width: 767.99px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991px) { ... }
@media (min-width: 768px) and (max-width: 991.99px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199px) { ... }
@media (min-width: 992px) and (max-width: 1199.99px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Expand All @@ -146,7 +146,7 @@ Similarly, media queries may span multiple breakpoint widths:
{% highlight scss %}
// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199px) { ... }
@media (min-width: 768px) and (max-width: 1199.99px) { ... }
{% endhighlight %}

The Sass mixin for targeting the same screen size range would be:
Expand Down
4 changes: 2 additions & 2 deletions scss/mixins/_breakpoints.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
}

// Maximum breakpoint width. Null for the largest (last) breakpoint.
// The maximum value is calculated as the minimum of the next one less 0.1.
// The maximum value is calculated as the minimum of the next one less 0.01px.
//
// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// 767px
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
$next: breakpoint-next($name, $breakpoints);
@return if($next, breakpoint-min($next, $breakpoints) - 1px, null);
@return if($next, breakpoint-min($next, $breakpoints) - .01px, null);
}

// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.
Expand Down