aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2014-12-29 13:37:20 -0800
committerChris Rebert <[email protected]>2015-01-06 17:47:13 -0800
commit746e09f8ae5b6601db5e965cd71c632b4e42827a (patch)
tree03ad850d7f259e1ee4272f88dfd14f69e2f7fa52
parentff9c07f4aa74f64372438ba90f0357c2a21abfe1 (diff)
downloadbootstrap-746e09f8ae5b6601db5e965cd71c632b4e42827a.tar.xz
bootstrap-746e09f8ae5b6601db5e965cd71c632b4e42827a.zip
rename media-breakpoint-{min,max} => media-breakpoint-{up,down}
-rw-r--r--scss/_grid.scss2
-rw-r--r--scss/mixins/_breakpoints.scss11
-rw-r--r--scss/mixins/_grid-framework.scss2
-rw-r--r--scss/mixins/_media-queries.scss8
4 files changed, 13 insertions, 10 deletions
diff --git a/scss/_grid.scss b/scss/_grid.scss
index 1129cff6d..ed9f232af 100644
--- a/scss/_grid.scss
+++ b/scss/_grid.scss
@@ -12,7 +12,7 @@
// For each breakpoint, define the maximum width of the container in a media query
@each $breakpoint, $container-max-width in $container-max-widths {
- @include media-breakpoint-min($breakpoint) {
+ @include media-breakpoint-up($breakpoint) {
max-width: $container-max-width;
}
}
diff --git a/scss/mixins/_breakpoints.scss b/scss/mixins/_breakpoints.scss
index 71a15cd04..232b9416f 100644
--- a/scss/mixins/_breakpoints.scss
+++ b/scss/mixins/_breakpoints.scss
@@ -39,7 +39,8 @@
}
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
-@mixin media-breakpoint-min($name, $breakpoints: $grid-breakpoints) {
+// Makes the @content apply to the given breakpoint and wider.
+@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
$min: breakpoint-min($name, $breakpoints);
@if $min {
@media (min-width: $min) {
@@ -51,7 +52,8 @@
}
// Media of at most the maximum breakpoint width. No query for the largest breakpoint.
-@mixin media-breakpoint-max($name, $breakpoints: $grid-breakpoints) {
+// Makes the @content apply to the given breakpoint and narrower.
+@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
$max: breakpoint-max($name, $breakpoints);
@if $max {
@media (max-width: $max) {
@@ -64,6 +66,7 @@
// Media between the breakpoint's minimum and maximum widths.
// No minimum for the smallest breakpoint, and no maximum for the largest one.
+// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
// Nested media query combination does not work in libsass yet
// https://github.com/sass/libsass/issues/185
@@ -76,8 +79,8 @@
}
} @else {
// One of min or max is a no-op, so this branch is not affected by libsass#185
- @include media-breakpoint-min($name, $breakpoints) {
- @include media-breakpoint-max($name, $breakpoints) {
+ @include media-breakpoint-up($name, $breakpoints) {
+ @include media-breakpoint-down($name, $breakpoints) {
@content;
}
}
diff --git a/scss/mixins/_grid-framework.scss b/scss/mixins/_grid-framework.scss
index 0d346db57..32705025e 100644
--- a/scss/mixins/_grid-framework.scss
+++ b/scss/mixins/_grid-framework.scss
@@ -19,7 +19,7 @@
@extend %grid-column;
}
}
- @include media-breakpoint-min($breakpoint) {
+ @include media-breakpoint-up($breakpoint) {
// Work around cross-media @extend (https://github.com/sass/sass/issues/1050)
%grid-column-float-#{$breakpoint} {
float: left;
diff --git a/scss/mixins/_media-queries.scss b/scss/mixins/_media-queries.scss
index 28130d2e7..99594e505 100644
--- a/scss/mixins/_media-queries.scss
+++ b/scss/mixins/_media-queries.scss
@@ -1,11 +1,11 @@
// Media query mixins for default breakpoints
@mixin media-xs() {
- @include media-breakpoint-max(xs) { @content }
+ @include media-breakpoint-down(xs) { @content }
}
@mixin media-sm() {
- @include media-breakpoint-min(sm) { @content }
+ @include media-breakpoint-up(sm) { @content }
}
@mixin media-sm-max() {
@@ -13,7 +13,7 @@
}
@mixin media-md() {
- @include media-breakpoint-min(md) { @content }
+ @include media-breakpoint-up(md) { @content }
}
@mixin media-md-max() {
@@ -21,5 +21,5 @@
}
@mixin media-lg() {
- @include media-breakpoint-min(lg) { @content }
+ @include media-breakpoint-up(lg) { @content }
}