]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
flexbox powered indicators
authorMark Otto <markdotto@gmail.com>
Thu, 22 Dec 2016 22:31:33 +0000 (14:31 -0800)
committerMark Otto <markd.otto@gmail.com>
Thu, 22 Dec 2016 22:58:40 +0000 (14:58 -0800)
This revamps the indicators to use flexbox instead of inline-block for added flexbility (hah). Indicators now automatically scale based on the number of elements present, and max out at the `$carousel-indicator-width` instead of always being that wide.

scss/_carousel.scss
scss/_variables.scss

index 01ad613e0ff3062765419b639a281f08fa537b2d..18286b539fdc82f5f8591ad68aee1f3109170893 100644 (file)
   bottom: 10px;
   left: 0;
   z-index: 15;
+  display: flex;
+  justify-content: center;
   padding-left: 0; // override <ul> default
   // Use the .carousel-control's width as margin so we don't overlay those
   margin-right: $carousel-control-width;
 
   li {
     position: relative;
-    display: inline-block;
-    width: $carousel-indicator-width;
+    flex: 1 0 auto;
+    max-width: $carousel-indicator-width;
     height: $carousel-indicator-height;
+    margin-right: $carousel-indicator-spacer;
+    margin-left: $carousel-indicator-spacer;
     text-indent: -999px;
     cursor: pointer;
     background-color: rgba($carousel-indicator-active-bg, .5);
index b76064d96758dd5b988fbb15c64ab6f01b0650b9..e12ccd149cbb44b46e74855e7bade810e81089d9 100644 (file)
@@ -912,6 +912,7 @@ $carousel-control-opacity:                    .5 !default;
 
 $carousel-indicator-width:                    30px !default;
 $carousel-indicator-height:                   3px !default;
+$carousel-indicator-spacer:                   3px !default;
 $carousel-indicator-active-bg:                #fff !default;
 
 $carousel-caption-width:                      70% !default;