diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2017-12-29 04:59:01 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2017-12-29 04:59:01 +0300 |
commit | 2bb5568533f77bfbeb6ca50ec3a464a69a238bde (patch) | |
tree | 0ab4271cf951fd6df69c143991d6b7a109bda575 /assets/stylesheets | |
parent | 5ae93e717519e910360350e6c0396efae8aff716 (diff) |
rake update[v4-dev]
Diffstat (limited to 'assets/stylesheets')
33 files changed, 769 insertions, 688 deletions
diff --git a/assets/stylesheets/_bootstrap-grid.scss b/assets/stylesheets/_bootstrap-grid.scss index 34b4fd9..94d40a4 100644 --- a/assets/stylesheets/_bootstrap-grid.scss +++ b/assets/stylesheets/_bootstrap-grid.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap Grid v4.0.0-beta.2 (https://getbootstrap.com) + * Bootstrap Grid v4.0.0-beta.3 (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) diff --git a/assets/stylesheets/_bootstrap-reboot.scss b/assets/stylesheets/_bootstrap-reboot.scss index 976e7e7..b285bc7 100644 --- a/assets/stylesheets/_bootstrap-reboot.scss +++ b/assets/stylesheets/_bootstrap-reboot.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap Reboot v4.0.0-beta.2 (https://getbootstrap.com) + * Bootstrap Reboot v4.0.0-beta.3 (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) diff --git a/assets/stylesheets/_bootstrap.scss b/assets/stylesheets/_bootstrap.scss index ccc5186..966cb67 100644 --- a/assets/stylesheets/_bootstrap.scss +++ b/assets/stylesheets/_bootstrap.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap v4.0.0-beta.2 (https://getbootstrap.com) + * Bootstrap v4.0.0-beta.3 (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) @@ -9,7 +9,6 @@ @import "bootstrap/variables"; @import "bootstrap/mixins"; @import "bootstrap/root"; -@import "bootstrap/print"; @import "bootstrap/reboot"; @import "bootstrap/type"; @import "bootstrap/images"; @@ -40,3 +39,4 @@ @import "bootstrap/popover"; @import "bootstrap/carousel"; @import "bootstrap/utilities"; +@import "bootstrap/print"; diff --git a/assets/stylesheets/bootstrap/_alert.scss b/assets/stylesheets/bootstrap/_alert.scss index c2d5c81..dd43e23 100644 --- a/assets/stylesheets/bootstrap/_alert.scss +++ b/assets/stylesheets/bootstrap/_alert.scss @@ -46,6 +46,6 @@ @each $color, $value in $theme-colors { .alert-#{$color} { - @include alert-variant(theme-color-level($color, -10), theme-color-level($color, -9), theme-color-level($color, 6)); + @include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level)); } } diff --git a/assets/stylesheets/bootstrap/_button-group.scss b/assets/stylesheets/bootstrap/_button-group.scss index 12d4982..c1b8265 100644 --- a/assets/stylesheets/bootstrap/_button-group.scss +++ b/assets/stylesheets/bootstrap/_button-group.scss @@ -28,7 +28,7 @@ .btn + .btn-group, .btn-group + .btn, .btn-group + .btn-group { - margin-left: -$input-btn-border-width; + margin-left: -$btn-border-width; } } @@ -44,46 +44,18 @@ } .btn-group { - > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { - 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 > .btn:first-child { margin-left: 0; - - &:not(:last-child):not(.dropdown-toggle) { - @include border-right-radius(0); - } - } - - - // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu - // immediately after it - > .btn:last-child:not(:first-child), - > .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) - > .btn-group { - float: left; - } - - > .btn-group:not(:first-child):not(:last-child) > .btn { - border-radius: 0; } - > .btn-group:first-child:not(:last-child) { - > .btn:last-child, - > .dropdown-toggle { - @include border-right-radius(0); - } + // Reset rounded corners + > .btn:not(:last-child):not(.dropdown-toggle), + > .btn-group:not(:last-child) > .btn { + @include border-right-radius(0); } - > .btn-group:last-child:not(:first-child) > .btn:first-child { + > .btn:not(:first-child), + > .btn-group:not(:first-child) > .btn { @include border-left-radius(0); } } @@ -100,9 +72,9 @@ // Split button dropdowns // -.btn + .dropdown-toggle-split { - padding-right: $input-btn-padding-x * .75; - padding-left: $input-btn-padding-x * .75; +.dropdown-toggle-split { + padding-right: $btn-padding-x * .75; + padding-left: $btn-padding-x * .75; &::after { margin-left: 0; @@ -110,13 +82,13 @@ } .btn-sm + .dropdown-toggle-split { - padding-right: $input-btn-padding-x-sm * .75; - padding-left: $input-btn-padding-x-sm * .75; + padding-right: $btn-padding-x-sm * .75; + padding-left: $btn-padding-x-sm * .75; } .btn-lg + .dropdown-toggle-split { - padding-right: $input-btn-padding-x-lg * .75; - padding-left: $input-btn-padding-x-lg * .75; + padding-right: $btn-padding-x-lg * .75; + padding-left: $btn-padding-x-lg * .75; } @@ -150,36 +122,18 @@ > .btn + .btn-group, > .btn-group + .btn, > .btn-group + .btn-group { - margin-top: -$input-btn-border-width; + margin-top: -$btn-border-width; margin-left: 0; } - > .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; - } - - > .btn-group:first-child:not(:last-child) { - > .btn:last-child, - > .dropdown-toggle { - @include border-bottom-radius(0); - } + // Reset rounded corners + > .btn:not(:last-child):not(.dropdown-toggle), + > .btn-group:not(:last-child) > .btn { + @include border-bottom-radius(0); } - > .btn-group:last-child:not(:first-child) > .btn:first-child { + > .btn:not(:first-child), + > .btn-group:not(:first-child) > .btn { @include border-top-radius(0); } } @@ -197,7 +151,7 @@ // See https://github.com/twbs/bootstrap/pull/12794 and // https://github.com/twbs/bootstrap/pull/14559 for more information. -[data-toggle="buttons"] { +.btn-group-toggle { > .btn, > .btn-group > .btn { margin-bottom: 0; // Override default `<label>` value diff --git a/assets/stylesheets/bootstrap/_buttons.scss b/assets/stylesheets/bootstrap/_buttons.scss index 16a478e..3a5f5ee 100644 --- a/assets/stylesheets/bootstrap/_buttons.scss +++ b/assets/stylesheets/bootstrap/_buttons.scss @@ -11,31 +11,41 @@ white-space: nowrap; vertical-align: middle; user-select: none; - border: $input-btn-border-width solid transparent; - @include button-size($input-btn-padding-y, $input-btn-padding-x, $font-size-base, $input-btn-line-height, $btn-border-radius); + border: $btn-border-width solid transparent; + @include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-line-height, $btn-border-radius); @include transition($btn-transition); // Share hover and focus styles @include hover-focus { text-decoration: none; } + &:focus, &.focus { outline: 0; - box-shadow: $input-btn-focus-box-shadow; + box-shadow: $btn-focus-box-shadow; } // Disabled comes first so active can properly restyle &.disabled, &:disabled { - opacity: .65; + opacity: $btn-disabled-opacity; @include box-shadow(none); } + // Opinionated: add "hand" cursor to non-disabled .btn elements + &:not([disabled]):not(.disabled) { + cursor: pointer; + } + &:not([disabled]):not(.disabled):active, &:not([disabled]):not(.disabled).active { background-image: none; - @include box-shadow($input-btn-focus-box-shadow, $btn-active-box-shadow); + @include box-shadow($btn-active-box-shadow); + + &:focus { + @include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow); + } } } @@ -86,6 +96,7 @@ fieldset[disabled] a.btn { &:focus, &.focus { + text-decoration: $link-hover-decoration; border-color: transparent; box-shadow: none; } @@ -104,11 +115,11 @@ fieldset[disabled] a.btn { // .btn-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); + @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $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, $input-btn-line-height-sm, $btn-border-radius-sm); + @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-line-height-sm, $btn-border-radius-sm); } diff --git a/assets/stylesheets/bootstrap/_card.scss b/assets/stylesheets/bootstrap/_card.scss index a3a435a..4c4845c 100644 --- a/assets/stylesheets/bootstrap/_card.scss +++ b/assets/stylesheets/bootstrap/_card.scss @@ -172,14 +172,17 @@ display: flex; flex-direction: column; - .card { + // The child selector allows nested `.card` within `.card-group` + // to display properly. + > .card { margin-bottom: $card-group-margin; } @include media-breakpoint-up(sm) { flex-flow: row wrap; - - .card { + // The child selector allows nested `.card` within `.card-group` + // to display properly. + > .card { // Flexbugs #4: https://github.com/philipwalton/flexbugs#4-flex-shorthand-declarations-with-unitless-flex-basis-values-are-ignored flex: 1 0 0%; margin-bottom: 0; diff --git a/assets/stylesheets/bootstrap/_close.scss b/assets/stylesheets/bootstrap/_close.scss index 897d486..f1763cc 100644 --- a/assets/stylesheets/bootstrap/_close.scss +++ b/assets/stylesheets/bootstrap/_close.scss @@ -12,6 +12,11 @@ text-decoration: none; opacity: .75; } + + // Opinionated: add "hand" cursor to non-disabled .close elements + &:not([disabled]):not(.disabled) { + cursor: pointer; + } } // Additional properties for button version @@ -22,7 +27,7 @@ // stylelint-disable property-no-vendor-prefix, selector-no-qualifying-type button.close { padding: 0; - background: transparent; + background-color: transparent; border: 0; -webkit-appearance: none; } diff --git a/assets/stylesheets/bootstrap/_code.scss b/assets/stylesheets/bootstrap/_code.scss index a9fe624..9de20fa 100644 --- a/assets/stylesheets/bootstrap/_code.scss +++ b/assets/stylesheets/bootstrap/_code.scss @@ -8,24 +8,20 @@ samp { // Inline code code { - padding: $code-padding-y $code-padding-x; font-size: $code-font-size; color: $code-color; - background-color: $code-bg; - @include border-radius($border-radius); + word-break: break-word; // Streamline the style when inside anchors to avoid broken underline and more a > & { - padding: 0; color: inherit; - background-color: inherit; } } // User input typically entered via keyboard kbd { - padding: $code-padding-y $code-padding-x; - font-size: $code-font-size; + padding: $kbd-padding-y $kbd-padding-x; + font-size: $kbd-font-size; color: $kbd-color; background-color: $kbd-bg; @include border-radius($border-radius-sm); @@ -47,11 +43,9 @@ pre { // Account for some code outputs that place code tags in pre tags code { - padding: 0; font-size: inherit; color: inherit; - background-color: transparent; - @include border-radius(0); + word-break: normal; } } diff --git a/assets/stylesheets/bootstrap/_custom-forms.scss b/assets/stylesheets/bootstrap/_custom-forms.scss index a521dbd..d99a86d 100644 --- a/assets/stylesheets/bootstrap/_custom-forms.scss +++ b/assets/stylesheets/bootstrap/_custom-forms.scss @@ -9,9 +9,13 @@ .custom-control { position: relative; - display: inline-flex; + display: block; min-height: (1rem * $line-height-base); padding-left: $custom-control-gutter; +} + +.custom-control-inline { + display: inline-flex; margin-right: $custom-control-spacer-x; } @@ -20,71 +24,98 @@ z-index: -1; // Put the input behind the label so it doesn't overlay text opacity: 0; - &:checked ~ .custom-control-indicator { + &:checked ~ .custom-control-label::before { color: $custom-control-indicator-checked-color; @include gradient-bg($custom-control-indicator-checked-bg); @include box-shadow($custom-control-indicator-checked-box-shadow); } - &:focus ~ .custom-control-indicator { + &:focus ~ .custom-control-label::before { // the mixin is not used here to make sure there is feedback box-shadow: $custom-control-indicator-focus-box-shadow; } - &:active ~ .custom-control-indicator { + &:active ~ .custom-control-label::before { color: $custom-control-indicator-active-color; - @include gradient-bg($custom-control-indicator-active-bg); + background-color: $custom-control-indicator-active-bg; @include box-shadow($custom-control-indicator-active-box-shadow); } &:disabled { - ~ .custom-control-indicator { - background-color: $custom-control-indicator-disabled-bg; - } + ~ .custom-control-label { + color: $custom-control-label-disabled-color; - ~ .custom-control-description { - color: $custom-control-description-disabled-color; + &::before { + background-color: $custom-control-indicator-disabled-bg; + } } } } -// Custom indicator +// Custom control indicators // -// Generates a shadow element to create our makeshift checkbox/radio background. +// Build the custom controls out of psuedo-elements. -.custom-control-indicator { - position: absolute; - top: (($line-height-base - $custom-control-indicator-size) / 2); - left: 0; - display: block; - width: $custom-control-indicator-size; - height: $custom-control-indicator-size; - pointer-events: none; - user-select: none; - background-color: $custom-control-indicator-bg; - background-repeat: no-repeat; - background-position: center center; - background-size: $custom-control-indicator-bg-size; - @include box-shadow($custom-control-indicator-box-shadow); +.custom-control-label { + margin-bottom: 0; + + // Background-color and (when enabled) gradient + &::before { + position: absolute; + top: (($line-height-base - $custom-control-indicator-size) / 2); + left: 0; + display: block; + width: $custom-control-indicator-size; + height: $custom-control-indicator-size; + pointer-events: none; + content: ""; + user-select: none; + background-color: $custom-control-indicator-bg; + @include box-shadow($custom-control-indicator-box-shadow); + } + + // Foreground (icon) + &::after { + position: absolute; + top: (($line-height-base - $custom-control-indicator-size) / 2); + left: 0; + display: block; + width: $custom-control-indicator-size; + height: $custom-control-indicator-size; + content: ""; + background-repeat: no-repeat; + background-position: center center; + background-size: $custom-control-indicator-bg-size; + } } + // Checkboxes // // Tweak just a few things for checkboxes. .custom-checkbox { - .custom-control-indicator { + .custom-control-label::before { @include border-radius($custom-checkbox-indicator-border-radius); } - .custom-control-input:checked ~ .custom-control-indicator { - background-image: $custom-checkbox-indicator-icon-checked; + .custom-control-input:checked ~ .custom-control-label { + &::before { + @include gradient-bg($custom-control-indicator-checked-bg); + } + &::after { + background-image: $custom-checkbox-indicator-icon-checked; + } } - .custom-control-input:indeterminate ~ .custom-control-indicator { - background-color: $custom-checkbox-indicator-indeterminate-bg; - background-image: $custom-checkbox-indicator-icon-indeterminate; - @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow); + .custom-control-input:indeterminate ~ .custom-control-label { + &::before { + @include gradient-bg($custom-checkbox-indicator-indeterminate-bg); + @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow); + } + &::after { + background-image: $custom-checkbox-indicator-icon-indeterminate; + } } } @@ -93,30 +124,16 @@ // Tweak just a few things for radios. .custom-radio { - .custom-control-indicator { + .custom-control-label::before { border-radius: $custom-radio-indicator-border-radius; } - .custom-control-input:checked ~ .custom-control-indicator { - background-image: $custom-radio-indicator-icon-checked; - } -} - - -// Layout options -// -// By default radios and checkboxes are `inline-block` with no additional spacing -// set. Use these optional classes to tweak the layout. - -.custom-controls-stacked { - display: flex; - flex-direction: column; - - .custom-control { - margin-bottom: $custom-control-spacer-y; - - + .custom-control { - margin-left: 0; + .custom-control-input:checked ~ .custom-control-label { + &::before { + @include gradient-bg($custom-control-indicator-checked-bg); + } + &::after { + background-image: $custom-radio-indicator-icon-checked; } } } @@ -130,7 +147,7 @@ .custom-select { display: inline-block; - max-width: 100%; + width: 100%; height: $input-height; padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x; line-height: $custom-select-line-height; @@ -148,12 +165,12 @@ &:focus { border-color: $custom-select-focus-border-color; - outline: none; - @include box-shadow($custom-select-focus-box-shadow); + outline: 0; + box-shadow: $custom-select-focus-box-shadow; &::-ms-value { // For visual consistency with other platforms/browsers, - // supress the default white text on blue background highlight given to + // suppress the default white text on blue background highlight given to // the selected option text when the (still closed) <select> receives focus // in IE and (under certain conditions) Edge. // See https://github.com/twbs/bootstrap/issues/19398. @@ -162,8 +179,10 @@ } } - &[multiple] { + &[multiple], + &[size]:not([size="1"]) { height: auto; + padding-right: $custom-select-padding-x; background-image: none; } @@ -185,6 +204,13 @@ font-size: $custom-select-font-size-sm; } +.custom-select-lg { + height: $custom-select-height-lg; + padding-top: $custom-select-padding-y; + padding-bottom: $custom-select-padding-y; + font-size: $custom-select-font-size-lg; +} + // File // @@ -193,65 +219,64 @@ .custom-file { position: relative; display: inline-block; - max-width: 100%; + width: 100%; height: $custom-file-height; margin-bottom: 0; } .custom-file-input { - min-width: $custom-file-width; - max-width: 100%; + position: relative; + z-index: 2; + width: 100%; height: $custom-file-height; margin: 0; opacity: 0; &:focus ~ .custom-file-control { + border-color: $custom-file-focus-border-color; box-shadow: $custom-file-focus-box-shadow; + + &::before { + border-color: $custom-file-focus-border-color; + } + } + + @each $lang, $value in $custom-file-text { + &:lang(#{$lang}) ~ .custom-file-label::after { + content: $value; + } } } -.custom-file-control { +.custom-file-label { position: absolute; top: 0; right: 0; left: 0; - z-index: 5; + z-index: 1; height: $custom-file-height; padding: $custom-file-padding-y $custom-file-padding-x; line-height: $custom-file-line-height; color: $custom-file-color; - pointer-events: none; - user-select: none; background-color: $custom-file-bg; border: $custom-file-border-width solid $custom-file-border-color; @include border-radius($custom-file-border-radius); @include box-shadow($custom-file-box-shadow); - @each $lang, $text in map-get($custom-file-text, placeholder) { - &:lang(#{$lang}):empty::after { - content: $text; - } - } - - &::before { + &::after { position: absolute; - top: -$custom-file-border-width; - right: -$custom-file-border-width; - bottom: -$custom-file-border-width; - z-index: 6; + top: 0; + right: 0; + bottom: 0; + z-index: 3; display: block; - height: $custom-file-height; + height: calc(#{$custom-file-height} - #{$custom-file-border-width} * 2); padding: $custom-file-padding-y $custom-file-padding-x; line-height: $custom-file-line-height; color: $custom-file-button-color; + content: "Browse"; @include gradient-bg($custom-file-button-bg); - border: $custom-file-border-width solid $custom-file-border-color; + border-left: $custom-file-border-width solid $custom-file-border-color; @include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0); } - - @each $lang, $text in map-get($custom-file-text, button-label) { - &:lang(#{$lang})::before { - content: $text; - } - } } diff --git a/assets/stylesheets/bootstrap/_dropdown.scss b/assets/stylesheets/bootstrap/_dropdown.scss index 2717641..a9d4cfe 100644 --- a/assets/stylesheets/bootstrap/_dropdown.scss +++ b/assets/stylesheets/bootstrap/_dropdown.scss @@ -44,6 +44,34 @@ } } +.dropright { + .dropdown-menu { + margin-top: 0; + margin-left: $dropdown-spacer; + } + + .dropdown-toggle { + @include caret(right); + &::after { + vertical-align: 0; + } + } +} + +.dropleft { + .dropdown-menu { + margin-top: 0; + margin-right: $dropdown-spacer; + } + + .dropdown-toggle { + @include caret(left); + &::before { + vertical-align: 0; + } + } +} + // Dividers (basically an `<hr>`) within the dropdown .dropdown-divider { @include nav-divider($dropdown-divider-bg); @@ -61,7 +89,7 @@ color: $dropdown-link-color; text-align: inherit; // For `<button>`s white-space: nowrap; // prevent links from randomly breaking onto new lines - background: none; // For `<button>`s + background-color: transparent; // For `<button>`s border: 0; // For `<button>`s @include hover-focus { diff --git a/assets/stylesheets/bootstrap/_forms.scss b/assets/stylesheets/bootstrap/_forms.scss index 42f2399..b0954f8 100644 --- a/assets/stylesheets/bootstrap/_forms.scss +++ b/assets/stylesheets/bootstrap/_forms.scss @@ -7,13 +7,13 @@ .form-control { display: block; width: 100%; - padding: $input-btn-padding-y $input-btn-padding-x; + padding: $input-padding-y $input-padding-x; font-size: $font-size-base; - line-height: $input-btn-line-height; + line-height: $input-line-height; color: $input-color; background-color: $input-bg; background-clip: padding-box; - border: $input-btn-border-width solid $input-border-color; + border: $input-border-width solid $input-border-color; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS. @if $enable-rounded { @@ -76,6 +76,7 @@ select.form-control { .form-control-file, .form-control-range { display: block; + width: 100%; } @@ -83,41 +84,28 @@ select.form-control { // Labels // -// For use with horizontal and inline forms, when you need the label text to -// align with the form controls. +// For use with horizontal and inline forms, when you need the label (or legend) +// text to align with the form controls. .col-form-label { - 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; + padding-top: calc(#{$input-padding-y} + #{$input-border-width}); + padding-bottom: calc(#{$input-padding-y} + #{$input-border-width}); + margin-bottom: 0; // Override the `<label>/<legend>` default + font-size: inherit; // Override the `<legend>` default + line-height: $input-line-height; } .col-form-label-lg { - padding-top: calc(#{$input-btn-padding-y-lg} + #{$input-btn-border-width}); - padding-bottom: calc(#{$input-btn-padding-y-lg} + #{$input-btn-border-width}); + padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width}); + padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width}); font-size: $font-size-lg; - line-height: $input-btn-line-height-lg; + line-height: $input-line-height-lg; } .col-form-label-sm { - padding-top: calc(#{$input-btn-padding-y-sm} + #{$input-btn-border-width}); - padding-bottom: calc(#{$input-btn-padding-y-sm} + #{$input-btn-border-width}); + padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width}); + padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width}); font-size: $font-size-sm; - line-height: $input-btn-line-height-sm; -} - - -// -// Legends -// - -// For use with horizontal and inline forms, when you need the legend text to -// be the same size as regular labels, and to align with the form controls. -.col-form-legend { - padding-top: $input-btn-padding-y; - padding-bottom: $input-btn-padding-y; - margin-bottom: 0; - font-size: $font-size-base; + line-height: $input-line-height-sm; } @@ -129,13 +117,13 @@ select.form-control { .form-control-plaintext { display: block; width: 100%; - padding-top: $input-btn-padding-y; - padding-bottom: $input-btn-padding-y; + padding-top: $input-padding-y; + padding-bottom: $input-padding-y; margin-bottom: 0; // match inputs if this class comes on inputs with default margins - line-height: $input-btn-line-height; + line-height: $input-line-height; background-color: transparent; border: solid transparent; - border-width: $input-btn-border-width 0; + border-width: $input-border-width 0; &.form-control-sm, &.form-control-lg { @@ -154,9 +142,9 @@ select.form-control { // issue documented in https://github.com/twbs/bootstrap/issues/15074. .form-control-sm { - padding: $input-btn-padding-y-sm $input-btn-padding-x-sm; + padding: $input-padding-y-sm $input-padding-x-sm; font-size: $font-size-sm; - line-height: $input-btn-line-height-sm; + line-height: $input-line-height-sm; @include border-radius($input-border-radius-sm); } @@ -167,9 +155,9 @@ select.form-control-sm { } .form-control-lg { - padding: $input-btn-padding-y-lg $input-btn-padding-x-lg; + padding: $input-padding-y-lg $input-padding-x-lg; font-size: $font-size-lg; - line-height: $input-btn-line-height-lg; + line-height: $input-line-height-lg; @include border-radius($input-border-radius-lg); } @@ -220,33 +208,35 @@ select.form-control-lg { .form-check { position: relative; display: block; - margin-bottom: $form-check-margin-bottom; - - &.disabled { - .form-check-label { - color: $text-muted; - } - } -} - -.form-check-label { padding-left: $form-check-input-gutter; - margin-bottom: 0; // Override default `<label>` bottom margin } .form-check-input { position: absolute; margin-top: $form-check-input-margin-y; margin-left: -$form-check-input-gutter; + + &:disabled ~ .form-check-label { + color: $text-muted; + } +} + +.form-check-label { + margin-bottom: 0; // Override default `<label>` bottom margin } -// Radios and checkboxes on same line .form-check-inline { - display: inline-block; + display: inline-flex; + align-items: center; + padding-left: 0; // Override base .form-check margin-right: $form-check-inline-margin-x; - .form-check-label { - vertical-align: middle; + // Undo .form-check-input defaults and add some `margin-right`. + .form-check-input { + position: static; + margin-top: 0; + margin-right: $form-check-inline-input-margin-x; + margin-left: 0; } } @@ -323,10 +313,6 @@ select.form-control-lg { align-items: center; justify-content: center; width: auto; - margin-top: 0; - margin-bottom: 0; - } - .form-check-label { padding-left: 0; } .form-check-input { @@ -336,23 +322,12 @@ select.form-control-lg { margin-left: 0; } - // Custom form controls .custom-control { - display: flex; align-items: center; justify-content: center; - padding-left: 0; } - .custom-control-indicator { - position: static; - display: inline-block; - margin-right: $form-check-input-margin-x; // Flexbox alignment means we lose our HTML space here, so we compensate. - vertical-align: text-bottom; - } - - // Re-override the feedback icon. - .has-feedback .form-control-feedback { - top: 0; + .custom-control-label { + margin-bottom: 0; } } } diff --git a/assets/stylesheets/bootstrap/_functions.scss b/assets/stylesheets/bootstrap/_functions.scss index a95ad43..1266d34 100644 --- a/assets/stylesheets/bootstrap/_functions.scss +++ b/assets/stylesheets/bootstrap/_functions.scss @@ -56,14 +56,14 @@ $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000; - @if ($yiq >= 150) { + @if ($yiq >= $yiq-contrasted-threshold) { @return $yiq-text-dark; } @else { @return $yiq-text-light; } } -// Retreive color Sass maps +// Retrieve color Sass maps @function color($key: "blue") { @return map-get($colors, $key); } diff --git a/assets/stylesheets/bootstrap/_input-group.scss b/assets/stylesheets/bootstrap/_input-group.scss index 9315051..7ef0267 100644 --- a/assets/stylesheets/bootstrap/_input-group.scss +++ b/assets/stylesheets/bootstrap/_input-group.scss @@ -7,101 +7,99 @@ .input-group { position: relative; display: flex; + flex-wrap: wrap; // For form validation feedback align-items: stretch; width: 100%; - .form-control { - // Ensure that the input is always above the *appended* addon button for - // proper border colors. - position: relative; - z-index: 1; + .form-control, + .custom-select, + .custom-file { + position: relative; // For focus state's z-index flex: 1 1 auto; // Add width 1% and flex-basis auto to ensure that button will not wrap out // the column. Applies to IE Edge+ and Firefox. Chrome does not require this. width: 1%; margin-bottom: 0; - // Bring the "active" form control to the front - @include hover-focus-active { - z-index: 2; + // Bring the "active" form control to the top of surrounding elements + &:focus { + z-index: 3; + } + + + .form-control { + margin-left: -$input-border-width; } } -} -.input-group-addon, -.input-group-btn, -.input-group .form-control, -.input-group .custom-select, -.input-group .custom-file { - display: flex; - align-items: center; + .form-control, + .custom-select { + &:not(:last-child) { @include border-right-radius(0); } + &:not(:first-child) { @include border-left-radius(0); } + } - &:not(:first-child):not(:last-child) { - @include border-radius(0); + // Custom file inputs have more complex markup, thus requiring different + // border-radius overrides. + .custom-file { + display: flex; + align-items: center; + + &:not(:last-child) .custom-file-control, + &:not(:last-child) .custom-file-control::before { @include border-right-radius(0); } + &:not(:first-child) .custom-file-control, + &:not(:first-child) .custom-file-control::before { @include border-left-radius(0); } } } -.input-group .custom-file { + +// Prepend and append +// +// While it requires one extra layer of HTML for each, dedicated prepend and +// append elements allow us to 1) be less clever, 2) simplify our selectors, and +// 3) support HTML5 form validation. + +.input-group-prepend, +.input-group-append { display: flex; align-items: center; -} -.input-group .custom-select, -.input-group .custom-file { - width: 100%; -} + // Ensure buttons are always above inputs for more visually pleasing borders. + // This isn't needed for `.input-group-text` since it shares the same border-color + // as our inputs. + .btn { + position: relative; + z-index: 2; + } -.input-group-addon, -.input-group-btn { - white-space: nowrap; + .btn + .btn, + .btn + .input-group-text, + .input-group-text + .input-group-text, + .input-group-text + .btn { + margin-left: -$input-border-width; + } } -// Sizing options -// -// Remix the default form control sizing classes into new ones for easier -// manipulation. - -.input-group-lg > .form-control, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .btn { - @extend .form-control-lg; -} -.input-group-sm > .form-control, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .btn { - @extend .form-control-sm; -} +.input-group-prepend { margin-right: -$input-border-width; } +.input-group-append { margin-left: -$input-border-width; } +// Textual addons // -// Text input groups -// +// Serves as a catch-all element for any text or radio/checkbox input you wish +// to prepend or append to an input. -.input-group-addon { - padding: $input-btn-padding-y $input-btn-padding-x; +.input-group-text { + padding: $input-padding-y $input-padding-x; margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom font-size: $font-size-base; // Match inputs font-weight: $font-weight-normal; - line-height: $input-btn-line-height; + line-height: $input-line-height; color: $input-group-addon-color; text-align: center; + white-space: nowrap; background-color: $input-group-addon-bg; - border: $input-btn-border-width solid $input-group-addon-border-color; + border: $input-border-width solid $input-group-addon-border-color; @include border-radius($input-border-radius); - // Sizing - &.form-control-sm { - padding: $input-btn-padding-y-sm $input-btn-padding-x-sm; - font-size: $font-size-sm; - @include border-radius($input-border-radius-sm); - } - - &.form-control-lg { - padding: $input-btn-padding-y-lg $input-btn-padding-x-lg; - font-size: $font-size-lg; - @include border-radius($input-border-radius-lg); - } - // Nuke default margins from checkboxes and radios to vertically center within. input[type="radio"], input[type="checkbox"] { @@ -110,100 +108,49 @@ } +// Sizing // -// Reset rounded corners -// - -.input-group .form-control:not(:last-child), -.input-group .custom-select:not(:last-child), -.input-group .custom-file:not(:last-child) .custom-file-control::before, -.input-group-addon:not(:last-child), -.input-group-btn:not(:last-child) > .btn, -.input-group-btn:not(:last-child) > .btn-group > .btn, -.input-group-btn:not(:last-child) > .dropdown-toggle, -.input-group-btn:not(:first-child) > .btn:not(:last-child):not(.dropdown-toggle), -.input-group-btn:not(:first-child) > .btn-group:not(:last-child) > .btn { - @include border-right-radius(0); -} +// Remix the default form control sizing classes into new ones for easier +// manipulation. -.input-group-addon:not(:last-child) { - border-right: 0; +.input-group-lg > .form-control, +.input-group-lg > .input-group-prepend > .input-group-text, +.input-group-lg > .input-group-append > .input-group-text, +.input-group-lg > .input-group-prepend > .btn, +.input-group-lg > .input-group-append > .btn { + @extend .form-control-lg; } -.input-group .form-control:not(:first-child), -.input-group .custom-select:not(:first-child), -.input-group .custom-file:not(:first-child) .custom-file-control, -.input-group-addon:not(:first-child), -.input-group-btn:not(:first-child) > .btn, -.input-group-btn:not(:first-child) > .btn-group > .btn, -.input-group-btn:not(:first-child) > .dropdown-toggle, -.input-group-btn:not(:last-child) > .btn:not(:first-child), -.input-group-btn:not(:last-child) > .btn-group:not(:first-child) > .btn { - @include border-left-radius(0); +.input-group-sm > .form-control, +.input-group-sm > .input-group-prepend > .input-group-text, +.input-group-sm > .input-group-append > .input-group-text, +.input-group-sm > .input-group-prepend > .btn, +.input-group-sm > .input-group-append > .btn { + @extend .form-control-sm; } -.form-control, -.custom-select, -.custom-file { - + .input-group-addon:not(:first-child) { - border-left: 0; - } -} +// Prepend and append rounded corners // -// Button input groups -// +// These rulesets must come after the sizing ones to properly override sm and lg +// border-radius values when extending. They're more specific than we'd like +// with the `.input-group >` part, but without it, we cannot override the sizing. -.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; - white-space: nowrap; - - // Negative margin for spacing, position for bringing hovered/focused/actived - // element above the siblings. - > .btn { - position: relative; - - + .btn { - margin-left: (-$input-btn-border-width); - } - - // Bring the "active" button to the front - @include hover-focus-active { - z-index: 2; - } - } - &:first-child > .btn + .btn { - margin-left: 0; - } +.input-group > .input-group-prepend > .btn, +.input-group > .input-group-prepend > .input-group-text, +.input-group > .input-group-append:not(:last-child) > .btn, +.input-group > .input-group-append:not(:last-child) > .input-group-text, +.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) { + @include border-right-radius(0); +} - // Negative margin to only have a single, shared border between the two - &:not(:last-child) { - > .btn, - > .btn-group { - margin-right: (-$input-btn-border-width); - } - } - &:not(:first-child) { - > .btn, - > .btn-group { - z-index: 1; - // 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: 2; - } - } - } +.input-group > .input-group-append > .btn, +.input-group > .input-group-append > .input-group-text, +.input-group > .input-group-prepend:not(:first-child) > .btn, +.input-group > .input-group-prepend:not(:first-child) > .input-group-text, +.input-group > .input-group-prepend:first-child > .btn:not(:first-child), +.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) { + @include border-left-radius(0); } diff --git a/assets/stylesheets/bootstrap/_list-group.scss b/assets/stylesheets/bootstrap/_list-group.scss index d771364..9f145c1 100644 --- a/assets/stylesheets/bootstrap/_list-group.scss +++ b/assets/stylesheets/bootstrap/_list-group.scss @@ -59,6 +59,7 @@ } @include hover-focus { + z-index: 1; // Place hover/active items above their siblings for proper border styling text-decoration: none; } @@ -70,7 +71,7 @@ // Include both here for `<a>`s and `<button>`s &.active { - z-index: 1; // Place active items above their siblings for proper border styling + z-index: 2; // Place active items above their siblings for proper border styling color: $list-group-active-color; background-color: $list-group-active-bg; border-color: $list-group-active-border-color; diff --git a/assets/stylesheets/bootstrap/_modal.scss b/assets/stylesheets/bootstrap/_modal.scss index 5fabc83..edda836 100644 --- a/assets/stylesheets/bootstrap/_modal.scss +++ b/assets/stylesheets/bootstrap/_modal.scss @@ -50,11 +50,18 @@ } } +.modal-dialog-centered { + display: flex; + align-items: center; + min-height: calc(100% - (#{$modal-dialog-margin} * 2)); +} + // Actual modal .modal-content { position: relative; display: flex; flex-direction: column; + width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog` // counteract the pointer-events: none; in the .modal-dialog pointer-events: auto; background-color: $modal-content-bg; @@ -144,11 +151,16 @@ margin: $modal-dialog-margin-y-sm-up auto; } + .modal-dialog-centered { + min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2)); + } + .modal-content { @include box-shadow($modal-content-box-shadow-sm-up); } .modal-sm { max-width: $modal-sm; } + } @include media-breakpoint-up(lg) { diff --git a/assets/stylesheets/bootstrap/_nav.scss b/assets/stylesheets/bootstrap/_nav.scss index 14e76c9..fc82161 100644 --- a/assets/stylesheets/bootstrap/_nav.scss +++ b/assets/stylesheets/bootstrap/_nav.scss @@ -41,7 +41,7 @@ @include border-top-radius($nav-tabs-border-radius); @include hover-focus { - border-color: $nav-tabs-link-hover-border-color $nav-tabs-link-hover-border-color $nav-tabs-border-color; + border-color: $nav-tabs-link-hover-border-color; } &.disabled { @@ -55,7 +55,7 @@ .nav-item.show .nav-link { color: $nav-tabs-link-active-color; background-color: $nav-tabs-link-active-bg; - border-color: $nav-tabs-link-active-border-color $nav-tabs-link-active-border-color $nav-tabs-link-active-bg; + border-color: $nav-tabs-link-active-border-color; } .dropdown-menu { diff --git a/assets/stylesheets/bootstrap/_navbar.scss b/assets/stylesheets/bootstrap/_navbar.scss index 6b023e8..6b76649 100644 --- a/assets/stylesheets/bootstrap/_navbar.scss +++ b/assets/stylesheets/bootstrap/_navbar.scss @@ -109,13 +109,18 @@ padding: $navbar-toggler-padding-y $navbar-toggler-padding-x; font-size: $navbar-toggler-font-size; line-height: 1; - background: transparent; // remove default button style + background-color: transparent; // remove default button style border: $border-width solid transparent; // remove default button style @include border-radius($navbar-toggler-border-radius); @include hover-focus { text-decoration: none; } + + // Opinionated: add "hand" cursor to non-disabled .navbar-toggler elements + &:not([disabled]):not(.disabled) { + cursor: pointer; + } } // Keep as a separate element so folks can easily override it with another icon diff --git a/assets/stylesheets/bootstrap/_pagination.scss b/assets/stylesheets/bootstrap/_pagination.scss index 97977f4..286febc 100644 --- a/assets/stylesheets/bootstrap/_pagination.scss +++ b/assets/stylesheets/bootstrap/_pagination.scss @@ -20,6 +20,12 @@ background-color: $pagination-hover-bg; border-color: $pagination-hover-border-color; } + + + // Opinionated: add "hand" cursor to non-disabled .page-link elements + &:not([disabled]):not(.disabled) { + cursor: pointer; + } } .page-item { @@ -45,6 +51,8 @@ &.disabled .page-link { color: $pagination-disabled-color; pointer-events: none; + // Opinionated: remove the "hand" cursor set previously for .page-link + cursor: auto; background-color: $pagination-disabled-bg; border-color: $pagination-disabled-border-color; } diff --git a/assets/stylesheets/bootstrap/_popover.scss b/assets/stylesheets/bootstrap/_popover.scss index 4503767..3ef5f62 100644 --- a/assets/stylesheets/bootstrap/_popover.scss +++ b/assets/stylesheets/bootstrap/_popover.scss @@ -8,166 +8,155 @@ // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. // So reset our font and text properties to avoid inheriting weird values. @include reset-text(); - font-size: $font-size-sm; + font-size: $popover-font-size; // Allow breaking very long words so they don't overflow the popover's bounds word-wrap: break-word; background-color: $popover-bg; background-clip: padding-box; border: $popover-border-width solid $popover-border-color; - @include border-radius($border-radius-lg); + @include border-radius($popover-border-radius); @include box-shadow($popover-box-shadow); - // Arrows - // - // .arrow is outer, .arrow::after is inner - .arrow { position: absolute; display: block; width: $popover-arrow-width; height: $popover-arrow-height; + margin: 0 $border-radius-lg; + + &::before, + &::after { + position: absolute; + display: block; + content: ""; + border-color: transparent; + border-style: solid; + } + } +} + +.bs-popover-top { + margin-bottom: $popover-arrow-height; + + .arrow { + bottom: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); } .arrow::before, .arrow::after { - position: absolute; - display: block; - border-color: transparent; - border-style: solid; + border-width: $popover-arrow-height ($popover-arrow-width / 2) 0; } .arrow::before { - content: ""; - border-width: $popover-arrow-width; + bottom: 0; + border-top-color: $popover-arrow-outer-color; } + .arrow::after { - content: ""; - border-width: $popover-arrow-width; + bottom: $popover-border-width; + border-top-color: $popover-arrow-color; } +} - // Popover directions - - &.bs-popover-top { - margin-bottom: $popover-arrow-width; - - .arrow { - bottom: 0; - } - - .arrow::before, - .arrow::after { - border-bottom-width: 0; - } +.bs-popover-right { + margin-left: $popover-arrow-height; - .arrow::before { - bottom: -$popover-arrow-width; - margin-left: -$popover-arrow-width; - border-top-color: $popover-arrow-outer-color; - } - - .arrow::after { - bottom: calc((#{$popover-arrow-width} - #{$popover-border-width}) * -1); - margin-left: -$popover-arrow-width; - border-top-color: $popover-arrow-color; - } + .arrow { + left: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); + width: $popover-arrow-height; + height: $popover-arrow-width; + margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners } - &.bs-popover-right { - margin-left: $popover-arrow-width; + .arrow::before, + .arrow::after { + border-width: ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2) 0; + } - .arrow { - left: 0; - } + .arrow::before { + left: 0; + border-right-color: $popover-arrow-outer-color; + } - .arrow::before, - .arrow::after { - margin-top: -$popover-arrow-width; - border-left-width: 0; - } + .arrow::after { + left: $popover-border-width; + border-right-color: $popover-arrow-color; + } +} - .arrow::before { - left: -$popover-arrow-width; - border-right-color: $popover-arrow-outer-color; - } +.bs-popover-bottom { + margin-top: $popover-arrow-height; - .arrow::after { - left: calc((#{$popover-arrow-width} - #{$popover-border-width}) * -1); - border-right-color: $popover-arrow-color; - } + .arrow { + top: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); } - &.bs-popover-bottom { - margin-top: $popover-arrow-width; + .arrow::before, + .arrow::after { + border-width: 0 ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2); + } - .arrow { - top: 0; - } + .arrow::before { + top: 0; + border-bottom-color: $popover-arrow-outer-color; + } - .arrow::before, - .arrow::after { - margin-left: -$popover-arrow-width; - border-top-width: 0; - } + .arrow::after { + top: $popover-border-width; + border-bottom-color: $popover-arrow-color; + } - .arrow::before { - top: -$popover-arrow-width; - border-bottom-color: $popover-arrow-outer-color; - } + // This will remove the popover-header's border just below the arrow + .popover-header::before { + position: absolute; + top: 0; + left: 50%; + display: block; + width: $popover-arrow-width; + margin-left: ($popover-arrow-width / -2); + content: ""; + border-bottom: $popover-border-width solid $popover-header-bg; + } +} - .arrow::after { - top: calc((#{$popover-arrow-width} - #{$popover-border-width}) * -1); - border-bottom-color: $popover-arrow-color; - } +.bs-popover-left { + margin-right: $popover-arrow-height; - // This will remove the popover-header's border just below the arrow - .popover-header::before { - position: absolute; - top: 0; - left: 50%; - display: block; - width: 20px; - margin-left: -10px; - content: ""; - border-bottom: $popover-border-width solid $popover-header-bg; - } + .arrow { + right: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); + width: $popover-arrow-height; + height: $popover-arrow-width; + margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners } - &.bs-popover-left { - margin-right: $popover-arrow-width; - - .arrow { - right: 0; - } + .arrow::before, + .arrow::after { + border-width: ($popover-arrow-width / 2) 0 ($popover-arrow-width / 2) $popover-arrow-height; + } - .arrow::before, - .arrow::after { - margin-top: -$popover-arrow-width; - border-right-width: 0; - } + .arrow::before { + right: 0; + border-left-color: $popover-arrow-outer-color; + } - .arrow::before { - right: -$popover-arrow-width; - border-left-color: $popover-arrow-outer-color; - } + .arrow::after { + right: $popover-border-width; + border-left-color: $popover-arrow-color; + } +} - .arrow::after { - right: calc((#{$popover-arrow-width} - #{$popover-border-width}) * -1); - border-left-color: $popover-arrow-color; - } +.bs-popover-auto { + &[x-placement^="top"] { + @extend .bs-popover-top; } - &.bs-popover-auto { - &[x-placement^="top"] { - @extend .bs-popover-top; - } - &[x-placement^="right"] { - @extend .bs-popover-right; - } - &[x-placement^="bottom"] { - @extend .bs-popover-bottom; - } - &[x-placement^="left"] { - @extend .bs-popover-left; - } + &[x-placement^="right"] { + @extend .bs-popover-right; + } + &[x-placement^="bottom"] { + @extend .bs-popover-bottom; + } + &[x-placement^="left"] { + @extend .bs-popover-left; } } diff --git a/assets/stylesheets/bootstrap/_progress.scss b/assets/stylesheets/bootstrap/_progress.scss index efbb440..a581116 100644 --- a/assets/stylesheets/bootstrap/_progress.scss +++ b/assets/stylesheets/bootstrap/_progress.scss @@ -10,14 +10,17 @@ font-size: $progress-font-size; background-color: $progress-bg; @include border-radius($progress-border-radius); + @include box-shadow($progress-box-shadow); } .progress-bar { display: flex; - align-items: center; + flex-direction: column; justify-content: center; color: $progress-bar-color; + text-align: center; background-color: $progress-bar-bg; + @include transition($progress-bar-transition); } .progress-bar-striped { diff --git a/assets/stylesheets/bootstrap/_reboot.scss b/assets/stylesheets/bootstrap/_reboot.scss index f98a719..5393413 100644 --- a/assets/stylesheets/bootstrap/_reboot.scss +++ b/assets/stylesheets/bootstrap/_reboot.scss @@ -71,7 +71,7 @@ body { // // Credit: https://github.com/suitcss/base [tabindex="-1"]:focus { - outline: none !important; + outline: 0 !important; } @@ -491,6 +491,7 @@ output { summary { display: list-item; // Add the correct display in all browsers + cursor: pointer; } template { diff --git a/assets/stylesheets/bootstrap/_tables.scss b/assets/stylesheets/bootstrap/_tables.scss index 6bd0b91..0e3b119 100644 --- a/assets/stylesheets/bootstrap/_tables.scss +++ b/assets/stylesheets/bootstrap/_tables.scss @@ -171,7 +171,7 @@ -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 { + > .table-bordered { border: 0; } } diff --git a/assets/stylesheets/bootstrap/_tooltip.scss b/assets/stylesheets/bootstrap/_tooltip.scss index 7b5db1c..1286ebf 100644 --- a/assets/stylesheets/bootstrap/_tooltip.scss +++ b/assets/stylesheets/bootstrap/_tooltip.scss @@ -7,7 +7,7 @@ // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. // So reset our font and text properties to avoid inheriting weird values. @include reset-text(); - font-size: $font-size-sm; + font-size: $tooltip-font-size; // Allow breaking very long words so they don't overflow the tooltip's bounds word-wrap: break-word; opacity: 0; @@ -19,80 +19,88 @@ display: block; width: $tooltip-arrow-width; height: $tooltip-arrow-height; - } - .arrow::before { - position: absolute; - border-color: transparent; - border-style: solid; + &::before { + position: absolute; + content: ""; + border-color: transparent; + border-style: solid; + } } +} - &.bs-tooltip-top { - padding: $tooltip-arrow-width 0; - .arrow { - bottom: 0; - } +.bs-tooltip-top { + padding: $tooltip-arrow-height 0; - .arrow::before { - margin-left: -($tooltip-arrow-width - 2); - content: ""; - border-width: $tooltip-arrow-width $tooltip-arrow-width 0; + .arrow { + bottom: 0; + + &::before { + top: 0; + border-width: $tooltip-arrow-height ($tooltip-arrow-width / 2) 0; border-top-color: $tooltip-arrow-color; } } - &.bs-tooltip-right { - padding: 0 $tooltip-arrow-width; - .arrow { - left: 0; - } +} - .arrow::before { - margin-top: -($tooltip-arrow-width - 2); - content: ""; - border-width: $tooltip-arrow-width $tooltip-arrow-width $tooltip-arrow-width 0; +.bs-tooltip-right { + padding: 0 $tooltip-arrow-height; + + .arrow { + left: 0; + width: $tooltip-arrow-height; + height: $tooltip-arrow-width; + + &::before { + right: 0; + border-width: ($tooltip-arrow-width / 2) $tooltip-arrow-height ($tooltip-arrow-width / 2) 0; border-right-color: $tooltip-arrow-color; } } - &.bs-tooltip-bottom { - padding: $tooltip-arrow-width 0; - .arrow { - top: 0; - } +} - .arrow::before { - margin-left: -($tooltip-arrow-width - 2); - content: ""; - border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; +.bs-tooltip-bottom { + padding: $tooltip-arrow-height 0; + + .arrow { + top: 0; + + &::before { + bottom: 0; + border-width: 0 ($tooltip-arrow-width / 2) $tooltip-arrow-height; border-bottom-color: $tooltip-arrow-color; } } - &.bs-tooltip-left { - padding: 0 $tooltip-arrow-width; - .arrow { - right: 0; - } +} - .arrow::before { - right: 0; - margin-top: -($tooltip-arrow-width - 2); - content: ""; - border-width: $tooltip-arrow-width 0 $tooltip-arrow-width $tooltip-arrow-width; +.bs-tooltip-left { + padding: 0 $tooltip-arrow-height; + + .arrow { + right: 0; + width: $tooltip-arrow-height; + height: $tooltip-arrow-width; + + &::before { + left: 0; + border-width: ($tooltip-arrow-width / 2) 0 ($tooltip-arrow-width / 2) $tooltip-arrow-height; border-left-color: $tooltip-arrow-color; } } - &.bs-tooltip-auto { - &[x-placement^="top"] { - @extend .bs-tooltip-top; - } - &[x-placement^="right"] { - @extend .bs-tooltip-right; - } - &[x-placement^="bottom"] { - @extend .bs-tooltip-bottom; - } - &[x-placement^="left"] { - @extend .bs-tooltip-left; - } +} + +.bs-tooltip-auto { + &[x-placement^="top"] { + @extend .bs-tooltip-top; + } + &[x-placement^="right"] { + @extend .bs-tooltip-right; + } + &[x-placement^="bottom"] { + @extend .bs-tooltip-bottom; + } + &[x-placement^="left"] { + @extend .bs-tooltip-left; } } @@ -103,5 +111,5 @@ color: $tooltip-color; text-align: center; background-color: $tooltip-bg; - @include border-radius($border-radius); + @include border-radius($tooltip-border-radius); } diff --git a/assets/stylesheets/bootstrap/_type.scss b/assets/stylesheets/bootstrap/_type.scss index b1b8f61..57d610f 100644 --- a/assets/stylesheets/bootstrap/_type.scss +++ b/assets/stylesheets/bootstrap/_type.scss @@ -53,8 +53,8 @@ h6, .h6 { font-size: $h6-font-size; } // hr { - margin-top: 1rem; - margin-bottom: 1rem; + margin-top: $hr-margin-y; + margin-bottom: $hr-margin-y; border: 0; border-top: $hr-border-width solid $hr-border-color; } diff --git a/assets/stylesheets/bootstrap/_variables.scss b/assets/stylesheets/bootstrap/_variables.scss index 50972c5..26b44e9 100644 --- a/assets/stylesheets/bootstrap/_variables.scss +++ b/assets/stylesheets/bootstrap/_variables.scss @@ -87,10 +87,12 @@ $theme-colors: map-merge(( // Set a specific jump point for requesting color jumps $theme-color-interval: 8% !default; -// Customize the light and dark text colors for use in our YIQ color contrast function. -$yiq-text-dark: #111 !default; -$yiq-text-light: #fff !default; +// The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255. +$yiq-contrasted-threshold: 150 !default; +// Customize the light and dark text colors for use in our YIQ color contrast function. +$yiq-text-dark: $gray-900 !default; +$yiq-text-light: $white !default; // Options // @@ -221,7 +223,7 @@ $transition-collapse: height .35s ease !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-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 @@ -280,9 +282,11 @@ $dt-font-weight: $font-weight-bold !default; $kbd-box-shadow: inset 0 -.1rem 0 rgba($black, .25) !default; $nested-kbd-font-weight: $font-weight-bold !default; -$list-inline-padding: 5px !default; +$list-inline-padding: .5rem !default; + +$mark-bg: #fcf8e3 !default; -$mark-bg: #fcf8e3 !default; +$hr-margin-y: $spacer !default; // Tables @@ -298,7 +302,7 @@ $table-hover-bg: rgba($black, .075) !default; $table-active-bg: $table-hover-bg !default; $table-border-width: $border-width !default; -$table-border-color: $gray-200 !default; +$table-border-color: $gray-300 !default; $table-head-bg: $gray-200 !default; $table-head-color: $gray-700 !default; @@ -310,9 +314,9 @@ $table-dark-border-color: lighten($gray-900, 7.5%) !default; $table-dark-color: $body-bg !default; -// Buttons +// Buttons + Forms // -// For each of Bootstrap's buttons, define text, background and border color. +// Shared variables that are reassigned to `$input-` and `$btn-` specific variables. $input-btn-padding-y: .375rem !default; $input-btn-padding-x: .75rem !default; @@ -330,8 +334,32 @@ $input-btn-padding-y-lg: .5rem !default; $input-btn-padding-x-lg: 1rem !default; $input-btn-line-height-lg: $line-height-lg !default; +$input-btn-border-width: $border-width !default; + + +// Buttons +// +// For each of Bootstrap's buttons, define text, background, and border color. + +$btn-padding-y: $input-btn-padding-y !default; +$btn-padding-x: $input-btn-padding-x !default; +$btn-line-height: $input-btn-line-height !default; + +$btn-padding-y-sm: $input-btn-padding-y-sm !default; +$btn-padding-x-sm: $input-btn-padding-x-sm !default; +$btn-line-height-sm: $input-btn-line-height-sm !default; + +$btn-padding-y-lg: $input-btn-padding-y-lg !default; +$btn-padding-x-lg: $input-btn-padding-x-lg !default; +$btn-line-height-lg: $input-btn-line-height-lg !default; + +$btn-border-width: $input-btn-border-width !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; +$btn-focus-width: $input-btn-focus-width !default; +$btn-focus-box-shadow: $input-btn-focus-box-shadow !default; +$btn-disabled-opacity: .65 !default; $btn-active-box-shadow: inset 0 3px 5px rgba($black, .125) !default; $btn-link-disabled-color: $gray-600 !default; @@ -348,12 +376,24 @@ $btn-transition: color .15s ease-in-out, background-color .15s ease // Forms +$input-padding-y: $input-btn-padding-y !default; +$input-padding-x: $input-btn-padding-x !default; +$input-line-height: $input-btn-line-height !default; + +$input-padding-y-sm: $input-btn-padding-y-sm !default; +$input-padding-x-sm: $input-btn-padding-x-sm !default; +$input-line-height-sm: $input-btn-line-height-sm !default; + +$input-padding-y-lg: $input-btn-padding-y-lg !default; +$input-padding-x-lg: $input-btn-padding-x-lg !default; +$input-line-height-lg: $input-btn-line-height-lg !default; + $input-bg: $white !default; $input-disabled-bg: $gray-200 !default; $input-color: $gray-700 !default; $input-border-color: $gray-400 !default; -$input-btn-border-width: $border-width !default; // For form controls and buttons +$input-border-width: $input-btn-border-width !default; $input-box-shadow: inset 0 1px 1px rgba($black, .075) !default; $input-border-radius: $border-radius !default; @@ -363,6 +403,8 @@ $input-border-radius-sm: $border-radius-sm !default; $input-focus-bg: $input-bg !default; $input-focus-border-color: lighten(theme-color("primary"), 25%) !default; $input-focus-color: $input-color !default; +$input-focus-width: $input-btn-focus-width !default; +$input-focus-box-shadow: $input-btn-focus-box-shadow !default; $input-placeholder-color: $gray-600 !default; @@ -377,16 +419,16 @@ $input-height-sm: calc(#{$input-height-inner-sm} + #{$inpu $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; +$input-transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; $form-text-margin-top: .25rem !default; -$form-check-margin-bottom: .5rem !default; $form-check-input-gutter: 1.25rem !default; -$form-check-input-margin-y: .25rem !default; +$form-check-input-margin-y: .3rem !default; $form-check-input-margin-x: .25rem !default; $form-check-inline-margin-x: .75rem !default; +$form-check-inline-input-margin-x: .3125rem !default; $form-group-margin-bottom: 1rem !default; @@ -395,16 +437,15 @@ $input-group-addon-bg: $gray-200 !default; $input-group-addon-border-color: $input-border-color !default; $custom-control-gutter: 1.5rem !default; -$custom-control-spacer-y: .25rem !default; $custom-control-spacer-x: 1rem !default; $custom-control-indicator-size: 1rem !default; -$custom-control-indicator-bg: #ddd !default; +$custom-control-indicator-bg: $gray-300 !default; $custom-control-indicator-bg-size: 50% 50% !default; $custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black, .1) !default; $custom-control-indicator-disabled-bg: $gray-200 !default; -$custom-control-description-disabled-color: $gray-600 !default; +$custom-control-label-disabled-color: $gray-600 !default; $custom-control-indicator-checked-color: $white !default; $custom-control-indicator-checked-bg: theme-color("primary") !default; @@ -437,21 +478,24 @@ $custom-select-disabled-color: $gray-600 !default; $custom-select-bg: $white !default; $custom-select-disabled-bg: $gray-200 !default; $custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions -$custom-select-indicator-color: #333 !default; +$custom-select-indicator-color: $gray-800 !default; $custom-select-indicator: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E"), "#", "%23") !default; $custom-select-border-width: $input-btn-border-width !default; $custom-select-border-color: $input-border-color !default; $custom-select-border-radius: $border-radius !default; -$custom-select-focus-border-color: lighten(theme-color("primary"), 25%) !default; -$custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px rgba($custom-select-focus-border-color, .5) !default; +$custom-select-focus-border-color: $input-focus-border-color !default; +$custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), $input-btn-focus-box-shadow !default; $custom-select-font-size-sm: 75% !default; $custom-select-height-sm: $input-height-sm !default; +$custom-select-font-size-lg: 125% !default; +$custom-select-height-lg: $input-height-lg !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-focus-border-color: $input-focus-border-color !default; +$custom-file-focus-box-shadow: $input-btn-focus-box-shadow !default; $custom-file-padding-y: $input-btn-padding-y !default; $custom-file-padding-x: $input-btn-padding-x !default; @@ -465,16 +509,13 @@ $custom-file-box-shadow: $input-box-shadow !default; $custom-file-button-color: $custom-file-color !default; $custom-file-button-bg: $input-group-addon-bg !default; $custom-file-text: ( - placeholder: ( - en: "Choose file..." - ), - button-label: ( - en: "Browse" - ) + en: "Browse" ) !default; // Form validation +$form-feedback-margin-top: $form-text-margin-top !default; +$form-feedback-font-size: $small-font-size !default; $form-feedback-valid-color: theme-color("success") !default; $form-feedback-invalid-color: theme-color("danger") !default; @@ -527,13 +568,13 @@ $nav-link-padding-y: .5rem !default; $nav-link-padding-x: 1rem !default; $nav-link-disabled-color: $gray-600 !default; -$nav-tabs-border-color: #ddd !default; +$nav-tabs-border-color: $gray-300 !default; $nav-tabs-border-width: $border-width !default; $nav-tabs-border-radius: $border-radius !default; -$nav-tabs-link-hover-border-color: $gray-200 !default; +$nav-tabs-link-hover-border-color: $gray-200 $gray-200 $nav-tabs-border-color !default; $nav-tabs-link-active-color: $gray-700 !default; $nav-tabs-link-active-bg: $body-bg !default; -$nav-tabs-link-active-border-color: #ddd !default; +$nav-tabs-link-active-border-color: $gray-300 $gray-300 $nav-tabs-link-active-bg !default; $nav-pills-border-radius: $border-radius !default; $nav-pills-link-active-color: $component-active-color !default; @@ -582,11 +623,11 @@ $pagination-line-height: 1.25 !default; $pagination-color: $link-color !default; $pagination-bg: $white !default; $pagination-border-width: $border-width !default; -$pagination-border-color: #ddd !default; +$pagination-border-color: $gray-300 !default; $pagination-hover-color: $link-hover-color !default; $pagination-hover-bg: $gray-200 !default; -$pagination-hover-border-color: #ddd !default; +$pagination-hover-border-color: $gray-300 !default; $pagination-active-color: $white !default; $pagination-active-bg: theme-color("primary") !default; @@ -594,7 +635,7 @@ $pagination-active-border-color: theme-color("primary") !default; $pagination-disabled-color: $gray-600 !default; $pagination-disabled-bg: $white !default; -$pagination-disabled-border-color: #ddd !default; +$pagination-disabled-border-color: $gray-300 !default; // Jumbotron @@ -626,26 +667,29 @@ $card-columns-margin: $card-spacer-y !default; // Tooltips -$tooltip-max-width: 200px !default; -$tooltip-color: $white !default; -$tooltip-bg: $black !default; -$tooltip-opacity: .9 !default; -$tooltip-padding-y: 3px !default; -$tooltip-padding-x: 8px !default; -$tooltip-margin: 0 !default; +$tooltip-font-size: $font-size-sm !default; +$tooltip-max-width: 200px !default; +$tooltip-color: $white !default; +$tooltip-bg: $black !default; +$tooltip-border-radius: $border-radius !default; +$tooltip-opacity: .9 !default; +$tooltip-padding-y: .25rem !default; +$tooltip-padding-x: .5rem !default; +$tooltip-margin: 0 !default; - -$tooltip-arrow-width: 5px !default; -$tooltip-arrow-height: 5px !default; -$tooltip-arrow-color: $tooltip-bg !default; +$tooltip-arrow-width: .8rem !default; +$tooltip-arrow-height: .4rem !default; +$tooltip-arrow-color: $tooltip-bg !default; // Popovers +$popover-font-size: $font-size-sm !default; $popover-bg: $white !default; $popover-max-width: 276px !default; $popover-border-width: $border-width !default; $popover-border-color: rgba($black, .2) !default; +$popover-border-radius: $border-radius-lg !default; $popover-box-shadow: 0 .25rem .5rem rgba($black, .2) !default; $popover-header-bg: darken($popover-bg, 3%) !default; @@ -657,8 +701,8 @@ $popover-body-color: $body-color !default; $popover-body-padding-y: $popover-header-padding-y !default; $popover-body-padding-x: $popover-header-padding-x !default; -$popover-arrow-width: .8rem !default; -$popover-arrow-height: .4rem !default; +$popover-arrow-width: 1rem !default; +$popover-arrow-height: .5rem !default; $popover-arrow-color: $popover-bg !default; $popover-arrow-outer-color: fade-in($popover-border-color, .05) !default; @@ -681,26 +725,26 @@ $badge-pill-border-radius: 10rem !default; // Modals // Padding applied to the modal body -$modal-inner-padding: 15px !default; +$modal-inner-padding: 1rem !default; -$modal-dialog-margin: 10px !default; -$modal-dialog-margin-y-sm-up: 30px !default; +$modal-dialog-margin: .5rem !default; +$modal-dialog-margin-y-sm-up: 1.75rem !default; $modal-title-line-height: $line-height-base !default; -$modal-content-bg: $white !default; -$modal-content-border-color: rgba($black, .2) !default; -$modal-content-border-width: $border-width !default; -$modal-content-box-shadow-xs: 0 3px 9px rgba($black, .5) !default; -$modal-content-box-shadow-sm-up: 0 5px 15px rgba($black, .5) !default; +$modal-content-bg: $white !default; +$modal-content-border-color: rgba($black, .2) !default; +$modal-content-border-width: $border-width !default; +$modal-content-box-shadow-xs: 0 .25rem .5rem rgba($black, .5) !default; +$modal-content-box-shadow-sm-up: 0 .5rem 1rem rgba($black, .5) !default; -$modal-backdrop-bg: $black !default; -$modal-backdrop-opacity: .5 !default; -$modal-header-border-color: $gray-200 !default; -$modal-footer-border-color: $modal-header-border-color !default; -$modal-header-border-width: $modal-content-border-width !default; -$modal-footer-border-width: $modal-header-border-width !default; -$modal-header-padding: 15px !default; +$modal-backdrop-bg: $black !default; +$modal-backdrop-opacity: .5 !default; +$modal-header-border-color: $gray-200 !default; +$modal-footer-border-color: $modal-header-border-color !default; +$modal-header-border-width: $modal-content-border-width !default; +$modal-footer-border-width: $modal-header-border-width !default; +$modal-header-padding: 1rem !default; $modal-lg: 800px !default; $modal-md: 500px !default; @@ -720,6 +764,10 @@ $alert-border-radius: $border-radius !default; $alert-link-font-weight: $font-weight-bold !default; $alert-border-width: $border-width !default; +$alert-bg-level: -10 !default; +$alert-border-level: -9 !default; +$alert-color-level: 6 !default; + // Progress bars @@ -763,7 +811,7 @@ $list-group-action-active-bg: $gray-200 !default; $thumbnail-padding: .25rem !default; $thumbnail-bg: $body-bg !default; $thumbnail-border-width: $border-width !default; -$thumbnail-border-color: #ddd !default; +$thumbnail-border-color: $gray-300 !default; $thumbnail-border-radius: $border-radius !default; $thumbnail-box-shadow: 0 1px 2px rgba($black, .075) !default; @@ -819,12 +867,12 @@ $close-text-shadow: 0 1px 0 $white !default; // Code -$code-font-size: 90% !default; -$code-padding-y: .2rem !default; -$code-padding-x: .4rem !default; -$code-color: #bd4147 !default; -$code-bg: $gray-100 !default; +$code-font-size: 87.5% !default; +$code-color: $pink !default; +$kbd-padding-y: .2rem !default; +$kbd-padding-x: .4rem !default; +$kbd-font-size: $code-font-size !default; $kbd-color: $white !default; $kbd-bg: $gray-900 !default; diff --git a/assets/stylesheets/bootstrap/mixins/_background-variant.scss b/assets/stylesheets/bootstrap/mixins/_background-variant.scss index 7d1bc97..494439d 100644 --- a/assets/stylesheets/bootstrap/mixins/_background-variant.scss +++ b/assets/stylesheets/bootstrap/mixins/_background-variant.scss @@ -6,7 +6,8 @@ #{$parent} { background-color: $color !important; } - a#{$parent} { + a#{$parent}, + button#{$parent} { @include hover-focus { background-color: darken($color, 10%) !important; } diff --git a/assets/stylesheets/bootstrap/mixins/_breakpoints.scss b/assets/stylesheets/bootstrap/mixins/_breakpoints.scss index a9866bd..7c95c68 100644 --- a/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +++ b/assets/stylesheets/bootstrap/mixins/_breakpoints.scss @@ -29,13 +29,15 @@ } // Maximum breakpoint width. Null for the largest (last) breakpoint. -// The maximum value is calculated as the minimum of the next one less 0.1. +// The maximum value is calculated as the minimum of the next one less 0.01px +// to work around the limitations of `min-` and `max-` prefixes and viewports with fractional widths. +// See https://www.w3.org/TR/mediaqueries-4/#mq-min-max // // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // 767px @function breakpoint-max($name, $breakpoints: $grid-breakpoints) { $next: breakpoint-next($name, $breakpoints); - @return if($next, breakpoint-min($next, $breakpoints) - 1px, null); + @return if($next, breakpoint-min($next, $breakpoints) - .01px, null); } // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront. diff --git a/assets/stylesheets/bootstrap/mixins/_buttons.scss b/assets/stylesheets/bootstrap/mixins/_buttons.scss index 9e06261..252e26a 100644 --- a/assets/stylesheets/bootstrap/mixins/_buttons.scss +++ b/assets/stylesheets/bootstrap/mixins/_buttons.scss @@ -19,9 +19,9 @@ &.focus { // Avoid using mixin so we can pass custom focus shadow properly @if $enable-shadows { - box-shadow: $btn-box-shadow, 0 0 0 $input-btn-focus-width rgba($border, .5); + box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5); } @else { - box-shadow: 0 0 0 $input-btn-focus-width rgba($border, .5); + box-shadow: 0 0 0 $btn-focus-width rgba($border, .5); } } @@ -42,30 +42,32 @@ } border-color: $active-border; - // Avoid using mixin so we can pass custom focus shadow properly - @if $enable-shadows { - box-shadow: $btn-active-box-shadow, 0 0 0 $input-btn-focus-width rgba($border, .5); - } @else { - box-shadow: 0 0 0 $input-btn-focus-width rgba($border, .5); + &:focus { + // Avoid using mixin so we can pass custom focus shadow properly + @if $enable-shadows { + box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5); + } @else { + box-shadow: 0 0 0 $btn-focus-width rgba($border, .5); + } } } } -@mixin button-outline-variant($color, $color-hover: #fff) { +@mixin button-outline-variant($color, $color-hover: #fff, $active-background: $color, $active-border: $color) { color: $color; background-color: transparent; background-image: none; border-color: $color; - @include hover { - color: $color-hover; - background-color: $color; - border-color: $color; + &:hover { + color: color-yiq($color); + background-color: $active-background; + border-color: $active-border; } &:focus, &.focus { - box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .5); + box-shadow: 0 0 0 $btn-focus-width rgba($color, .5); } &.disabled, @@ -77,11 +79,11 @@ &:not([disabled]):not(.disabled):active, &:not([disabled]):not(.disabled).active, .show > &.dropdown-toggle { - color: $color-hover; - background-color: $color; - border-color: $color; + color: color-yiq($color-hover); + background-color: $active-background; + border-color: $active-border; // Avoid using mixin so we can pass custom focus shadow properly - box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .5); + box-shadow: 0 0 0 $btn-focus-width rgba($color, .5); } } @@ -90,5 +92,10 @@ padding: $padding-y $padding-x; font-size: $font-size; line-height: $line-height; - @include border-radius($border-radius); + // Manually declare to provide an override to the browser default + @if $enable-rounded { + border-radius: $border-radius; + } @else { + border-radius: 0; + } } diff --git a/assets/stylesheets/bootstrap/mixins/_caret.scss b/assets/stylesheets/bootstrap/mixins/_caret.scss index daab9d0..40478e4 100644 --- a/assets/stylesheets/bootstrap/mixins/_caret.scss +++ b/assets/stylesheets/bootstrap/mixins/_caret.scss @@ -12,6 +12,18 @@ border-left: $caret-width solid transparent; } +@mixin caret-right { + border-top: $caret-width solid transparent; + border-bottom: $caret-width solid transparent; + border-left: $caret-width solid; +} + +@mixin caret-left { + border-top: $caret-width solid transparent; + border-right: $caret-width solid; + border-bottom: $caret-width solid transparent; +} + @mixin caret($direction: down) { @if $enable-caret { &::after { @@ -25,6 +37,24 @@ @include caret-down; } @else if $direction == up { @include caret-up; + } @else if $direction == right { + @include caret-right; + } + } + + @if $direction == left { + &::after { + display: none; + } + + &::before { + display: inline-block; + width: 0; + height: 0; + margin-right: $caret-width * .85; + vertical-align: $caret-width * .85; + content: ""; + @include caret-left; } } diff --git a/assets/stylesheets/bootstrap/mixins/_forms.scss b/assets/stylesheets/bootstrap/mixins/_forms.scss index 564222a..d25df18 100644 --- a/assets/stylesheets/bootstrap/mixins/_forms.scss +++ b/assets/stylesheets/bootstrap/mixins/_forms.scss @@ -15,12 +15,12 @@ color: $input-focus-color; background-color: $input-focus-bg; border-color: $input-focus-border-color; - outline: none; + outline: 0; // Avoid using mixin so we can pass custom focus shadow properly @if $enable-shadows { - box-shadow: $input-box-shadow, $input-btn-focus-box-shadow; + box-shadow: $input-box-shadow, $input-focus-box-shadow; } @else { - box-shadow: $input-btn-focus-box-shadow; + box-shadow: $input-focus-box-shadow; } } } @@ -30,8 +30,9 @@ .#{$state}-feedback { display: none; - margin-top: .25rem; - font-size: .875rem; + width: 100%; + margin-top: $form-feedback-margin-top; + font-size: $form-feedback-font-size; color: $color; } @@ -57,7 +58,8 @@ border-color: $color; &:focus { - box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .25); + border-color: $color; + box-shadow: 0 0 0 $input-focus-width rgba($color, .25); } ~ .#{$state}-feedback, @@ -67,30 +69,40 @@ } } - - // TODO: redo check markup lol crap .form-check-input { .was-validated &:#{$state}, &.is-#{$state} { - + .form-check-label { + ~ .form-check-label { color: $color; } } } - // custom radios and checks .custom-control-input { .was-validated &:#{$state}, &.is-#{$state} { - ~ .custom-control-indicator { - background-color: rgba($color, .4); - } - ~ .custom-control-description { + ~ .custom-control-label { color: $color; + + &::before { + background-color: lighten($color, 25%); + } + } + + ~ .#{$state}-feedback, + ~ .#{$state}-tooltip { + display: block; } + + &:checked { + ~ .custom-control-label::before { + @include gradient-bg(lighten($color, 10%)); + } + } + &:focus { - ~ .custom-control-indicator { - box-shadow: 0 0 0 1px $body-bg, 0 0 0 $input-btn-focus-width rgba($color, .25); + ~ .custom-control-label::before { + box-shadow: 0 0 0 1px $body-bg, 0 0 0 $input-focus-width rgba($color, .25); } } } @@ -100,14 +112,20 @@ .custom-file-input { .was-validated &:#{$state}, &.is-#{$state} { - ~ .custom-file-control { + ~ .custom-file-label { border-color: $color; &::before { border-color: inherit; } } + + ~ .#{$state}-feedback, + ~ .#{$state}-tooltip { + display: block; + } + &:focus { - ~ .custom-file-control { - box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .25); + ~ .custom-file-label { + box-shadow: 0 0 0 $input-focus-width rgba($color, .25); } } } diff --git a/assets/stylesheets/bootstrap/mixins/_text-hide.scss b/assets/stylesheets/bootstrap/mixins/_text-hide.scss index 52a38a9..aa551fd 100644 --- a/assets/stylesheets/bootstrap/mixins/_text-hide.scss +++ b/assets/stylesheets/bootstrap/mixins/_text-hide.scss @@ -1,5 +1,6 @@ // CSS image replacement @mixin text-hide() { + // stylelint-disable-next-line font-family-no-missing-generic-family-keyword font: 0/0 a; color: transparent; text-shadow: none; diff --git a/assets/stylesheets/bootstrap/utilities/_borders.scss b/assets/stylesheets/bootstrap/utilities/_borders.scss index ba02f04..b8832ef 100644 --- a/assets/stylesheets/bootstrap/utilities/_borders.scss +++ b/assets/stylesheets/bootstrap/utilities/_borders.scss @@ -4,7 +4,12 @@ // Border // -.border { border: $border-width solid $border-color !important; } +.border { border: $border-width solid $border-color !important; } +.border-top { border-top: $border-width solid $border-color !important; } +.border-right { border-right: $border-width solid $border-color !important; } +.border-bottom { border-bottom: $border-width solid $border-color !important; } +.border-left { border-left: $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; } |