diff options
| author | lucascono <[email protected]> | 2017-10-04 05:33:17 -0300 |
|---|---|---|
| committer | lucascono <[email protected]> | 2017-10-04 05:33:17 -0300 |
| commit | 8c04a74c8c7f0174ea08bc02fa3762f49bf615a3 (patch) | |
| tree | db9d6923c082243d765c57885992db8dd26a70b5 /scss | |
| parent | 9aff890efa3798f831b714c41794c9fee0684bae (diff) | |
| parent | b29b1e155880ac953899889c9cbb67f7f7df0529 (diff) | |
| download | bootstrap-8c04a74c8c7f0174ea08bc02fa3762f49bf615a3.tar.xz bootstrap-8c04a74c8c7f0174ea08bc02fa3762f49bf615a3.zip | |
Merge remote-tracking branch 'refs/remotes/twbs/v4-dev' into v4-dev
Diffstat (limited to 'scss')
54 files changed, 569 insertions, 390 deletions
diff --git a/scss/_alert.scss b/scss/_alert.scss index 3dfd13f56..66fba24ea 100644 --- a/scss/_alert.scss +++ b/scss/_alert.scss @@ -3,6 +3,7 @@ // .alert { + position: relative; padding: $alert-padding-y $alert-padding-x; margin-bottom: $alert-margin-bottom; border: $alert-border-width solid transparent; @@ -28,9 +29,9 @@ .alert-dismissible { // Adjust close link position .close { - position: relative; - top: -$alert-padding-y; - right: -$alert-padding-x; + position: absolute; + top: 0; + right: 0; padding: $alert-padding-y $alert-padding-x; color: inherit; } diff --git a/scss/_badge.scss b/scss/_badge.scss index 8a7626344..b87a1b004 100644 --- a/scss/_badge.scss +++ b/scss/_badge.scss @@ -9,11 +9,10 @@ font-size: $badge-font-size; font-weight: $badge-font-weight; line-height: 1; - color: $badge-color; text-align: center; white-space: nowrap; vertical-align: baseline; - @include border-radius(); + @include border-radius($badge-border-radius); // Empty badges collapse automatically &:empty { diff --git a/scss/_breadcrumb.scss b/scss/_breadcrumb.scss index 2bc0e2086..25b9d85a1 100644 --- a/scss/_breadcrumb.scss +++ b/scss/_breadcrumb.scss @@ -1,15 +1,14 @@ .breadcrumb { + display: flex; + flex-wrap: wrap; padding: $breadcrumb-padding-y $breadcrumb-padding-x; - margin-bottom: 1rem; + margin-bottom: $breadcrumb-margin-bottom; list-style: none; background-color: $breadcrumb-bg; @include border-radius($border-radius); - @include clearfix; } .breadcrumb-item { - float: left; - // The separator between breadcrumbs (by default, a forward-slash: "/") + .breadcrumb-item::before { display: inline-block; // Suppress underlining of the separator in modern browsers @@ -28,6 +27,7 @@ + .breadcrumb-item:hover::before { text-decoration: underline; } + // stylelint-disable-next-line no-duplicate-selectors + .breadcrumb-item:hover::before { text-decoration: none; } diff --git a/scss/_button-group.scss b/scss/_button-group.scss index 30a14d883..1a373f323 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -1,4 +1,4 @@ -// scss-lint:disable QualifyingElement +// stylelint-disable selector-no-qualifying-type // Make the div behave like a button .btn-group, @@ -10,7 +10,6 @@ > .btn { position: relative; flex: 0 1 auto; - margin-bottom: 0; // Bring the hover, focused, and "active" buttons to the front to overlay // the borders properly @@ -48,7 +47,8 @@ border-radius: 0; } -// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match +// Set corners individual because sometimes a single button can be in a .btn-group +// and we need :first-child and :last-child to both match .btn-group > .btn:first-child { margin-left: 0; @@ -56,25 +56,30 @@ @include border-right-radius(0); } } -// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it +// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu +// immediately after it .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { @include border-left-radius(0); } -// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group) +// Custom edits for including btn-groups within btn-groups (useful for including +// dropdown buttons within a btn-group) .btn-group > .btn-group { float: left; } + .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } + .btn-group > .btn-group:first-child:not(:last-child) { > .btn:last-child, > .dropdown-toggle { @include border-right-radius(0); } } + .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { @include border-left-radius(0); } @@ -129,7 +134,6 @@ // .btn-group-vertical { - display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; @@ -146,31 +150,36 @@ margin-top: -$input-btn-border-width; margin-left: 0; } -} -.btn-group-vertical > .btn { - &:not(:first-child):not(:last-child) { + > .btn { + &:not(:first-child):not(:last-child) { + border-radius: 0; + } + + &:first-child:not(:last-child) { + @include border-bottom-radius(0); + } + + &:last-child:not(:first-child) { + @include border-top-radius(0); + } + } + + > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } - &:first-child:not(:last-child) { - @include border-bottom-radius(0); + + > .btn-group:first-child:not(:last-child) { + > .btn:last-child, + > .dropdown-toggle { + @include border-bottom-radius(0); + } } - &:last-child:not(:first-child) { + + > .btn-group:last-child:not(:first-child) > .btn:first-child { @include border-top-radius(0); } } -.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.btn-group-vertical > .btn-group:first-child:not(:last-child) { - > .btn:last-child, - > .dropdown-toggle { - @include border-bottom-radius(0); - } -} -.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { - @include border-top-radius(0); -} // Checkbox and radio options diff --git a/scss/_buttons.scss b/scss/_buttons.scss index 607f24a2d..d69c15998 100644 --- a/scss/_buttons.scss +++ b/scss/_buttons.scss @@ -1,4 +1,4 @@ -// scss-lint:disable QualifyingElement +// stylelint-disable selector-no-qualifying-type // // Base styles @@ -58,7 +58,11 @@ fieldset[disabled] a.btn { @each $color, $value in $theme-colors { .btn-outline-#{$color} { - @include button-outline-variant($value, #fff); + @if $color == "light" { + @include button-outline-variant($value, $gray-900); + } @else { + @include button-outline-variant($value, $white); + } } } @@ -71,36 +75,27 @@ fieldset[disabled] a.btn { .btn-link { font-weight: $font-weight-normal; color: $link-color; - border-radius: 0; + background-color: transparent; - &, - &:active, - &.active, - &:disabled { + @include hover { + color: $link-hover-color; + text-decoration: $link-hover-decoration; background-color: transparent; - @include box-shadow(none); + border-color: transparent; } - &, + &:focus, - &:active { + &.focus { border-color: transparent; box-shadow: none; } - @include hover { - border-color: transparent; - } - @include hover-focus { - color: $link-hover-color; - text-decoration: $link-hover-decoration; - background-color: transparent; - } - &:disabled { - color: $btn-link-disabled-color; - @include hover-focus { - text-decoration: none; - } + &:disabled, + &.disabled { + color: $btn-link-disabled-color; } + + // No need for an active state here } @@ -109,11 +104,11 @@ fieldset[disabled] a.btn { // .btn-lg { - @include button-size($input-btn-padding-y-lg, $input-btn-padding-x-lg, $font-size-lg, $line-height-lg, $btn-border-radius-lg); + @include button-size($input-btn-padding-y-lg, $input-btn-padding-x-lg, $font-size-lg, $input-btn-line-height-lg, $btn-border-radius-lg); } .btn-sm { - @include button-size($input-btn-padding-y-sm, $input-btn-padding-x-sm, $font-size-sm, $line-height-sm, $btn-border-radius-sm); + @include button-size($input-btn-padding-y-sm, $input-btn-padding-x-sm, $font-size-sm, $input-btn-line-height-sm, $btn-border-radius-sm); } diff --git a/scss/_card.scss b/scss/_card.scss index 1ab85a4ec..295d6afcf 100644 --- a/scss/_card.scss +++ b/scss/_card.scss @@ -12,6 +12,11 @@ background-clip: border-box; border: $card-border-width solid $card-border-color; @include border-radius($card-border-radius); + + > hr { + margin-right: 0; + margin-left: 0; + } } .card-body { @@ -72,6 +77,12 @@ &:first-child { @include border-radius($card-inner-border-radius $card-inner-border-radius 0 0); } + + + .list-group { + .list-group-item:first-child { + border-top: 0; + } + } } .card-footer { @@ -130,9 +141,15 @@ // Card deck -@include media-breakpoint-up(sm) { - .card-deck { - display: flex; +.card-deck { + display: flex; + flex-direction: column; + + .card { + margin-bottom: $card-deck-margin; + } + + @include media-breakpoint-up(sm) { flex-flow: row wrap; margin-right: -$card-deck-margin; margin-left: -$card-deck-margin; @@ -142,6 +159,7 @@ flex: 1 0 0%; flex-direction: column; margin-right: $card-deck-margin; + margin-bottom: 0; // Override the default margin-left: $card-deck-margin; } } @@ -152,13 +170,20 @@ // Card groups // -@include media-breakpoint-up(sm) { - .card-group { - display: flex; +.card-group { + display: flex; + flex-direction: column; + + .card { + margin-bottom: $card-group-margin; + } + + @include media-breakpoint-up(sm) { flex-flow: row wrap; .card { flex: 1 0 0%; + margin-bottom: 0; + .card { margin-left: 0; @@ -177,6 +202,7 @@ border-bottom-right-radius: 0; } } + &:last-child { @include border-left-radius(0); @@ -188,7 +214,7 @@ } } - &:not(:first-child):not(:last-child) { + &:not(:first-child):not(:last-child):not(:only-child) { border-radius: 0; .card-img-top, @@ -196,6 +222,10 @@ border-radius: 0; } } + + &:only-child { + @include border-radius($card-border-radius); + } } } } diff --git a/scss/_close.scss b/scss/_close.scss index f18149051..897d48684 100644 --- a/scss/_close.scss +++ b/scss/_close.scss @@ -19,11 +19,11 @@ // If you want the anchor version, it requires `href="#"`. // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile -// scss-lint:disable QualifyingElement +// stylelint-disable property-no-vendor-prefix, selector-no-qualifying-type button.close { padding: 0; background: transparent; border: 0; -webkit-appearance: none; } -// scss-lint:enable QualifyingElement +// stylelint-enable diff --git a/scss/_custom-forms.scss b/scss/_custom-forms.scss index d1fbf954f..41dae4d76 100644 --- a/scss/_custom-forms.scss +++ b/scss/_custom-forms.scss @@ -1,5 +1,3 @@ -// scss-lint:disable PropertyCount, VendorPrefix - // Embedded icons from Open Iconic. // Released under MIT and copyright 2014 Waybury. // https://useiconic.com/open @@ -164,6 +162,11 @@ } } + &[multiple] { + height: auto; + background-image: none; + } + &:disabled { color: $custom-select-disabled-color; background-color: $custom-select-disabled-bg; @@ -203,7 +206,7 @@ opacity: 0; &:focus ~ .custom-file-control { - @include box-shadow($custom-file-focus-box-shadow); + box-shadow: $custom-file-focus-box-shadow; } } @@ -214,7 +217,7 @@ left: 0; z-index: 5; height: $custom-file-height; - padding: $custom-file-padding-x $custom-file-padding-y; + padding: $custom-file-padding-y $custom-file-padding-x; line-height: $custom-file-line-height; color: $custom-file-color; pointer-events: none; @@ -238,7 +241,7 @@ z-index: 6; display: block; height: $custom-file-height; - padding: $custom-file-padding-x $custom-file-padding-y; + padding: $custom-file-padding-y $custom-file-padding-x; line-height: $custom-file-line-height; color: $custom-file-button-color; background-color: $custom-file-button-bg; diff --git a/scss/_dropdown.scss b/scss/_dropdown.scss index 05e8b1652..32657167f 100644 --- a/scss/_dropdown.scss +++ b/scss/_dropdown.scss @@ -6,21 +6,7 @@ .dropdown-toggle { // Generate the caret automatically - &::after { - display: inline-block; - width: 0; - height: 0; - margin-left: $caret-width * .85; - vertical-align: $caret-width * .85; - content: ""; - border-top: $caret-width solid; - border-right: $caret-width solid transparent; - border-left: $caret-width solid transparent; - } - - &:empty::after { - margin-left: 0; - } + @include caret; } // Allow for dropdowns to go bottom up (aka, dropup-menu) @@ -32,10 +18,7 @@ } .dropdown-toggle { - &::after { - border-top: 0; - border-bottom: $caret-width solid; - } + @include caret(up); } } @@ -105,14 +88,6 @@ } } -// Open state for the dropdown -.show { - // Remove the outline when :focus is triggered - > a { - outline: 0; - } -} - .dropdown-menu.show { display: block; } diff --git a/scss/_forms.scss b/scss/_forms.scss index 519554b47..0ece186d9 100644 --- a/scss/_forms.scss +++ b/scss/_forms.scss @@ -1,4 +1,4 @@ -// scss-lint:disable QualifyingElement, VendorPrefix +// stylelint-disable selector-no-qualifying-type // // Textual form controls @@ -7,8 +7,6 @@ .form-control { display: block; width: 100%; - // // Make inputs at least the height of their button counterpart (base line-height + padding + border) - // height: $input-height; padding: $input-btn-padding-y $input-btn-padding-x; font-size: $font-size-base; line-height: $input-btn-line-height; @@ -90,21 +88,24 @@ select.form-control { // For use with horizontal and inline forms, when you need the label text to // align with the form controls. .col-form-label { - padding-top: calc(#{$input-btn-padding-y} - #{$input-btn-border-width} * 2); - padding-bottom: calc(#{$input-btn-padding-y} - #{$input-btn-border-width} * 2); + padding-top: calc(#{$input-btn-padding-y} + #{$input-btn-border-width}); + padding-bottom: calc(#{$input-btn-padding-y} + #{$input-btn-border-width}); margin-bottom: 0; // Override the `<label>` default + line-height: $input-btn-line-height; } .col-form-label-lg { - padding-top: calc(#{$input-btn-padding-y-lg} - #{$input-btn-border-width} * 2); - padding-bottom: calc(#{$input-btn-padding-y-lg} - #{$input-btn-border-width} * 2); + padding-top: calc(#{$input-btn-padding-y-lg} + #{$input-btn-border-width}); + padding-bottom: calc(#{$input-btn-padding-y-lg} + #{$input-btn-border-width}); font-size: $font-size-lg; + line-height: $input-btn-line-height-lg; } .col-form-label-sm { - padding-top: calc(#{$input-btn-padding-y-sm} - #{$input-btn-border-width} * 2); - padding-bottom: calc(#{$input-btn-padding-y-sm} - #{$input-btn-border-width} * 2); + padding-top: calc(#{$input-btn-padding-y-sm} + #{$input-btn-border-width}); + padding-bottom: calc(#{$input-btn-padding-y-sm} + #{$input-btn-border-width}); font-size: $font-size-sm; + line-height: $input-btn-line-height-sm; } @@ -132,6 +133,7 @@ select.form-control { padding-bottom: $input-btn-padding-y; margin-bottom: 0; // match inputs if this class comes on inputs with default margins line-height: $input-btn-line-height; + background-color: transparent; border: solid transparent; border-width: $input-btn-border-width 0; @@ -236,23 +238,16 @@ select.form-control-lg { position: absolute; margin-top: $form-check-input-margin-y; margin-left: -$form-check-input-gutter; - - &:only-child { - position: static; - } } // Radios and checkboxes on same line .form-check-inline { display: inline-block; + margin-right: $form-check-inline-margin-x; .form-check-label { vertical-align: middle; } - - + .form-check-inline { - margin-left: $form-check-inline-margin-x; - } } @@ -263,28 +258,6 @@ select.form-control-lg { // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for // server side validation. -.invalid-feedback { - display: none; - margin-top: .25rem; - font-size: .875rem; - color: $form-feedback-invalid-color; -} - -.invalid-tooltip { - position: absolute; - top: 100%; - z-index: 5; - display: none; - width: 250px; - padding: .5rem; - margin-top: .1rem; - font-size: .875rem; - line-height: 1; - color: #fff; - background-color: rgba($form-feedback-invalid-color,.8); - border-radius: .2rem; -} - @include form-validation-state("valid", $form-feedback-valid-color); @include form-validation-state("invalid", $form-feedback-invalid-color); diff --git a/scss/_functions.scss b/scss/_functions.scss index 6c0601c50..5d43b5708 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -72,7 +72,7 @@ @return map-get($theme-colors, $key); } -@function grayscale($key: "100") { +@function gray($key: "100") { @return map-get($grays, $key); } @@ -80,11 +80,7 @@ @function theme-color-level($color-name: "primary", $level: 0) { $color: theme-color($color-name); $color-base: if($level > 0, #000, #fff); + $level: abs($level); - @if $level < 0 { - // Lighter values need a quick double negative for the Sass math to work - @return mix($color-base, $color, $level * -1 * $theme-color-interval); - } @else { - @return mix($color-base, $color, $level * $theme-color-interval); - } + @return mix($color-base, $color, $level * $theme-color-interval); } diff --git a/scss/_grid.scss b/scss/_grid.scss index 9ab9ae02b..a22751537 100644 --- a/scss/_grid.scss +++ b/scss/_grid.scss @@ -16,7 +16,6 @@ @if $enable-grid-classes { .container-fluid { - width: 100%; @include make-container(); } } diff --git a/scss/_input-group.scss b/scss/_input-group.scss index 0b668bff3..a1d16e384 100644 --- a/scss/_input-group.scss +++ b/scss/_input-group.scss @@ -1,3 +1,5 @@ +// stylelint-disable selector-no-qualifying-type + // // Base styles // @@ -5,6 +7,7 @@ .input-group { position: relative; display: flex; + align-items: stretch; width: 100%; .form-control { @@ -28,10 +31,8 @@ .input-group-addon, .input-group-btn, .input-group .form-control { - // Vertically centers the content of the addons within the input group display: flex; align-items: center; - &:not(:first-child):not(:last-child) { @include border-radius(0); } @@ -40,7 +41,6 @@ .input-group-addon, .input-group-btn { white-space: nowrap; - vertical-align: middle; // Match the inputs } @@ -71,7 +71,7 @@ font-size: $font-size-base; // Match inputs font-weight: $font-weight-normal; line-height: $input-btn-line-height; - color: $input-color; + color: $input-group-addon-color; text-align: center; background-color: $input-group-addon-bg; border: $input-btn-border-width solid $input-group-addon-border-color; @@ -90,13 +90,11 @@ @include border-radius($input-border-radius-lg); } - // scss-lint:disable QualifyingElement // Nuke default margins from checkboxes and radios to vertically center within. input[type="radio"], input[type="checkbox"] { margin-top: 0; } - // scss-lint:enable QualifyingElement } @@ -135,6 +133,7 @@ .input-group-btn { position: relative; + align-items: stretch; // Jankily prevent input button groups from wrapping with `white-space` and // `font-size` in combination with `inline-block` on buttons. font-size: 0; @@ -155,6 +154,10 @@ } } + &:first-child > .btn + .btn { + margin-left: 0; + } + // Negative margin to only have a single, shared border between the two &:not(:last-child) { > .btn, @@ -166,7 +169,14 @@ > .btn, > .btn-group { z-index: 2; - margin-left: (-$input-btn-border-width); + // remove nagative margin ($input-btn-border-width) to solve overlapping issue with button. + margin-left: 0; + + // When input is first, overlap the right side of it with the button(-group) + &:first-child { + margin-left: (-$input-btn-border-width); + } + // Because specificity @include hover-focus-active { z-index: 3; diff --git a/scss/_list-group.scss b/scss/_list-group.scss index 7e0b19e01..ce3876b6c 100644 --- a/scss/_list-group.scss +++ b/scss/_list-group.scss @@ -86,8 +86,13 @@ .list-group-flush { .list-group-item { border-right: 0; + border-bottom: 0; border-left: 0; border-radius: 0; + + &:first-child { + border-top: 0; + } } &:first-child { diff --git a/scss/_mixins.scss b/scss/_mixins.scss index 09035bf10..d9a1774b7 100644 --- a/scss/_mixins.scss +++ b/scss/_mixins.scss @@ -19,6 +19,7 @@ // // Components @import "mixins/alert"; @import "mixins/buttons"; +@import "mixins/caret"; @import "mixins/pagination"; @import "mixins/lists"; @import "mixins/list-group"; diff --git a/scss/_modal.scss b/scss/_modal.scss index c0c406716..e655850e3 100644 --- a/scss/_modal.scss +++ b/scss/_modal.scss @@ -43,6 +43,8 @@ position: relative; width: auto; margin: $modal-dialog-margin; + // allow clicks to pass through for custom click handling to close modal + pointer-events: none; } // Actual modal @@ -50,6 +52,8 @@ position: relative; display: flex; flex-direction: column; + // counteract the pointer-events: none; in the .modal-dialog + pointer-events: auto; background-color: $modal-content-bg; background-clip: padding-box; border: $modal-content-border-width solid $modal-content-border-color; @@ -78,10 +82,17 @@ // Top section of the modal w/ title and dismiss .modal-header { display: flex; - align-items: center; // vertically center it + align-items: flex-start; // so the close btn always stays on the upper right corner justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends padding: $modal-header-padding; border-bottom: $modal-header-border-width solid $modal-header-border-color; + @include border-top-radius($border-radius-lg); + + .close { + padding: $modal-header-padding; + // auto on the left force icon to the right even when there is no .modal-title + margin: (-$modal-header-padding) (-$modal-header-padding) (-$modal-header-padding) auto; + } } // Title text within header diff --git a/scss/_nav.scss b/scss/_nav.scss index ed5d76b0c..14e76c9ac 100644 --- a/scss/_nav.scss +++ b/scss/_nav.scss @@ -74,12 +74,12 @@ .nav-pills { .nav-link { @include border-radius($nav-pills-border-radius); + } - &.active, - .show > & { - color: $nav-pills-link-active-color; - background-color: $nav-pills-link-active-bg; - } + .nav-link.active, + .show > .nav-link { + color: $nav-pills-link-active-color; + background-color: $nav-pills-link-active-bg; } } diff --git a/scss/_navbar.scss b/scss/_navbar.scss index ed49b76b9..1398400c0 100644 --- a/scss/_navbar.scss +++ b/scss/_navbar.scss @@ -98,6 +98,7 @@ // on the `.navbar` parent. .navbar-collapse { flex-basis: 100%; + flex-grow: 1; // For always expanded or extra full navbars, ensure content aligns itself // properly vertically. Can be easily overridden with flex utilities. align-items: center; @@ -146,8 +147,7 @@ } @include media-breakpoint-up($next) { - flex-direction: row; - flex-wrap: nowrap; + flex-flow: row nowrap; justify-content: flex-start; .navbar-nav { @@ -174,11 +174,12 @@ flex-wrap: nowrap; } - // scss-lint:disable ImportantRule .navbar-collapse { - display: flex !important; + display: flex !important; // stylelint-disable-line declaration-no-important + + // Changes flex-bases to auto because of an IE10 bug + flex-basis: auto; } - // scss-lint:enable ImportantRule .navbar-toggler { display: none; @@ -235,6 +236,13 @@ .navbar-text { color: $navbar-light-color; + a { + color: $navbar-light-active-color; + + @include hover-focus { + color: $navbar-light-active-color; + } + } } } @@ -280,5 +288,12 @@ .navbar-text { color: $navbar-dark-color; + a { + color: $navbar-dark-active-color; + + @include hover-focus { + color: $navbar-dark-active-color; + } + } } } diff --git a/scss/_pagination.scss b/scss/_pagination.scss index a04929987..69a36ffe5 100644 --- a/scss/_pagination.scss +++ b/scss/_pagination.scss @@ -1,8 +1,6 @@ .pagination { display: flex; - // 1-2: Disable browser default list styles - padding-left: 0; // 1 - list-style: none; // 2 + @include list-unstyled(); @include border-radius(); } @@ -38,7 +36,7 @@ position: relative; display: block; padding: $pagination-padding-y $pagination-padding-x; - margin-left: -1px; + margin-left: -$pagination-border-width; line-height: $pagination-line-height; color: $pagination-color; background-color: $pagination-bg; diff --git a/scss/_print.scss b/scss/_print.scss index 7f8d9900a..6505d3e94 100644 --- a/scss/_print.scss +++ b/scss/_print.scss @@ -1,4 +1,4 @@ -// scss-lint:disable QualifyingElement +// stylelint-disable declaration-no-important, selector-no-qualifying-type // Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css @@ -14,8 +14,7 @@ *::before, *::after { // Bootstrap specific; comment out `color` and `background` - //color: #000 !important; // Black prints faster: - // http://www.sanbeiji.com/archives/953 + //color: #000 !important; // Black prints faster: http://www.sanbeiji.com/archives/953 text-shadow: none !important; //background: transparent !important; box-shadow: none !important; diff --git a/scss/_progress.scss b/scss/_progress.scss index f7491a64b..efbb44034 100644 --- a/scss/_progress.scss +++ b/scss/_progress.scss @@ -5,21 +5,19 @@ .progress { display: flex; + height: $progress-height; overflow: hidden; // force rounded corners by cropping it font-size: $progress-font-size; - line-height: $progress-height; - text-align: center; background-color: $progress-bg; @include border-radius($progress-border-radius); - @include box-shadow($progress-box-shadow); } .progress-bar { - height: $progress-height; - line-height: $progress-height; + display: flex; + align-items: center; + justify-content: center; color: $progress-bar-color; background-color: $progress-bar-bg; - @include transition($progress-bar-transition); } .progress-bar-striped { diff --git a/scss/_reboot.scss b/scss/_reboot.scss index 33fc2d660..7dfc8d317 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -1,4 +1,4 @@ -// scss-lint:disable QualifyingElement, DuplicateProperty, VendorPrefix +// stylelint-disable // Reboot // @@ -18,8 +18,13 @@ // we force a non-overlapping, non-auto-hiding scrollbar to counteract. // 6. Change the default tap highlight to be completely transparent in iOS. -html { +*, +*::before, +*::after { box-sizing: border-box; // 1 +} + +html { font-family: sans-serif; // 2 line-height: 1.15; // 3 -webkit-text-size-adjust: 100%; // 4 @@ -28,12 +33,6 @@ html { -webkit-tap-highlight-color: rgba(0,0,0,0); // 6 } -*, -*::before, -*::after { - box-sizing: inherit; // 1 -} - // IE10+ doesn't honor `<meta name="viewport">` in some cases. @at-root { @-ms-viewport { width: device-width; } @@ -48,6 +47,8 @@ article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, s // // 1. Remove the margin in all browsers. // 2. As a best practice, apply a default `background-color`. +// 3. Set an explicit initial text-align value so that we can later use the +// the `inherit` value on things like `<th>` elements. body { margin: 0; // 1 @@ -56,6 +57,7 @@ body { font-weight: $font-weight-base; line-height: $line-height-base; color: $body-color; + text-align: left; // 3 background-color: $body-bg; // 2 } @@ -91,7 +93,7 @@ hr { // margin for easier control within type scales as it avoids margin collapsing. h1, h2, h3, h4, h5, h6 { margin-top: 0; - margin-bottom: .5rem; + margin-bottom: $headings-margin-bottom; } // Reset margins on paragraphs @@ -100,7 +102,7 @@ h1, h2, h3, h4, h5, h6 { // bottom margin to use `rem` units instead of `em`. p { margin-top: 0; - margin-bottom: 1rem; + margin-bottom: $paragraph-margin-bottom; } // Abbreviations @@ -237,6 +239,9 @@ pre { margin-bottom: 1rem; // Don't allow content to break outside overflow: auto; + // We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so + // we force a non-overlapping, non-auto-hiding scrollbar to counteract. + -ms-overflow-style: scrollbar; } @@ -270,15 +275,15 @@ svg:not(:root) { // DON'T remove the click delay when `<meta name="viewport" content="width=device-width">` is present. // However, they DO support removing the click delay via `touch-action: manipulation`. // See: -// * https://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch -// * http://caniuse.com/#feat=css-touch-action +// * https://getbootstrap.com/docs/4.0/content/reboot/#click-delay-optimization-for-touch +// * https://caniuse.com/#feat=css-touch-action // * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay a, area, button, [role="button"], -input, +input:not([type=range]), label, select, summary, @@ -304,8 +309,9 @@ caption { } th { - // Matches default `<td>` alignment - text-align: left; + // Matches default `<td>` alignment by inheriting from the `<body>`, or the + // closest parent with a set `text-align`. + text-align: inherit; } @@ -319,6 +325,13 @@ label { margin-bottom: .5rem; } +// Remove the default `border-radius` that macOS Chrome adds. +// +// Details at https://github.com/twbs/bootstrap/issues/24093 +button { + border-radius: 0; +} + // Work around a Firefox/IE bug where the transparent `button` background // results in a loss of the default `button` focus styles. // diff --git a/scss/_root.scss b/scss/_root.scss new file mode 100644 index 000000000..78ac03915 --- /dev/null +++ b/scss/_root.scss @@ -0,0 +1,16 @@ +:root { + @each $color, $value in $colors { + --#{$color}: $value; + } + + @each $color, $value in $theme-colors { + --#{$color}: $value; + } + + @each $bp, $value in $grid-breakpoints { + --breakpoint-#{$bp}: $value; + } + + --font-family-sans-serif: $font-family-sans-serif; + --font-family-monospace: $font-family-monospace; +} diff --git a/scss/_tables.scss b/scss/_tables.scss index a652d17c5..32384391e 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -99,32 +99,36 @@ @include table-row-variant(active, $table-active-bg); -// Inverse styles +// Dark styles // // Same table markup, but inverted color scheme: dark background and light text. -.thead-inverse { - th { - color: $table-inverse-color; - background-color: $table-inverse-bg; +.table { + .thead-dark { + th { + color: $table-dark-color; + background-color: $table-dark-bg; + border-color: $table-dark-border-color; + } } -} -.thead-default { - th { - color: $table-head-color; - background-color: $table-head-bg; + .thead-light { + th { + color: $table-head-color; + background-color: $table-head-bg; + border-color: $table-border-color; + } } } -.table-inverse { - color: $table-inverse-color; - background-color: $table-inverse-bg; +.table-dark { + color: $table-dark-color; + background-color: $table-dark-bg; th, td, thead th { - border-color: $table-inverse-border-color; + border-color: $table-dark-border-color; } &.table-bordered { @@ -133,14 +137,14 @@ &.table-striped { tbody tr:nth-of-type(odd) { - background-color: $table-inverse-accent-bg; + background-color: $table-dark-accent-bg; } } &.table-hover { tbody tr { @include hover { - background-color: $table-inverse-hover-bg; + background-color: $table-dark-hover-bg; } } } @@ -149,20 +153,27 @@ // Responsive tables // -// Add `.table-responsive` to `.table`s and we'll make them mobile friendly by -// enabling horizontal scrolling. Only applies <768px. Everything above that -// will display normally. +// Generate series of `.table-responsive-*` classes for configuring the screen +// size of where your table will overflow. .table-responsive { - @include media-breakpoint-down(md) { - display: block; - width: 100%; - overflow-x: auto; - -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 - - // Prevent double border on horizontal scroll due to use of `display: block;` - &.table-bordered { - border: 0; + @each $breakpoint in map-keys($grid-breakpoints) { + $next: breakpoint-next($breakpoint, $grid-breakpoints); + $infix: breakpoint-infix($next, $grid-breakpoints); + + &#{$infix} { + @include media-breakpoint-down($breakpoint) { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 + + // Prevent double border on horizontal scroll due to use of `display: block;` + &.table-bordered { + border: 0; + } + } } } } diff --git a/scss/_transitions.scss b/scss/_transitions.scss index 86c04a5f8..df5744b25 100644 --- a/scss/_transitions.scss +++ b/scss/_transitions.scss @@ -1,3 +1,5 @@ +// stylelint-disable selector-no-qualifying-type + .fade { opacity: 0; @include transition($transition-fade); diff --git a/scss/_type.scss b/scss/_type.scss index 8928341da..b1b8f61cf 100644 --- a/scss/_type.scss +++ b/scss/_type.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important, selector-list-comma-newline-after + // // Headings // diff --git a/scss/_variables.scss b/scss/_variables.scss index e2bacef4a..4e987373c 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -1,53 +1,14 @@ // Variables // -// Copy settings from this file into the provided `_custom.scss` to override -// the Bootstrap defaults without modifying key, versioned files. -// // Variables should follow the `$component-state-property-size` formula for // consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs. -// Table of Contents -// -// Color system -// Options -// Spacing -// Body -// Links -// Grid breakpoints -// Grid containers -// Grid columns -// Fonts -// Components -// Tables -// Buttons -// Forms -// Dropdowns -// Z-index master list -// Navs -// Navbar -// Pagination -// Jumbotron -// Form states and alerts -// Cards -// Tooltips -// Popovers -// Badges -// Modals -// Alerts -// Progress bars -// List group -// Image thumbnails -// Figures -// Breadcrumbs -// Carousel -// Close -// Code - // // Color system // +// stylelint-disable $white: #fff !default; $gray-100: #f8f9fa !default; $gray-200: #e9ecef !default; @@ -60,17 +21,18 @@ $gray-800: #343a40 !default; $gray-900: #212529 !default; $black: #000 !default; -$grays: ( - 100: $gray-100, - 200: $gray-200, - 300: $gray-300, - 400: $gray-400, - 500: $gray-500, - 600: $gray-600, - 700: $gray-700, - 800: $gray-800, - 900: $gray-900 -) !default; +$grays: () !default; +$grays: map-merge(( + "100": $gray-100, + "200": $gray-200, + "300": $gray-300, + "400": $gray-400, + "500": $gray-500, + "600": $gray-600, + "700": $gray-700, + "800": $gray-800, + "900": $gray-900 +), $grays); $blue: #007bff !default; $indigo: #6610f2 !default; @@ -83,32 +45,35 @@ $green: #28a745 !default; $teal: #20c997 !default; $cyan: #17a2b8 !default; -$colors: ( - blue: $blue, - indigo: $indigo, - purple: $purple, - pink: $pink, - red: $red, - orange: $orange, - yellow: $yellow, - green: $green, - teal: $teal, - cyan: $cyan, - white: $white, - gray: $gray-600, - gray-dark: $gray-800 -) !default; - -$theme-colors: ( - primary: $blue, - secondary: $gray-600, - success: $green, - info: $cyan, - warning: $yellow, - danger: $red, - light: $gray-100, - dark: $gray-800 -) !default; +$colors: () !default; +$colors: map-merge(( + "blue": $blue, + "indigo": $indigo, + "purple": $purple, + "pink": $pink, + "red": $red, + "orange": $orange, + "yellow": $yellow, + "green": $green, + "teal": $teal, + "cyan": $cyan, + "white": $white, + "gray": $gray-600, + "gray-dark": $gray-800 +), $colors); + +$theme-colors: () !default; +$theme-colors: map-merge(( + "primary": $blue, + "secondary": $gray-600, + "success": $green, + "info": $cyan, + "warning": $yellow, + "danger": $red, + "light": $gray-100, + "dark": $gray-800 +), $theme-colors); +// stylelint-enable // Set a specific jump point for requesting color jumps $theme-color-interval: 8% !default; @@ -118,6 +83,7 @@ $theme-color-interval: 8% !default; // // Quickly modify global styling by enabling or disabling optional features. +$enable-caret: true !default; $enable-rounded: true !default; $enable-shadows: false !default; $enable-gradients: false !default; @@ -167,6 +133,12 @@ $link-decoration: none !default; $link-hover-color: darken($link-color, 15%) !default; $link-hover-decoration: underline !default; +// Paragraphs +// +// Style p element. + +$paragraph-margin-bottom: 1rem !default; + // Grid breakpoints // @@ -212,6 +184,7 @@ $line-height-lg: 1.5 !default; $line-height-sm: 1.5 !default; $border-width: 1px !default; +$border-color: $gray-200 !default; $border-radius: .25rem !default; $border-radius-lg: .3rem !default; @@ -231,14 +204,17 @@ $transition-collapse: height .35s ease !default; // // Font, line-height, and color for body text, headings, and more. -$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default; -$font-family-monospace: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default; +// stylelint-disable value-keyword-case +$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default; +$font-family-monospace: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default; $font-family-base: $font-family-sans-serif !default; +// stylelint-enable value-keyword-case $font-size-base: 1rem !default; // Assumes the browser default, typically `16px` $font-size-lg: 1.25rem !default; $font-size-sm: .875rem !default; +$font-weight-light: 300 !default; $font-weight-normal: normal !default; $font-weight-bold: bold !default; @@ -312,28 +288,28 @@ $table-border-color: $gray-200 !default; $table-head-bg: $gray-200 !default; $table-head-color: $gray-700 !default; -$table-inverse-bg: $gray-900 !default; -$table-inverse-accent-bg: rgba($white, .05) !default; -$table-inverse-hover-bg: rgba($white, .075) !default; -$table-inverse-border-color: lighten($gray-900, 7.5%) !default; -$table-inverse-color: $body-bg !default; +$table-dark-bg: $gray-900 !default; +$table-dark-accent-bg: rgba($white, .05) !default; +$table-dark-hover-bg: rgba($white, .075) !default; +$table-dark-border-color: lighten($gray-900, 7.5%) !default; +$table-dark-color: $body-bg !default; // Buttons // // For each of Bootstrap's buttons, define text, background and border color. -$input-btn-padding-y: .5rem !default; +$input-btn-padding-y: .375rem !default; $input-btn-padding-x: .75rem !default; -$input-btn-line-height: 1.25 !default; +$input-btn-line-height: $line-height-base !default; $input-btn-padding-y-sm: .25rem !default; $input-btn-padding-x-sm: .5rem !default; -$input-btn-line-height-sm: 1.5 !default; +$input-btn-line-height-sm: $line-height-sm !default; $input-btn-padding-y-lg: .5rem !default; $input-btn-padding-x-lg: 1rem !default; -$input-btn-line-height-lg: 1.5 !default; +$input-btn-line-height-lg: $line-height-lg !default; $btn-font-weight: $font-weight-normal !default; $btn-box-shadow: inset 0 1px 0 rgba($white,.15), 0 1px 1px rgba($black,.075) !default; @@ -349,7 +325,7 @@ $btn-border-radius: $border-radius !default; $btn-border-radius-lg: $border-radius-lg !default; $btn-border-radius-sm: $border-radius-sm !default; -$btn-transition: all .15s ease-in-out !default; +$btn-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; // Forms @@ -358,7 +334,7 @@ $input-bg: $white !default; $input-disabled-bg: $gray-200 !default; $input-color: $gray-700 !default; -$input-border-color: rgba($black,.15) !default; +$input-border-color: $gray-400 !default; $input-btn-border-width: $border-width !default; // For form controls and buttons $input-box-shadow: inset 0 1px 1px rgba($black,.075) !default; @@ -381,7 +357,7 @@ $input-height: calc(#{$input-height-inner} + #{$input-height-bo $input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default; $input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default; -$input-height-inner-lg: ($font-size-sm * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default; +$input-height-inner-lg: ($font-size-lg * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default; $input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default; $input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default; @@ -397,6 +373,7 @@ $form-check-inline-margin-x: .75rem !default; $form-group-margin-bottom: 1rem !default; +$input-group-addon-color: $input-color !default; $input-group-addon-bg: $gray-200 !default; $input-group-addon-border-color: $input-border-color !default; @@ -434,8 +411,8 @@ $custom-radio-indicator-border-radius: 50% !default; $custom-radio-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E"), "#", "%23") !default; $custom-select-padding-y: .375rem !default; -$custom-select-padding-x: .75rem !default; -$custom-select-height: $input-height !default; +$custom-select-padding-x: .75rem !default; +$custom-select-height: $input-height !default; $custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator $custom-select-line-height: $input-btn-line-height !default; $custom-select-color: $input-color !default; @@ -455,21 +432,21 @@ $custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px r $custom-select-font-size-sm: 75% !default; $custom-select-height-sm: $input-height-sm !default; -$custom-file-height: 2.5rem !default; +$custom-file-height: $input-height !default; $custom-file-width: 14rem !default; $custom-file-focus-box-shadow: 0 0 0 .075rem $white, 0 0 0 .2rem theme-color("primary") !default; -$custom-file-padding-y: 1rem !default; -$custom-file-padding-x: .5rem !default; -$custom-file-line-height: 1.5 !default; -$custom-file-color: $gray-700 !default; -$custom-file-bg: $white !default; -$custom-file-border-width: $border-width !default; +$custom-file-padding-y: $input-btn-padding-y !default; +$custom-file-padding-x: $input-btn-padding-x !default; +$custom-file-line-height: $input-btn-line-height !default; +$custom-file-color: $input-color !default; +$custom-file-bg: $input-bg !default; +$custom-file-border-width: $input-btn-border-width !default; $custom-file-border-color: $input-border-color !default; -$custom-file-border-radius: $border-radius !default; -$custom-file-box-shadow: inset 0 .2rem .4rem rgba($black,.05) !default; +$custom-file-border-radius: $input-border-radius !default; +$custom-file-box-shadow: $input-box-shadow !default; $custom-file-button-color: $custom-file-color !default; -$custom-file-button-bg: $gray-200 !default; +$custom-file-button-bg: $input-group-addon-bg !default; $custom-file-text: ( placeholder: ( en: "Choose file..." @@ -612,7 +589,7 @@ $jumbotron-bg: $gray-200 !default; $card-spacer-y: .75rem !default; $card-spacer-x: 1.25rem !default; -$card-border-width: 1px !default; +$card-border-width: $border-width !default; $card-border-radius: $border-radius !default; $card-border-color: rgba($black,.125) !default; $card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default; @@ -621,7 +598,8 @@ $card-bg: $white !default; $card-img-overlay-padding: 1.25rem !default; -$card-deck-margin: ($grid-gutter-width / 2) !default; +$card-group-margin: ($grid-gutter-width / 2) !default; +$card-deck-margin: $card-group-margin !default; $card-columns-count: 3 !default; $card-columns-gap: 1.25rem !default; @@ -672,11 +650,11 @@ $popover-arrow-outer-color: fade-in($popover-border-color, .05) !defau // Badges -$badge-color: $white !default; $badge-font-size: 75% !default; $badge-font-weight: $font-weight-bold !default; $badge-padding-y: .25em !default; $badge-padding-x: .4em !default; +$badge-border-radius: $border-radius !default; $badge-pill-padding-x: .6em !default; // Use a higher than normal value to ensure completely rounded edges when @@ -787,6 +765,8 @@ $breadcrumb-padding-y: .75rem !default; $breadcrumb-padding-x: 1rem !default; $breadcrumb-item-padding: .5rem !default; +$breadcrumb-margin-bottom: 1rem !default; + $breadcrumb-bg: $gray-200 !default; $breadcrumb-divider-color: $gray-600 !default; $breadcrumb-active-color: $gray-600 !default; diff --git a/scss/bootstrap-grid.scss b/scss/bootstrap-grid.scss index 4b2bddd5d..022ab91d8 100644 --- a/scss/bootstrap-grid.scss +++ b/scss/bootstrap-grid.scss @@ -8,7 +8,7 @@ // @at-root { - @-ms-viewport { width: device-width; } + @-ms-viewport { width: device-width; } // stylelint-disable-line at-rule-no-vendor-prefix } html { diff --git a/scss/bootstrap.scss b/scss/bootstrap.scss index 3bc8001fa..f83914dc3 100644 --- a/scss/bootstrap.scss +++ b/scss/bootstrap.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com) + * Bootstrap v4.0.0-beta (https://getbootstrap.com) * Copyright 2011-2017 The Bootstrap Authors * Copyright 2011-2017 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) @@ -8,6 +8,7 @@ @import "functions"; @import "variables"; @import "mixins"; +@import "root"; @import "print"; @import "reboot"; @import "type"; diff --git a/scss/mixins/_background-variant.scss b/scss/mixins/_background-variant.scss index 54a734dcc..5860d7384 100644 --- a/scss/mixins/_background-variant.scss +++ b/scss/mixins/_background-variant.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // Contextual backgrounds @mixin bg-variant($parent, $color) { diff --git a/scss/mixins/_breakpoints.scss b/scss/mixins/_breakpoints.scss index 8d7378d36..a9866bd90 100644 --- a/scss/mixins/_breakpoints.scss +++ b/scss/mixins/_breakpoints.scss @@ -81,8 +81,18 @@ $min: breakpoint-min($lower, $breakpoints); $max: breakpoint-max($upper, $breakpoints); - @media (min-width: $min) and (max-width: $max) { - @content; + @if $min != null and $max != null { + @media (min-width: $min) and (max-width: $max) { + @content; + } + } @else if $max == null { + @include media-breakpoint-up($lower) { + @content; + } + } @else if $min == null { + @include media-breakpoint-down($upper) { + @content; + } } } @@ -98,8 +108,12 @@ @content; } } @else if $max == null { - @include media-breakpoint-up($name) + @include media-breakpoint-up($name) { + @content; + } } @else if $min == null { - @include media-breakpoint-down($name) + @include media-breakpoint-down($name) { + @content; + } } } diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss index f7ec5764e..44ce4f72e 100644 --- a/scss/mixins/_buttons.scss +++ b/scss/mixins/_buttons.scss @@ -9,8 +9,8 @@ border-color: $border; @include box-shadow($btn-box-shadow); - &:hover { - @include color-yiq($background); + @include hover { + @include color-yiq($active-background); background-color: $active-background; border-color: $active-border; } diff --git a/scss/mixins/_caret.scss b/scss/mixins/_caret.scss new file mode 100644 index 000000000..daab9d03c --- /dev/null +++ b/scss/mixins/_caret.scss @@ -0,0 +1,35 @@ +@mixin caret-down { + border-top: $caret-width solid; + border-right: $caret-width solid transparent; + border-bottom: 0; + border-left: $caret-width solid transparent; +} + +@mixin caret-up { + border-top: 0; + border-right: $caret-width solid transparent; + border-bottom: $caret-width solid; + border-left: $caret-width solid transparent; +} + +@mixin caret($direction: down) { + @if $enable-caret { + &::after { + display: inline-block; + width: 0; + height: 0; + margin-left: $caret-width * .85; + vertical-align: $caret-width * .85; + content: ""; + @if $direction == down { + @include caret-down; + } @else if $direction == up { + @include caret-up; + } + } + + &:empty::after { + margin-left: 0; + } + } +} diff --git a/scss/mixins/_float.scss b/scss/mixins/_float.scss index b43116fa6..48fa8b6d5 100644 --- a/scss/mixins/_float.scss +++ b/scss/mixins/_float.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + @mixin float-left { float: left !important; } diff --git a/scss/mixins/_forms.scss b/scss/mixins/_forms.scss index 4a1e0bc31..6403f469d 100644 --- a/scss/mixins/_forms.scss +++ b/scss/mixins/_forms.scss @@ -1,7 +1,7 @@ // Form control focus state // // Generate a customized focus state and for any input with the specified color, -// which defaults to the `@input-border-color-focus` variable. +// which defaults to the `$input-focus-border-color` variable. // // We highly encourage you to not customize the default value, but instead use // this to tweak colors on an as-needed basis. This aesthetic change is based on @@ -23,6 +23,28 @@ @mixin form-validation-state($state, $color) { + .#{$state}-feedback { + display: none; + margin-top: .25rem; + font-size: .875rem; + color: $color; + } + + .#{$state}-tooltip { + position: absolute; + top: 100%; + z-index: 5; + display: none; + width: 250px; + padding: .5rem; + margin-top: .1rem; + font-size: .875rem; + line-height: 1; + color: #fff; + background-color: rgba($color,.8); + border-radius: .2rem; + } + .form-control, .custom-select { .was-validated &:#{$state}, @@ -33,8 +55,8 @@ box-shadow: 0 0 0 .2rem rgba($color,.25); } - ~ .invalid-feedback, - ~ .invalid-tooltip { + ~ .#{$state}-feedback, + ~ .#{$state}-tooltip { display: block; } } diff --git a/scss/mixins/_grid-framework.scss b/scss/mixins/_grid-framework.scss index d8195ddfa..41bdf4646 100644 --- a/scss/mixins/_grid-framework.scss +++ b/scss/mixins/_grid-framework.scss @@ -10,7 +10,7 @@ width: 100%; min-height: 1px; // Prevent columns from collapsing when empty padding-right: ($gutter / 2); - padding-left: ($gutter / 2); + padding-left: ($gutter / 2); } @each $breakpoint in map-keys($breakpoints) { @@ -46,11 +46,24 @@ } } + .order#{$infix}-first { + order: -1; + } + @for $i from 1 through $columns { .order#{$infix}-#{$i} { order: $i; } } + + // `$columns - 1` because offsetting by the width of an entire row isn't possible + @for $i from 0 through ($columns - 1) { + @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0 + .offset#{$infix}-#{$i} { + @include make-col-offset($i, $columns); + } + } + } } } } diff --git a/scss/mixins/_grid.scss b/scss/mixins/_grid.scss index 67dbcd38e..b5612e922 100644 --- a/scss/mixins/_grid.scss +++ b/scss/mixins/_grid.scss @@ -3,11 +3,11 @@ // Generate semantic grid columns with these mixins. @mixin make-container() { + width: 100%; + padding-right: ($grid-gutter-width / 2); + padding-left: ($grid-gutter-width / 2); margin-right: auto; margin-left: auto; - padding-right: ($grid-gutter-width / 2); - padding-left: ($grid-gutter-width / 2); - width: 100%; } @@ -24,7 +24,7 @@ display: flex; flex-wrap: wrap; margin-right: ($grid-gutter-width / -2); - margin-left: ($grid-gutter-width / -2); + margin-left: ($grid-gutter-width / -2); } @mixin make-col-ready() { @@ -35,7 +35,7 @@ width: 100%; min-height: 1px; // Prevent collapsing padding-right: ($grid-gutter-width / 2); - padding-left: ($grid-gutter-width / 2); + padding-left: ($grid-gutter-width / 2); } @mixin make-col($size, $columns: $grid-columns) { @@ -45,3 +45,7 @@ // do not appear to require this. max-width: percentage($size / $columns); } + +@mixin make-col-offset($size, $columns: $grid-columns) { + margin-left: percentage($size / $columns); +} diff --git a/scss/mixins/_hover.scss b/scss/mixins/_hover.scss index 4aa4b1d5d..fd2f1e2cd 100644 --- a/scss/mixins/_hover.scss +++ b/scss/mixins/_hover.scss @@ -1,3 +1,4 @@ +// stylelint-disable indentation @mixin hover { // TODO: re-enable along with mq4-hover-shim // @if $enable-hover-media-query { @@ -8,21 +9,21 @@ // } // } // @else { -// scss-lint:disable Indentation - &:hover { @content } -// scss-lint:enable Indentation + &:hover { @content; } // } } @mixin hover-focus { @if $enable-hover-media-query { - &:focus { @content } - @include hover { @content } + &:focus { + @content; + } + @include hover { @content; } } @else { &:focus, &:hover { - @content + @content; } } } @@ -31,14 +32,14 @@ @if $enable-hover-media-query { &, &:focus { - @content + @content; } - @include hover { @content } + @include hover { @content; } } @else { &, &:focus, &:hover { - @content + @content; } } } @@ -47,14 +48,14 @@ @if $enable-hover-media-query { &:focus, &:active { - @content + @content; } - @include hover { @content } + @include hover { @content; } } @else { &:focus, &:active, &:hover { - @content + @content; } } } diff --git a/scss/mixins/_image.scss b/scss/mixins/_image.scss index c2b45f2ce..0544f0d2a 100644 --- a/scss/mixins/_image.scss +++ b/scss/mixins/_image.scss @@ -20,15 +20,15 @@ // // Short retina mixin for setting background-image and -size. +// stylelint-disable indentation, media-query-list-comma-newline-after @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { background-image: url($file-1x); // Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio, // but doesn't convert dppx=>dpi. // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard. - // Compatibility info: http://caniuse.com/#feat=css-media-resolution - @media - only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx + // Compatibility info: https://caniuse.com/#feat=css-media-resolution + @media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx only screen and (min-resolution: 2dppx) { // Standardized background-image: url($file-2x); background-size: $width-1x $height-1x; diff --git a/scss/mixins/_list-group.scss b/scss/mixins/_list-group.scss index ba27b5041..278787bbe 100644 --- a/scss/mixins/_list-group.scss +++ b/scss/mixins/_list-group.scss @@ -6,7 +6,6 @@ background-color: $background; } - //scss-lint:disable QualifyingElement a.list-group-item-#{$state}, button.list-group-item-#{$state} { color: $color; @@ -22,5 +21,4 @@ border-color: $color; } } - // scss-lint:enable QualifyingElement } diff --git a/scss/mixins/_navbar-align.scss b/scss/mixins/_navbar-align.scss index c454a4ffe..b35166033 100644 --- a/scss/mixins/_navbar-align.scss +++ b/scss/mixins/_navbar-align.scss @@ -1,7 +1,8 @@ // Navbar vertical align // // Vertically center elements in the navbar. -// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. +// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` +// to calculate the appropriate top margin. // @mixin navbar-vertical-align($element-height) { // margin-top: (($navbar-height - $element-height) / 2); diff --git a/scss/mixins/_reset-text.scss b/scss/mixins/_reset-text.scss index 4cf9e79c7..71edb0061 100644 --- a/scss/mixins/_reset-text.scss +++ b/scss/mixins/_reset-text.scss @@ -1,4 +1,3 @@ -// scss-lint:disable DuplicateProperty @mixin reset-text { font-family: $font-family-base; // We deliberately do NOT reset font-size or word-wrap. @@ -6,7 +5,7 @@ font-weight: $font-weight-normal; line-height: $line-height-base; text-align: left; // Fallback for where `start` is not supported - text-align: start; + text-align: start; // stylelint-disable-line declaration-block-no-duplicate-properties text-decoration: none; text-shadow: none; text-transform: none; diff --git a/scss/mixins/_screen-reader.scss b/scss/mixins/_screen-reader.scss index a5fa51c5c..31fb68ab9 100644 --- a/scss/mixins/_screen-reader.scss +++ b/scss/mixins/_screen-reader.scss @@ -1,7 +1,7 @@ // Only display content to screen readers // -// See: http://a11yproject.com/posts/how-to-hide-content -// See: http://hugogiraudel.com/2016/10/13/css-hide-and-seek/ +// See: http://a11yproject.com/posts/how-to-hide-content/ +// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/ @mixin sr-only { position: absolute; diff --git a/scss/mixins/_text-emphasis.scss b/scss/mixins/_text-emphasis.scss index 9cd4b6a4f..58db3e0fc 100644 --- a/scss/mixins/_text-emphasis.scss +++ b/scss/mixins/_text-emphasis.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // Typography @mixin text-emphasis-variant($parent, $color) { diff --git a/scss/mixins/_visibility.scss b/scss/mixins/_visibility.scss index f67fc1c52..fe523d0ee 100644 --- a/scss/mixins/_visibility.scss +++ b/scss/mixins/_visibility.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // Visibility @mixin invisible($visibility) { diff --git a/scss/utilities/_align.scss b/scss/utilities/_align.scss index 4dbbbc2db..8b7df9f76 100644 --- a/scss/utilities/_align.scss +++ b/scss/utilities/_align.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + .align-baseline { vertical-align: baseline !important; } // Browser default .align-top { vertical-align: top !important; } .align-middle { vertical-align: middle !important; } diff --git a/scss/utilities/_background.scss b/scss/utilities/_background.scss index 1ef34fd8e..3d2e07d69 100644 --- a/scss/utilities/_background.scss +++ b/scss/utilities/_background.scss @@ -1,6 +1,13 @@ +// stylelint-disable declaration-no-important + @each $color, $value in $theme-colors { - @include bg-variant('.bg-#{$color}', $value); + @include bg-variant(".bg-#{$color}", $value); +} + +.bg-white { + background-color: $white !important; } -.bg-white { background-color: $white !important; } -.bg-transparent { background-color: transparent !important; } +.bg-transparent { + background-color: transparent !important; +} diff --git a/scss/utilities/_borders.scss b/scss/utilities/_borders.scss index 82e177c80..ba02f0456 100644 --- a/scss/utilities/_borders.scss +++ b/scss/utilities/_borders.scss @@ -1,8 +1,10 @@ +// stylelint-disable declaration-no-important + // // Border // -.border { border: 1px solid $gray-200 !important; } +.border { border: $border-width solid $border-color !important; } .border-0 { border: 0 !important; } .border-top-0 { border-top: 0 !important; } .border-right-0 { border-right: 0 !important; } @@ -44,9 +46,9 @@ } .rounded-circle { - border-radius: 50%; + border-radius: 50% !important; } .rounded-0 { - border-radius: 0; + border-radius: 0 !important; } diff --git a/scss/utilities/_display.scss b/scss/utilities/_display.scss index 45353620a..893b6387c 100644 --- a/scss/utilities/_display.scss +++ b/scss/utilities/_display.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // // Utilities for common `display` values // @@ -11,6 +13,7 @@ .d#{$infix}-inline-block { display: inline-block !important; } .d#{$infix}-block { display: block !important; } .d#{$infix}-table { display: table !important; } + .d#{$infix}-table-row { display: table-row !important; } .d#{$infix}-table-cell { display: table-cell !important; } .d#{$infix}-flex { display: flex !important; } .d#{$infix}-inline-flex { display: inline-flex !important; } diff --git a/scss/utilities/_flex.scss b/scss/utilities/_flex.scss index b28c0b97d..8e4703843 100644 --- a/scss/utilities/_flex.scss +++ b/scss/utilities/_flex.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // Flex variation // // Custom styles for additional flex alignment options. diff --git a/scss/utilities/_position.scss b/scss/utilities/_position.scss index 74b8d39e7..ef962eddb 100644 --- a/scss/utilities/_position.scss +++ b/scss/utilities/_position.scss @@ -1,4 +1,15 @@ -// Positioning +// stylelint-disable declaration-no-important + +// Common values + +// Sass list not in variables since it's not intended for customization. +$positions: static, relative, absolute, fixed, sticky; + +@each $position in $positions { + .position-#{$position} { position: $position !important; } +} + +// Shorthand .fixed-top { position: fixed; diff --git a/scss/utilities/_sizing.scss b/scss/utilities/_sizing.scss index a7dc3e49b..e95a4db36 100644 --- a/scss/utilities/_sizing.scss +++ b/scss/utilities/_sizing.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // Width and height @each $prop, $abbrev in (width: w, height: h) { diff --git a/scss/utilities/_spacing.scss b/scss/utilities/_spacing.scss index c89816b5e..b2e2354b1 100644 --- a/scss/utilities/_spacing.scss +++ b/scss/utilities/_spacing.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // Margin and Padding @each $breakpoint in map-keys($grid-breakpoints) { @@ -7,35 +9,43 @@ @each $prop, $abbrev in (margin: m, padding: p) { @each $size, $length in $spacers { - .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; } - .#{$abbrev}t#{$infix}-#{$size} { #{$prop}-top: $length !important; } - .#{$abbrev}r#{$infix}-#{$size} { #{$prop}-right: $length !important; } - .#{$abbrev}b#{$infix}-#{$size} { #{$prop}-bottom: $length !important; } - .#{$abbrev}l#{$infix}-#{$size} { #{$prop}-left: $length !important; } + .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; } + .#{$abbrev}t#{$infix}-#{$size}, + .#{$abbrev}y#{$infix}-#{$size} { + #{$prop}-top: $length !important; + } + .#{$abbrev}r#{$infix}-#{$size}, .#{$abbrev}x#{$infix}-#{$size} { #{$prop}-right: $length !important; - #{$prop}-left: $length !important; } + .#{$abbrev}b#{$infix}-#{$size}, .#{$abbrev}y#{$infix}-#{$size} { - #{$prop}-top: $length !important; #{$prop}-bottom: $length !important; } + .#{$abbrev}l#{$infix}-#{$size}, + .#{$abbrev}x#{$infix}-#{$size} { + #{$prop}-left: $length !important; + } } } // Some special margin utils - .m#{$infix}-auto { margin: auto !important; } - .mt#{$infix}-auto { margin-top: auto !important; } - .mr#{$infix}-auto { margin-right: auto !important; } - .mb#{$infix}-auto { margin-bottom: auto !important; } - .ml#{$infix}-auto { margin-left: auto !important; } + .m#{$infix}-auto { margin: auto !important; } + .mt#{$infix}-auto, + .my#{$infix}-auto { + margin-top: auto !important; + } + .mr#{$infix}-auto, .mx#{$infix}-auto { margin-right: auto !important; - margin-left: auto !important; } + .mb#{$infix}-auto, .my#{$infix}-auto { - margin-top: auto !important; margin-bottom: auto !important; } + .ml#{$infix}-auto, + .mx#{$infix}-auto { + margin-left: auto !important; + } } } diff --git a/scss/utilities/_text.scss b/scss/utilities/_text.scss index d337e0d63..f4b6e65e5 100644 --- a/scss/utilities/_text.scss +++ b/scss/utilities/_text.scss @@ -1,3 +1,5 @@ +// stylelint-disable declaration-no-important + // // Text // @@ -28,16 +30,17 @@ // 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-light { font-weight: $font-weight-light !important; } +.font-weight-normal { font-weight: $font-weight-normal !important; } +.font-weight-bold { font-weight: $font-weight-bold !important; } +.font-italic { font-style: italic !important; } // Contextual colors .text-white { color: #fff !important; } @each $color, $value in $theme-colors { - @include text-emphasis-variant('.text-#{$color}', $value); + @include text-emphasis-variant(".text-#{$color}", $value); } .text-muted { color: $text-muted !important; } |
