]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
stub out flexbox grid variation via -flex
authorMark Otto <markdotto@gmail.com>
Mon, 27 Apr 2015 08:43:14 +0000 (01:43 -0700)
committerMark Otto <markdotto@gmail.com>
Mon, 27 Apr 2015 08:43:14 +0000 (01:43 -0700)
scss/_grid.scss
scss/_variables.scss
scss/mixins/_grid-framework.scss
scss/mixins/_grid.scss

index ed9f232af04d4cffe496e07dfddd5605b7d78b23..5a165a75a62ef9fdd570368e24a81429dccbc311 100644 (file)
 
 @include make-grid-columns();
 
+// Flex column reordering
+@if $enable-flex {
+  .col-xs-first { order: -1; }
+  .col-xs-last { order: 1; }
+
+  @include media-breakpoint-up(sm) {
+    .col-sm-first { order: -1; }
+    .col-sm-last { order: 1; }
+  }
+
+  @include media-breakpoint-up(md) {
+    .col-md-first { order: -1; }
+    .col-md-last { order: 1; }
+  }
+
+  @include media-breakpoint-up(lg) {
+    .col-lg-first { order: -1; }
+    .col-lg-last { order: 1; }
+  }
+
+  @include media-breakpoint-up(xl) {
+    .col-xl-first { order: -1; }
+    .col-xl-last { order: 1; }
+  }
+}
index b4479386e16208d72e8e7c44963ffd45d0958dd3..35a8982160377fc9006036773ec8128ae64d6d3b 100644 (file)
@@ -37,6 +37,7 @@ $link-hover-decoration:      underline !default;
 //
 // Quickly modify global styling by enabling or disabling features.
 
+$enable-flex:                true !default;
 $enable-rounded:             true !default;
 $enable-shadows:             false !default;
 $enable-gradients:           false !default;
index 32705025e067073c77d928b77d1a47ac601bb292..ad2060cbf6ee320ffbee64249972329ec4ed0f39 100644 (file)
     @include media-breakpoint-up($breakpoint) {
       // Work around cross-media @extend (https://github.com/sass/sass/issues/1050)
       %grid-column-float-#{$breakpoint} {
-        float: left;
+        @if $enable-flex {
+          // Do nothing
+        } @else {
+          float: left;
+        }
       }
       @for $i from 1 through $columns {
         .col-#{$breakpoint}-#{$i} {
index 29af269aacdd22f2d9cae0a0335edc0fe48ec7c0..17998affb18ee00f3276c0793883623ad9262983 100644 (file)
 }
 
 @mixin make-row($gutter: $grid-gutter-width) {
+  @if $enable-flex {
+    display: flex;
+    flex-wrap: wrap;
+  }
   margin-left:  ($gutter / -2);
   margin-right: ($gutter / -2);
   @include clearfix();
 
 @mixin make-col($gutter: $grid-gutter-width) {
   position: relative;
-  float: left;
+  @if $enable-flex {
+    // Do nothing
+  } @else {
+    float: left;
+  }
   min-height: 1px;
   padding-left:  ($gutter / 2);
   padding-right: ($gutter / 2);
 }
 
 @mixin make-col-span($size, $columns: $grid-columns) {
-  width: percentage($size / $columns);
+  @if $enable-flex {
+    flex: 0 0 percentage($size / $columns);
+  } @else {
+    width: percentage($size / $columns);
+  }
 }
 
 @mixin make-col-offset($size, $columns: $grid-columns) {