]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Rename `.navbar-toggleable-xs` to `.navbar-toggleable` + more cleanup (#21226)
authorStarsam80 <samraskauskas@gmail.com>
Mon, 28 Nov 2016 06:23:12 +0000 (23:23 -0700)
committerMark Otto <markd.otto@gmail.com>
Mon, 28 Nov 2016 06:23:12 +0000 (22:23 -0800)
* Clean up some utilities

- Align CSS properties
- In `_spacing.scss`, we had a comment saying what 'a' was for, but we removed that so this comment no longer applies

* Remove '-xs' from `.navbar-toggleable-xs` and remove duplication

* Fix outdated classes to use newer ones

15 files changed:
docs/_includes/nav-home.html
docs/examples/album/index.html
docs/examples/carousel/index.html
docs/examples/narrow-jumbotron/index.html
docs/examples/navbar/index.html
docs/examples/offcanvas/index.html
docs/examples/sticky-footer-navbar/index.html
docs/examples/tooltip-viewport/index.html
scss/_navbar.scss
scss/utilities/_align.scss
scss/utilities/_borders.scss
scss/utilities/_display.scss
scss/utilities/_float.scss
scss/utilities/_spacing.scss
scss/utilities/_text.scss

index 6dd3723f65272f708f3ab1160db7cab35cf651cb..8ba41c7b42dedfec69d8132de8a179109c2b9142 100644 (file)
@@ -1,7 +1,7 @@
 <header class="navbar navbar-light navbar-static-top bd-navbar">
   <div class="container">
     {% comment %}
-    <nav class="nav navbar-nav float-xs-right">
+    <nav class="nav navbar-nav float-right">
       <div class="nav-item dropdown">
         <a class="nav-item nav-link dropdown-toggle" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
           v{{ site.current_version }}
 
     <nav>
       <div class="clearfix">
-        <button class="navbar-toggler float-xs-right hidden-sm-up" type="button" data-toggle="collapse" data-target="#bd-main-nav" aria-controls="bd-main-nav" aria-expanded="false" aria-label="Toggle navigation"></button>
+        <button class="navbar-toggler float-right hidden-sm-up" type="button" data-toggle="collapse" data-target="#bd-main-nav" aria-controls="bd-main-nav" aria-expanded="false" aria-label="Toggle navigation"></button>
         <a class="navbar-brand hidden-sm-up" href="{{ site.baseurl }}/">
           Bootstrap
         </a>
       </div>
-      <div class="collapse navbar-toggleable-xs" id="bd-main-nav">
+      <div class="collapse navbar-toggleable" id="bd-main-nav">
         <ul class="nav navbar-nav">
           <li class="nav-item active">
             <a class="nav-item nav-link {% if page.layout == "home" %}active{% endif %}" href="{{ site.baseurl }}/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Bootstrap</a>
index 1926dabf937b42f067f6cc2c6c6d749065ce024b..ecfa63befc709a139ab71c7e5a1f2fc8a30606ef 100644 (file)
 
     <footer class="text-muted">
       <div class="container">
-        <p class="float-xs-right">
+        <p class="float-right">
           <a href="#">Back to top</a>
         </p>
         <p>Album example is &copy; Bootstrap, but please download and customize it for yourself!</p>
index aec1d0dfd109b5217c1f410d0189a3ff049cdc45..990553b97aca01d802baad0605dbfb19a71b179d 100644 (file)
 
       <!-- FOOTER -->
       <footer>
-        <p class="float-xs-right"><a href="#">Back to top</a></p>
+        <p class="float-right"><a href="#">Back to top</a></p>
         <p>&copy; 2014 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p>
       </footer>
 
index 3d96259e0b7a09a20fef51762f4c8e7d1997e1ae..e27aca212d76e28a14a0b5e0dc700da24cc50791 100644 (file)
@@ -23,7 +23,7 @@
     <div class="container">
       <div class="header clearfix">
         <nav>
-          <ul class="nav nav-pills float-xs-right">
+          <ul class="nav nav-pills float-right">
             <li class="nav-item">
               <a class="nav-link active" href="#">Home <span class="sr-only">(current)</span></a>
             </li>
index f04d187487db9c3fd4d9cf55222afba6d2996e60..3d35b7904fe25b602b5d5ac59f340ff7a25c9e53 100644 (file)
@@ -23,7 +23,7 @@
     <div class="container">
       <nav class="navbar navbar-light bg-faded">
         <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#navbar-header" aria-controls="navbar-header" aria-expanded="false" aria-label="Toggle navigation"></button>
-        <div class="collapse navbar-toggleable-xs" id="navbar-header">
+        <div class="collapse navbar-toggleable" id="navbar-header">
           <a class="navbar-brand" href="#">Navbar</a>
           <ul class="nav navbar-nav">
             <li class="nav-item active">
@@ -39,7 +39,7 @@
               <a class="nav-link" href="#">About</a>
             </li>
           </ul>
-          <form class="form-inline float-xs-right">
+          <form class="form-inline float-right">
             <input class="form-control" type="text" placeholder="Search">
             <button class="btn btn-outline-success" type="submit">Search</button>
           </form>
index cf59f4722ddcef5dcd61e0cbb0380803b61a1cde..f43e0e5d5e500ead6b60a676d5185a4907f2b713 100644 (file)
@@ -35,7 +35,7 @@
       <div class="row row-offcanvas row-offcanvas-right">
 
         <div class="col-12 col-sm-9">
-          <p class="float-xs-right hidden-sm-up">
+          <p class="float-right hidden-sm-up">
             <button type="button" class="btn btn-primary btn-sm" data-toggle="offcanvas">Toggle nav</button>
           </p>
           <div class="jumbotron">
index 855f0418d648ea462fd83ef06a64b304c56f8698..77242a6f64e529bc4c5364a44ac8234f54c4624e 100644 (file)
@@ -31,7 +31,7 @@
       <nav class="navbar navbar-light navbar-static-top bg-faded">
         <div class="container">
           <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2" aria-expanded="false" aria-controls="exCollapsingNavbar2" aria-label="Toggle navigation"></button>
-          <div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2">
+          <div class="collapse navbar-toggleable" id="exCollapsingNavbar2">
             <a class="navbar-brand" href="#">Sticky footer</a>
             <ul class="nav navbar-nav">
               <li class="nav-item active">
index ee990b97560d66a77a38f8b608fcc979c6a5df31..2ca1ed2b0859945c7ec317c83a74943d5d220144 100644 (file)
@@ -20,7 +20,7 @@
 
   <body>
 
-    <button class="btn btn-secondary float-xs-right tooltip-bottom" title="This should be shifted to the left">Shift Left</button>
+    <button class="btn btn-secondary float-right tooltip-bottom" title="This should be shifted to the left">Shift Left</button>
     <button class="btn btn-secondary tooltip-bottom" title="This should be shifted to the right">Shift Right</button>
     <button class="btn btn-secondary tooltip-right" title="This should be shifted down">Shift Down</button>
 
@@ -30,7 +30,7 @@
       <button class="btn btn-secondary tooltip-viewport-bottom" title="This should be shifted to the left">Shift Left</button>
       <button class="btn btn-secondary tooltip-viewport-right" title="This should be shifted down">Shift Down</button>
 
-      <button class="btn btn-secondary float-xs-right tooltip-viewport-bottom" title="This should be shifted to the right">Shift Right</button>
+      <button class="btn btn-secondary float-right tooltip-viewport-bottom" title="This should be shifted to the right">Shift Right</button>
 
       <button class="btn btn-secondary tooltip-viewport-right btn-bottom" title="This should be shifted up">Shift Up</button>
     </div>
index ebf27af8b25aac8f742db0b3ce3b07c96fbc4667..c6cc4e2fec00534aa0d21188f1942a7d477d5f78 100644 (file)
   }
 }
 
