]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Iterate over breakpoints to generate .navbar-toggleable classes
authorMark Otto <markdotto@gmail.com>
Mon, 17 Oct 2016 04:51:26 +0000 (21:51 -0700)
committerMark Otto <markdotto@gmail.com>
Mon, 17 Oct 2016 04:51:26 +0000 (21:51 -0700)
- Moves .navbar-brand margin and float to media queries
- Replaces the static media queries with an each loop to generate all the needed classes

scss/_navbar.scss

index def526fdd1f758cb9b8a5c354b41a332304dbeba..2d504cbc49233a560f5296da77676614fd2808e1 100644 (file)
 //
 
 .navbar-brand {
-  float: left;
+  display: block;
   padding-top:    $navbar-brand-padding-y;
   padding-bottom: $navbar-brand-padding-y;
-  margin-right: 1rem;
   font-size: $font-size-lg;
 
   @include hover-focus {
 }
 
 // scss-lint:disable ImportantRule
-// Custom override for
 .navbar-toggleable {
-  &-xs {
-    @include clearfix;
-    @include media-breakpoint-up(sm) {
-      display: block !important;
-    }
-  }
-  &-sm {
-    @include clearfix;
-    @include media-breakpoint-up(md) {
-      display: block !important;
-    }
-  }
-  &-md {
-    @include clearfix;
-    @include media-breakpoint-up(lg) {
-      display: block !important;
+  @each $breakpoint in map-keys($grid-breakpoints) {
+    &-#{$breakpoint} {
+      @include clearfix;
+      @include media-breakpoint-up($breakpoint) {
+        display: block !important;
+
+        .navbar-brand {
+          float: left;
+          margin-right: 1rem;
+        }
+      }
     }
   }
 }