diff options
| author | Starsam80 <[email protected]> | 2016-11-27 23:23:12 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-11-27 22:23:12 -0800 |
| commit | 54908a95a87b592d81df3231823979c75917d57a (patch) | |
| tree | 1586f7ac9cf55a925ed3e042f20db0f589dc1b14 | |
| parent | 869bd23937448fdcbae37c1062d373ef3ae7722a (diff) | |
| download | bootstrap-54908a95a87b592d81df3231823979c75917d57a.tar.xz bootstrap-54908a95a87b592d81df3231823979c75917d57a.zip | |
Rename `.navbar-toggleable-xs` to `.navbar-toggleable` + more cleanup (#21226)
* 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
| -rw-r--r-- | docs/_includes/nav-home.html | 6 | ||||
| -rw-r--r-- | docs/examples/album/index.html | 2 | ||||
| -rw-r--r-- | docs/examples/carousel/index.html | 2 | ||||
| -rw-r--r-- | docs/examples/narrow-jumbotron/index.html | 2 | ||||
| -rw-r--r-- | docs/examples/navbar/index.html | 4 | ||||
| -rw-r--r-- | docs/examples/offcanvas/index.html | 2 | ||||
| -rw-r--r-- | docs/examples/sticky-footer-navbar/index.html | 2 | ||||
| -rw-r--r-- | docs/examples/tooltip-viewport/index.html | 4 | ||||
| -rw-r--r-- | scss/_navbar.scss | 102 | ||||
| -rw-r--r-- | scss/utilities/_align.scss | 10 | ||||
| -rw-r--r-- | scss/utilities/_borders.scss | 8 | ||||
| -rw-r--r-- | scss/utilities/_display.scss | 24 | ||||
| -rw-r--r-- | scss/utilities/_float.scss | 8 | ||||
| -rw-r--r-- | scss/utilities/_spacing.scss | 4 | ||||
| -rw-r--r-- | scss/utilities/_text.scss | 18 |
15 files changed, 81 insertions, 117 deletions
diff --git a/docs/_includes/nav-home.html b/docs/_includes/nav-home.html index 6dd3723f6..8ba41c7b4 100644 --- a/docs/_includes/nav-home.html +++ b/docs/_includes/nav-home.html @@ -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 }} @@ -27,12 +27,12 @@ <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> diff --git a/docs/examples/album/index.html b/docs/examples/album/index.html index 1926dabf9..ecfa63bef 100644 --- a/docs/examples/album/index.html +++ b/docs/examples/album/index.html @@ -103,7 +103,7 @@ <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 © Bootstrap, but please download and customize it for yourself!</p> diff --git a/docs/examples/carousel/index.html b/docs/examples/carousel/index.html index aec1d0dfd..990553b97 100644 --- a/docs/examples/carousel/index.html +++ b/docs/examples/carousel/index.html @@ -164,7 +164,7 @@ <!-- 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>© 2014 Company, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p> </footer> diff --git a/docs/examples/narrow-jumbotron/index.html b/docs/examples/narrow-jumbotron/index.html index 3d96259e0..e27aca212 100644 --- a/docs/examples/narrow-jumbotron/index.html +++ b/docs/examples/narrow-jumbotron/index.html @@ -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> diff --git a/docs/examples/navbar/index.html b/docs/examples/navbar/index.html index f04d18748..3d35b7904 100644 --- a/docs/examples/navbar/index.html +++ b/docs/examples/navbar/index.html @@ -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> diff --git a/docs/examples/offcanvas/index.html b/docs/examples/offcanvas/index.html index cf59f4722..f43e0e5d5 100644 --- a/docs/examples/offcanvas/index.html +++ b/docs/examples/offcanvas/index.html @@ -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"> diff --git a/docs/examples/sticky-footer-navbar/index.html b/docs/examples/sticky-footer-navbar/index.html index 855f0418d..77242a6f6 100644 --- a/docs/examples/sticky-footer-navbar/index.html +++ b/docs/examples/sticky-footer-navbar/index.html @@ -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"> diff --git a/docs/examples/tooltip-viewport/index.html b/docs/examples/tooltip-viewport/index.html index ee990b975..2ca1ed2b0 100644 --- a/docs/examples/tooltip-viewport/index.html +++ b/docs/examples/tooltip-viewport/index.html @@ -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> diff --git a/scss/_navbar.scss b/scss/_navbar.scss index ebf27af8b..c6cc4e2fe 100644 --- a/scss/_navbar.scss +++ b/scss/_navbar.scss @@ -128,42 +128,6 @@ } } -// 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. @@ -284,48 +248,48 @@ } } - // 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 diff --git a/scss/utilities/_align.scss b/scss/utilities/_align.scss index 4886e059f..4dbbbc2db 100644 --- a/scss/utilities/_align.scss +++ b/scss/utilities/_align.scss @@ -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; } diff --git a/scss/utilities/_borders.scss b/scss/utilities/_borders.scss index 015c9b943..b256881e5 100644 --- a/scss/utilities/_borders.scss +++ b/scss/utilities/_borders.scss @@ -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 diff --git a/scss/utilities/_display.scss b/scss/utilities/_display.scss index 0e386cf6f..6325f7222 100644 --- a/scss/utilities/_display.scss +++ b/scss/utilities/_display.scss @@ -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; } } } } diff --git a/scss/utilities/_float.scss b/scss/utilities/_float.scss index 6c8a5dba4..5f8c2d587 100644 --- a/scss/utilities/_float.scss +++ b/scss/utilities/_float.scss @@ -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; } } } } diff --git a/scss/utilities/_spacing.scss b/scss/utilities/_spacing.scss index ff96c58d1..a845cf9ad 100644 --- a/scss/utilities/_spacing.scss +++ b/scss/utilities/_spacing.scss @@ -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; } diff --git a/scss/utilities/_text.scss b/scss/utilities/_text.scss index 2bf21804f..75f694a85 100644 --- a/scss/utilities/_text.scss +++ b/scss/utilities/_text.scss @@ -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 @@ -28,15 +28,15 @@ // 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 |