-// scss-lint:disable ImportantRule
-.navbar-toggleable {
-  @each $breakpoint in map-keys($grid-breakpoints) {
-    $next: breakpoint-next($breakpoint, $grid-breakpoints);
-
-    &-#{$breakpoint} {
-      @include clearfix;
-
-      @include media-breakpoint-down($breakpoint) {
-        .navbar-brand {
-          display: block;
-          float: none;
-          margin-top: .5rem;
-          margin-right: 0;
-        }
-
-        .navbar-nav {
-          margin-top: .5rem;
-          margin-bottom: .5rem;
-
-          .dropdown-menu {
-            position: static;
-            float: none;
-          }
-        }
-      }
-
-      @include media-breakpoint-up($next) {
-        display: block;
-      }
-    }
-  }
-}
-// scss-lint:enable ImportantRule
-
-
 // Navigation
 //
 // Custom navbar navigation built on the base `.nav` styles.
   }
 }
 
-
 // Navbar toggleable
 //
 // Custom override for collapse plugin in navbar.
 
+// Placed at the end of the file so it can override some CSS properties
+// scss-lint:disable ImportantRule
 .navbar-toggleable {
-  &-xs {
-    @include clearfix;
-    @include media-breakpoint-down(xs) {
-      .navbar-nav .nav-item {
-        float: none;
-        margin-left: 0;
-      }
-    }
-    @include media-breakpoint-up(sm) {
-      display: block !important;
-    }
-  }
+  @each $breakpoint in map-keys($grid-breakpoints) {
+    $next: breakpoint-next($breakpoint, $grid-breakpoints);
+
+    // Get rid of the 'xs' prefix while reducing duplication
+    #{if(breakpoint-min($breakpoint, $grid-breakpoints), "&-#{$breakpoint}", "&")} {
+      @include clearfix;
 
-  &-sm {
-    @include clearfix;
-    @include media-breakpoint-down(sm) {
-      .navbar-nav .nav-item {
-        float: none;
-        margin-left: 0;
+      @include media-breakpoint-down($breakpoint) {
+        .navbar-brand {
+          display: block;
+          float: none;
+          margin-top: .5rem;
+          margin-right: 0;
+        }
+
+        .navbar-nav {
+          margin-top: .5rem;
+          margin-bottom: .5rem;
+
+          .dropdown-menu {
+            position: static;
+            float: none;
+          }
+
+          .nav-item {
+            float: none;
+            margin-left: 0;
+          }
+        }
       }
-    }
-    @include media-breakpoint-up(md) {
-      display: block !important;
-    }
-  }
 
-  &-md {
-    @include clearfix;
-    @include media-breakpoint-down(md) {
-      .navbar-nav .nav-item {
-        float: none;
-        margin-left: 0;
+      @include media-breakpoint-up($next) {
+        display: block !important;
       }
     }
-    @include media-breakpoint-up(lg) {
-      display: block !important;
-    }
   }
 }
+// scss-lint:enable ImportantRule
index 4886e059feb30f685324b8525a1226aa3210c173..4dbbbc2dbc47ed53d177ad1bc78d0c06605663e9 100644 (file)
@@ -1,6 +1,6 @@
-.align-baseline { vertical-align: baseline !important; } // Browser default
-.align-top { vertical-align: top !important; }
-.align-middle { vertical-align: middle !important; }
-.align-bottom { vertical-align: bottom !important; }
+.align-baseline    { vertical-align: baseline !important; } // Browser default
+.align-top         { vertical-align: top !important; }
+.align-middle      { vertical-align: middle !important; }
+.align-bottom      { vertical-align: bottom !important; }
 .align-text-bottom { vertical-align: text-bottom !important; }
-.align-text-top { vertical-align: text-top !important; }
+.align-text-top    { vertical-align: text-top !important; }
index 015c9b943bd69a0e10f8f4c98c3375e93db321f6..b256881e5ece38fcd323bc67665b9221b254e069 100644 (file)
@@ -2,11 +2,11 @@
 // Border
 //
 
-.border-0 { border: 0 !important; }
-.border-top-0 { border-top: 0 !important; }
-.border-right-0 { border-right: 0 !important; }
+.border-0        { border: 0 !important; }
+.border-top-0    { border-top: 0 !important; }
+.border-right-0  { border-right: 0 !important; }
 .border-bottom-0 { border-bottom: 0 !important; }
-.border-left-0 { border-left: 0 !important; }
+.border-left-0   { border-left: 0 !important; }
 
 //
 // Border-radius
index 0e386cf6fb841eba958c010cc4b61f7f113a086b..6325f7222704a663e123db7665bb03b4e875f3a4 100644 (file)
@@ -8,21 +8,21 @@
     $min: breakpoint-min($breakpoint, $grid-breakpoints);
 
     @if $min {
-      .d-#{$breakpoint}-none { display: none !important; }
-      .d-#{$breakpoint}-inline { display: inline !important; }
+      .d-#{$breakpoint}-none         { display: none !important; }
+      .d-#{$breakpoint}-inline       { display: inline !important; }
       .d-#{$breakpoint}-inline-block { display: inline-block !important; }
-      .d-#{$breakpoint}-block { display: block !important; }
-      .d-#{$breakpoint}-table { display: table !important; }
-      .d-#{$breakpoint}-table-cell { display: table-cell !important; }
-      .d-#{$breakpoint}-flex { display: flex !important; }
+      .d-#{$breakpoint}-block        { display: block !important; }
+      .d-#{$breakpoint}-table        { display: table !important; }
+      .d-#{$breakpoint}-table-cell   { display: table-cell !important; }
+      .d-#{$breakpoint}-flex         { display: flex !important; }
     } @else {
-      .d-none { display: none !important; }
-      .d-inline { display: inline !important; }
+      .d-none         { display: none !important; }
+      .d-inline       { display: inline !important; }
       .d-inline-block { display: inline-block !important; }
-      .d-block { display: block !important; }
-      .d-table { display: table !important; }
-      .d-table-cell { display: table-cell !important; }
-      .d-flex { display: flex !important; }
+      .d-block        { display: block !important; }
+      .d-table        { display: table !important; }
+      .d-table-cell   { display: table-cell !important; }
+      .d-flex         { display: flex !important; }
     }
   }
 }
index 6c8a5dba4bcef0ba04b66d5272066178fdaf857a..5f8c2d58796d549a2937a75a55fa7448d84d2607 100644 (file)
@@ -4,14 +4,14 @@
 
     @if $min {
       // everything else
-      .float-#{$breakpoint}-left { @include float-left; }
+      .float-#{$breakpoint}-left  { @include float-left; }
       .float-#{$breakpoint}-right { @include float-right; }
-      .float-#{$breakpoint}-none { @include float-none; }
+      .float-#{$breakpoint}-none  { @include float-none; }
     } @else {
       // xs
-      .float-left { @include float-left; }
+      .float-left  { @include float-left; }
       .float-right { @include float-right; }
-      .float-none { @include float-none; }
+      .float-none  { @include float-none; }
     }
   }
 }
index ff96c58d1f727366443ff41fbd101610dbead2a1..a845cf9ad849776d697ef6fb100735af73ed1f74 100644 (file)
@@ -24,7 +24,7 @@
 
         @if $min {
           // everything else
-          .#{$abbrev}-#{$breakpoint}-#{$size} { #{$prop}:        $length-y $length-x !important; } // a = All sides
+          .#{$abbrev}-#{$breakpoint}-#{$size}  { #{$prop}:        $length-y $length-x !important; }
           .#{$abbrev}t-#{$breakpoint}-#{$size} { #{$prop}-top:    $length-y !important; }
           .#{$abbrev}r-#{$breakpoint}-#{$size} { #{$prop}-right:  $length-x !important; }
           .#{$abbrev}b-#{$breakpoint}-#{$size} { #{$prop}-bottom: $length-y !important; }
@@ -39,7 +39,7 @@
           }
         } @else {
           // xs
-          .#{$abbrev}-#{$size} { #{$prop}:        $length-y $length-x !important; } // a = All sides
+          .#{$abbrev}-#{$size}  { #{$prop}:        $length-y $length-x !important; }
           .#{$abbrev}t-#{$size} { #{$prop}-top:    $length-y !important; }
           .#{$abbrev}r-#{$size} { #{$prop}-right:  $length-x !important; }
           .#{$abbrev}b-#{$size} { #{$prop}-bottom: $length-y !important; }
index 2bf21804f42560019daadf5004ad2d11187e1209..75f694a8531e80903eae00c4b8ceff6d1c8f87b9 100644 (file)
@@ -4,9 +4,9 @@
 
 // Alignment
 
-.text-justify        { text-align: justify !important; }
-.text-nowrap         { white-space: nowrap !important; }
-.text-truncate       { @include text-truncate; }
+.text-justify  { text-align: justify !important; }
+.text-nowrap   { white-space: nowrap !important; }
+.text-truncate { @include text-truncate; }
 
 // Responsive alignment
 
 
 // Transformation
 
-.text-lowercase      { text-transform: lowercase !important; }
-.text-uppercase      { text-transform: uppercase !important; }
-.text-capitalize     { text-transform: capitalize !important; }
+.text-lowercase  { text-transform: lowercase !important; }
+.text-uppercase  { text-transform: uppercase !important; }
+.text-capitalize { text-transform: capitalize !important; }
 
 // Weight and italics
 
-.font-weight-normal  { font-weight: $font-weight-normal; }
-.font-weight-bold    { font-weight: $font-weight-bold; }
-.font-italic         { font-style: italic; }
+.font-weight-normal { font-weight: $font-weight-normal; }
+.font-weight-bold   { font-weight: $font-weight-bold; }
+.font-italic        { font-style: italic; }
 
 // Contextual colors