Bump bootstrap to 4.3.1

This commit is contained in:
2019-09-08 08:38:56 +02:00
parent e68c3148a2
commit aaaed4d784
93 changed files with 7790 additions and 6945 deletions
+6 -6
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+51 -51
View File
@@ -1,51 +1,51 @@
// //
// Base styles // Base styles
// //
.alert { .alert {
position: relative; position: relative;
padding: $alert-padding-y $alert-padding-x; padding: $alert-padding-y $alert-padding-x;
margin-bottom: $alert-margin-bottom; margin-bottom: $alert-margin-bottom;
border: $alert-border-width solid transparent; border: $alert-border-width solid transparent;
@include border-radius($alert-border-radius); @include border-radius($alert-border-radius);
} }
// Headings for larger alerts // Headings for larger alerts
.alert-heading { .alert-heading {
// Specified to prevent conflicts of changing $headings-color // Specified to prevent conflicts of changing $headings-color
color: inherit; color: inherit;
} }
// Provide class for links that match alerts // Provide class for links that match alerts
.alert-link { .alert-link {
font-weight: $alert-link-font-weight; font-weight: $alert-link-font-weight;
} }
// Dismissible alerts // Dismissible alerts
// //
// Expand the right padding and account for the close button's positioning. // Expand the right padding and account for the close button's positioning.
.alert-dismissible { .alert-dismissible {
padding-right: ($close-font-size + $alert-padding-x * 2); padding-right: $close-font-size + $alert-padding-x * 2;
// Adjust close link position // Adjust close link position
.close { .close {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
padding: $alert-padding-y $alert-padding-x; padding: $alert-padding-y $alert-padding-x;
color: inherit; color: inherit;
} }
} }
// Alternate styles // Alternate styles
// //
// Generate contextual modifier classes for colorizing the alert. // Generate contextual modifier classes for colorizing the alert.
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
.alert-#{$color} { .alert-#{$color} {
@include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level)); @include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level));
} }
} }
+54 -47
View File
@@ -1,47 +1,54 @@
// Base class // Base class
// //
// Requires one of the contextual, color modifier classes for `color` and // Requires one of the contextual, color modifier classes for `color` and
// `background-color`. // `background-color`.
.badge { .badge {
display: inline-block; display: inline-block;
padding: $badge-padding-y $badge-padding-x; padding: $badge-padding-y $badge-padding-x;
font-size: $badge-font-size; @include font-size($badge-font-size);
font-weight: $badge-font-weight; font-weight: $badge-font-weight;
line-height: 1; line-height: 1;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
vertical-align: baseline; vertical-align: baseline;
@include border-radius($badge-border-radius); @include border-radius($badge-border-radius);
@include transition($badge-transition);
// Empty badges collapse automatically
&:empty { @at-root a#{&} {
display: none; @include hover-focus {
} text-decoration: none;
} }
}
// Quick fix for badges in buttons
.btn .badge { // Empty badges collapse automatically
position: relative; &:empty {
top: -1px; display: none;
} }
}
// Pill badges
// // Quick fix for badges in buttons
// Make them extra rounded with a modifier to replace v3's badges. .btn .badge {
position: relative;
.badge-pill { top: -1px;
padding-right: $badge-pill-padding-x; }
padding-left: $badge-pill-padding-x;
@include border-radius($badge-pill-border-radius); // Pill badges
} //
// Make them extra rounded with a modifier to replace v3's badges.
// Colors
// .badge-pill {
// Contextual variations (linked badges get darker on :hover). padding-right: $badge-pill-padding-x;
padding-left: $badge-pill-padding-x;
@each $color, $value in $theme-colors { @include border-radius($badge-pill-border-radius);
.badge-#{$color} { }
@include badge-variant($value);
} // Colors
} //
// Contextual variations (linked badges get darker on :hover).
@each $color, $value in $theme-colors {
.badge-#{$color} {
@include badge-variant($value);
}
}
+41 -41
View File
@@ -1,41 +1,41 @@
.breadcrumb { .breadcrumb {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: $breadcrumb-padding-y $breadcrumb-padding-x; padding: $breadcrumb-padding-y $breadcrumb-padding-x;
margin-bottom: $breadcrumb-margin-bottom; margin-bottom: $breadcrumb-margin-bottom;
list-style: none; list-style: none;
background-color: $breadcrumb-bg; background-color: $breadcrumb-bg;
@include border-radius($breadcrumb-border-radius); @include border-radius($breadcrumb-border-radius);
} }
.breadcrumb-item { .breadcrumb-item {
// The separator between breadcrumbs (by default, a forward-slash: "/") // The separator between breadcrumbs (by default, a forward-slash: "/")
+ .breadcrumb-item { + .breadcrumb-item {
padding-left: $breadcrumb-item-padding; padding-left: $breadcrumb-item-padding;
&::before { &::before {
display: inline-block; // Suppress underlining of the separator in modern browsers display: inline-block; // Suppress underlining of the separator in modern browsers
padding-right: $breadcrumb-item-padding; padding-right: $breadcrumb-item-padding;
color: $breadcrumb-divider-color; color: $breadcrumb-divider-color;
content: $breadcrumb-divider; content: $breadcrumb-divider;
} }
} }
// IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built
// without `<ul>`s. The `::before` pseudo-element generates an element // without `<ul>`s. The `::before` pseudo-element generates an element
// *within* the .breadcrumb-item and thereby inherits the `text-decoration`. // *within* the .breadcrumb-item and thereby inherits the `text-decoration`.
// //
// To trick IE into suppressing the underline, we give the pseudo-element an // To trick IE into suppressing the underline, we give the pseudo-element an
// underline and then immediately remove it. // underline and then immediately remove it.
+ .breadcrumb-item:hover::before { + .breadcrumb-item:hover::before {
text-decoration: underline; text-decoration: underline;
} }
// stylelint-disable-next-line no-duplicate-selectors // stylelint-disable-next-line no-duplicate-selectors
+ .breadcrumb-item:hover::before { + .breadcrumb-item:hover::before {
text-decoration: none; text-decoration: none;
} }
&.active { &.active {
color: $breadcrumb-active-color; color: $breadcrumb-active-color;
} }
} }
+163 -172
View File
@@ -1,172 +1,163 @@
// stylelint-disable selector-no-qualifying-type // stylelint-disable selector-no-qualifying-type
// Make the div behave like a button // Make the div behave like a button
.btn-group, .btn-group,
.btn-group-vertical { .btn-group-vertical {
position: relative; position: relative;
display: inline-flex; display: inline-flex;
vertical-align: middle; // match .btn alignment given font-size hack above vertical-align: middle; // match .btn alignment given font-size hack above
> .btn { > .btn {
position: relative; position: relative;
flex: 0 1 auto; flex: 1 1 auto;
// Bring the hover, focused, and "active" buttons to the front to overlay // Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly // the borders properly
@include hover { @include hover {
z-index: 1; z-index: 1;
} }
&:focus, &:focus,
&:active, &:active,
&.active { &.active {
z-index: 1; z-index: 1;
} }
} }
}
// Prevent double borders when buttons are next to each other
.btn + .btn, // Optional: Group multiple button groups together for a toolbar
.btn + .btn-group, .btn-toolbar {
.btn-group + .btn, display: flex;
.btn-group + .btn-group { flex-wrap: wrap;
margin-left: -$btn-border-width; justify-content: flex-start;
}
} .input-group {
width: auto;
// Optional: Group multiple button groups together for a toolbar }
.btn-toolbar { }
display: flex;
flex-wrap: wrap; .btn-group {
justify-content: flex-start; // Prevent double borders when buttons are next to each other
> .btn:not(:first-child),
.input-group { > .btn-group:not(:first-child) {
width: auto; margin-left: -$btn-border-width;
} }
}
// Reset rounded corners
.btn-group { > .btn:not(:last-child):not(.dropdown-toggle),
> .btn:first-child { > .btn-group:not(:last-child) > .btn {
margin-left: 0; @include border-right-radius(0);
} }
// Reset rounded corners > .btn:not(:first-child),
> .btn:not(:last-child):not(.dropdown-toggle), > .btn-group:not(:first-child) > .btn {
> .btn-group:not(:last-child) > .btn { @include border-left-radius(0);
@include border-right-radius(0); }
} }
> .btn:not(:first-child), // Sizing
> .btn-group:not(:first-child) > .btn { //
@include border-left-radius(0); // Remix the default button sizing classes into new ones for easier manipulation.
}
} .btn-group-sm > .btn { @extend .btn-sm; }
.btn-group-lg > .btn { @extend .btn-lg; }
// Sizing
//
// Remix the default button sizing classes into new ones for easier manipulation. //
// Split button dropdowns
.btn-group-sm > .btn { @extend .btn-sm; } //
.btn-group-lg > .btn { @extend .btn-lg; }
.dropdown-toggle-split {
padding-right: $btn-padding-x * .75;
// padding-left: $btn-padding-x * .75;
// Split button dropdowns
// &::after,
.dropup &::after,
.dropdown-toggle-split { .dropright &::after {
padding-right: $btn-padding-x * .75; margin-left: 0;
padding-left: $btn-padding-x * .75; }
&::after, .dropleft &::before {
.dropup &::after, margin-right: 0;
.dropright &::after { }
margin-left: 0; }
}
.btn-sm + .dropdown-toggle-split {
.dropleft &::before { padding-right: $btn-padding-x-sm * .75;
margin-right: 0; padding-left: $btn-padding-x-sm * .75;
} }
}
.btn-lg + .dropdown-toggle-split {
.btn-sm + .dropdown-toggle-split { padding-right: $btn-padding-x-lg * .75;
padding-right: $btn-padding-x-sm * .75; padding-left: $btn-padding-x-lg * .75;
padding-left: $btn-padding-x-sm * .75; }
}
.btn-lg + .dropdown-toggle-split { // The clickable button for toggling the menu
padding-right: $btn-padding-x-lg * .75; // Set the same inset shadow as the :active state
padding-left: $btn-padding-x-lg * .75; .btn-group.show .dropdown-toggle {
} @include box-shadow($btn-active-box-shadow);
// Show no shadow for `.btn-link` since it has no other button styles.
// The clickable button for toggling the menu &.btn-link {
// Set the same inset shadow as the :active state @include box-shadow(none);
.btn-group.show .dropdown-toggle { }
@include box-shadow($btn-active-box-shadow); }
// Show no shadow for `.btn-link` since it has no other button styles.
&.btn-link { //
@include box-shadow(none); // Vertical button groups
} //
}
.btn-group-vertical {
flex-direction: column;
// align-items: flex-start;
// Vertical button groups justify-content: center;
//
> .btn,
.btn-group-vertical { > .btn-group {
flex-direction: column; width: 100%;
align-items: flex-start; }
justify-content: center;
> .btn:not(:first-child),
.btn, > .btn-group:not(:first-child) {
.btn-group { margin-top: -$btn-border-width;
width: 100%; }
}
// Reset rounded corners
> .btn + .btn, > .btn:not(:last-child):not(.dropdown-toggle),
> .btn + .btn-group, > .btn-group:not(:last-child) > .btn {
> .btn-group + .btn, @include border-bottom-radius(0);
> .btn-group + .btn-group { }
margin-top: -$btn-border-width;
margin-left: 0; > .btn:not(:first-child),
} > .btn-group:not(:first-child) > .btn {
@include border-top-radius(0);
// Reset rounded corners }
> .btn:not(:last-child):not(.dropdown-toggle), }
> .btn-group:not(:last-child) > .btn {
@include border-bottom-radius(0);
} // Checkbox and radio options
//
> .btn:not(:first-child), // In order to support the browser's form validation feedback, powered by the
> .btn-group:not(:first-child) > .btn { // `required` attribute, we have to "hide" the inputs via `clip`. We cannot use
@include border-top-radius(0); // `display: none;` or `visibility: hidden;` as that also hides the popover.
} // Simply visually hiding the inputs via `opacity` would leave them clickable in
} // certain cases which is prevented by using `clip` and `pointer-events`.
// This way, we ensure a DOM element is visible to position the popover from.
//
// Checkbox and radio options // See https://github.com/twbs/bootstrap/pull/12794 and
// // https://github.com/twbs/bootstrap/pull/14559 for more information.
// In order to support the browser's form validation feedback, powered by the
// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use .btn-group-toggle {
// `display: none;` or `visibility: hidden;` as that also hides the popover. > .btn,
// Simply visually hiding the inputs via `opacity` would leave them clickable in > .btn-group > .btn {
// certain cases which is prevented by using `clip` and `pointer-events`. margin-bottom: 0; // Override default `<label>` value
// This way, we ensure a DOM element is visible to position the popover from.
// input[type="radio"],
// See https://github.com/twbs/bootstrap/pull/12794 and input[type="checkbox"] {
// https://github.com/twbs/bootstrap/pull/14559 for more information. position: absolute;
clip: rect(0, 0, 0, 0);
.btn-group-toggle { pointer-events: none;
> .btn, }
> .btn-group > .btn { }
margin-bottom: 0; // Override default `<label>` value }
input[type="radio"],
input[type="checkbox"] {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
}
}
}
+137 -144
View File
@@ -1,144 +1,137 @@
// stylelint-disable selector-no-qualifying-type // stylelint-disable selector-no-qualifying-type
// //
// Base styles // Base styles
// //
.btn { .btn {
display: inline-block; display: inline-block;
font-weight: $btn-font-weight; font-family: $btn-font-family;
text-align: center; font-weight: $btn-font-weight;
white-space: nowrap; color: $body-color;
vertical-align: middle; text-align: center;
user-select: none; vertical-align: middle;
border: $btn-border-width solid transparent; user-select: none;
@include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-line-height, $btn-border-radius); background-color: transparent;
@include transition($btn-transition); border: $btn-border-width solid transparent;
@include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius);
// Share hover and focus styles @include transition($btn-transition);
@include hover-focus {
text-decoration: none; @include hover {
} color: $body-color;
text-decoration: none;
&:focus, }
&.focus {
outline: 0; &:focus,
box-shadow: $btn-focus-box-shadow; &.focus {
} outline: 0;
box-shadow: $btn-focus-box-shadow;
// Disabled comes first so active can properly restyle }
&.disabled,
&:disabled { // Disabled comes first so active can properly restyle
opacity: $btn-disabled-opacity; &.disabled,
@include box-shadow(none); &:disabled {
} 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 {
@include box-shadow($btn-active-box-shadow);
&:not(:disabled):not(.disabled):active,
&:not(:disabled):not(.disabled).active { &:focus {
background-image: none; @include box-shadow($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);
} // Future-proof disabling of clicks on `<a>` elements
} a.btn.disabled,
} fieldset:disabled a.btn {
pointer-events: none;
// Future-proof disabling of clicks on `<a>` elements }
a.btn.disabled,
fieldset:disabled a.btn {
pointer-events: none; //
} // Alternate buttons
//
// @each $color, $value in $theme-colors {
// Alternate buttons .btn-#{$color} {
// @include button-variant($value, $value);
}
@each $color, $value in $theme-colors { }
.btn-#{$color} {
@include button-variant($value, $value); @each $color, $value in $theme-colors {
} .btn-outline-#{$color} {
} @include button-outline-variant($value);
}
@each $color, $value in $theme-colors { }
.btn-outline-#{$color} {
@include button-outline-variant($value);
} //
} // Link buttons
//
// // Make a button look and behave like a link
// Link buttons .btn-link {
// font-weight: $font-weight-normal;
color: $link-color;
// Make a button look and behave like a link text-decoration: $link-decoration;
.btn-link {
font-weight: $font-weight-normal; @include hover {
color: $link-color; color: $link-hover-color;
background-color: transparent; text-decoration: $link-hover-decoration;
}
@include hover {
color: $link-hover-color; &:focus,
text-decoration: $link-hover-decoration; &.focus {
background-color: transparent; text-decoration: $link-hover-decoration;
border-color: transparent; box-shadow: none;
} }
&:focus, &:disabled,
&.focus { &.disabled {
text-decoration: $link-hover-decoration; color: $btn-link-disabled-color;
border-color: transparent; pointer-events: none;
box-shadow: none; }
}
// No need for an active state here
&:disabled, }
&.disabled {
color: $btn-link-disabled-color;
pointer-events: none; //
} // Button Sizes
//
// No need for an active state here
} .btn-lg {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
}
//
// Button Sizes .btn-sm {
// @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
}
.btn-lg {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
} //
// Block button
.btn-sm { //
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
} .btn-block {
display: block;
width: 100%;
//
// Block button // Vertically space out multiple block buttons
// + .btn-block {
margin-top: $btn-block-spacing-y;
.btn-block { }
display: block; }
width: 100%;
// Specificity overrides
// Vertically space out multiple block buttons input[type="submit"],
+ .btn-block { input[type="reset"],
margin-top: $btn-block-spacing-y; input[type="button"] {
} &.btn-block {
} width: 100%;
}
// Specificity overrides }
input[type="submit"],
input[type="reset"],
input[type="button"] {
&.btn-block {
width: 100%;
}
}
+289 -301
View File
@@ -1,301 +1,289 @@
// //
// Base styles // Base styles
// //
.card { .card {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-width: 0; min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106
word-wrap: break-word; word-wrap: break-word;
background-color: $card-bg; background-color: $card-bg;
background-clip: border-box; background-clip: border-box;
border: $card-border-width solid $card-border-color; border: $card-border-width solid $card-border-color;
@include border-radius($card-border-radius); @include border-radius($card-border-radius);
> hr { > hr {
margin-right: 0; margin-right: 0;
margin-left: 0; margin-left: 0;
} }
> .list-group:first-child { > .list-group:first-child {
.list-group-item:first-child { .list-group-item:first-child {
@include border-top-radius($card-border-radius); @include border-top-radius($card-border-radius);
} }
} }
> .list-group:last-child { > .list-group:last-child {
.list-group-item:last-child { .list-group-item:last-child {
@include border-bottom-radius($card-border-radius); @include border-bottom-radius($card-border-radius);
} }
} }
} }
.card-body { .card-body {
// Enable `flex-grow: 1` for decks and groups so that card blocks take up // Enable `flex-grow: 1` for decks and groups so that card blocks take up
// as much space as possible, ensuring footers are aligned to the bottom. // as much space as possible, ensuring footers are aligned to the bottom.
flex: 1 1 auto; flex: 1 1 auto;
padding: $card-spacer-x; padding: $card-spacer-x;
} color: $card-color;
}
.card-title {
margin-bottom: $card-spacer-y; .card-title {
} margin-bottom: $card-spacer-y;
}
.card-subtitle {
margin-top: -($card-spacer-y / 2); .card-subtitle {
margin-bottom: 0; margin-top: -$card-spacer-y / 2;
} margin-bottom: 0;
}
.card-text:last-child {
margin-bottom: 0; .card-text:last-child {
} margin-bottom: 0;
}
.card-link {
@include hover { .card-link {
text-decoration: none; @include hover {
} text-decoration: none;
}
+ .card-link {
margin-left: $card-spacer-x; + .card-link {
} margin-left: $card-spacer-x;
} }
}
//
// Optional textual caps //
// // Optional textual caps
//
.card-header {
padding: $card-spacer-y $card-spacer-x; .card-header {
margin-bottom: 0; // Removes the default margin-bottom of <hN> padding: $card-spacer-y $card-spacer-x;
background-color: $card-cap-bg; margin-bottom: 0; // Removes the default margin-bottom of <hN>
border-bottom: $card-border-width solid $card-border-color; color: $card-cap-color;
background-color: $card-cap-bg;
&:first-child { border-bottom: $card-border-width solid $card-border-color;
@include border-radius($card-inner-border-radius $card-inner-border-radius 0 0);
} &: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; + .list-group {
} .list-group-item:first-child {
} border-top: 0;
} }
}
.card-footer { }
padding: $card-spacer-y $card-spacer-x;
background-color: $card-cap-bg; .card-footer {
border-top: $card-border-width solid $card-border-color; padding: $card-spacer-y $card-spacer-x;
background-color: $card-cap-bg;
&:last-child { border-top: $card-border-width solid $card-border-color;
@include border-radius(0 0 $card-inner-border-radius $card-inner-border-radius);
} &:last-child {
} @include border-radius(0 0 $card-inner-border-radius $card-inner-border-radius);
}
}
//
// Header navs
// //
// Header navs
.card-header-tabs { //
margin-right: -($card-spacer-x / 2);
margin-bottom: -$card-spacer-y; .card-header-tabs {
margin-left: -($card-spacer-x / 2); margin-right: -$card-spacer-x / 2;
border-bottom: 0; margin-bottom: -$card-spacer-y;
} margin-left: -$card-spacer-x / 2;
border-bottom: 0;
.card-header-pills { }
margin-right: -($card-spacer-x / 2);
margin-left: -($card-spacer-x / 2); .card-header-pills {
} margin-right: -$card-spacer-x / 2;
margin-left: -$card-spacer-x / 2;
// Card image }
.card-img-overlay {
position: absolute; // Card image
top: 0; .card-img-overlay {
right: 0; position: absolute;
bottom: 0; top: 0;
left: 0; right: 0;
padding: $card-img-overlay-padding; bottom: 0;
} left: 0;
padding: $card-img-overlay-padding;
.card-img { }
width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
@include border-radius($card-inner-border-radius); .card-img {
} width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
@include border-radius($card-inner-border-radius);
// Card image caps }
.card-img-top {
width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch // Card image caps
@include border-top-radius($card-inner-border-radius); .card-img-top {
} width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
@include border-top-radius($card-inner-border-radius);
.card-img-bottom { }
width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
@include border-bottom-radius($card-inner-border-radius); .card-img-bottom {
} width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
@include border-bottom-radius($card-inner-border-radius);
}
// Card deck
.card-deck { // Card deck
display: flex;
flex-direction: column; .card-deck {
display: flex;
.card { flex-direction: column;
margin-bottom: $card-deck-margin;
} .card {
margin-bottom: $card-deck-margin;
@include media-breakpoint-up(sm) { }
flex-flow: row wrap;
margin-right: -$card-deck-margin; @include media-breakpoint-up(sm) {
margin-left: -$card-deck-margin; flex-flow: row wrap;
margin-right: -$card-deck-margin;
.card { margin-left: -$card-deck-margin;
display: flex;
// Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4 .card {
flex: 1 0 0%; display: flex;
flex-direction: column; // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4
margin-right: $card-deck-margin; flex: 1 0 0%;
margin-bottom: 0; // Override the default flex-direction: column;
margin-left: $card-deck-margin; margin-right: $card-deck-margin;
} margin-bottom: 0; // Override the default
} margin-left: $card-deck-margin;
} }
}
}
//
// Card groups
// //
// Card groups
.card-group { //
display: flex;
flex-direction: column; .card-group {
display: flex;
// The child selector allows nested `.card` within `.card-group` flex-direction: column;
// to display properly.
> .card { // The child selector allows nested `.card` within `.card-group`
margin-bottom: $card-group-margin; // to display properly.
} > .card {
margin-bottom: $card-group-margin;
@include media-breakpoint-up(sm) { }
flex-flow: row wrap;
// The child selector allows nested `.card` within `.card-group` @include media-breakpoint-up(sm) {
// to display properly. flex-flow: row wrap;
> .card { // The child selector allows nested `.card` within `.card-group`
// Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4 // to display properly.
flex: 1 0 0%; > .card {
margin-bottom: 0; // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4
flex: 1 0 0%;
+ .card { margin-bottom: 0;
margin-left: 0;
border-left: 0; + .card {
} margin-left: 0;
border-left: 0;
// Handle rounded corners }
@if $enable-rounded {
&:first-child { // Handle rounded corners
@include border-right-radius(0); @if $enable-rounded {
&:not(:last-child) {
.card-img-top, @include border-right-radius(0);
.card-header {
border-top-right-radius: 0; .card-img-top,
} .card-header {
.card-img-bottom, // stylelint-disable-next-line property-blacklist
.card-footer { border-top-right-radius: 0;
border-bottom-right-radius: 0; }
} .card-img-bottom,
} .card-footer {
// stylelint-disable-next-line property-blacklist
&:last-child { border-bottom-right-radius: 0;
@include border-left-radius(0); }
}
.card-img-top,
.card-header { &:not(:first-child) {
border-top-left-radius: 0; @include border-left-radius(0);
}
.card-img-bottom, .card-img-top,
.card-footer { .card-header {
border-bottom-left-radius: 0; // stylelint-disable-next-line property-blacklist
} border-top-left-radius: 0;
} }
.card-img-bottom,
&:only-child { .card-footer {
@include border-radius($card-border-radius); // stylelint-disable-next-line property-blacklist
border-bottom-left-radius: 0;
.card-img-top, }
.card-header { }
@include border-top-radius($card-border-radius); }
} }
.card-img-bottom, }
.card-footer { }
@include border-bottom-radius($card-border-radius);
}
} //
// Columns
&:not(:first-child):not(:last-child):not(:only-child) { //
@include border-radius(0);
.card-columns {
.card-img-top, .card {
.card-img-bottom, margin-bottom: $card-columns-margin;
.card-header, }
.card-footer {
@include border-radius(0); @include media-breakpoint-up(sm) {
} column-count: $card-columns-count;
} column-gap: $card-columns-gap;
} orphans: 1;
} widows: 1;
}
} .card {
display: inline-block; // Don't let them vertically span multiple columns
width: 100%; // Don't let their width change
// }
// Columns }
// }
.card-columns {
.card { //
margin-bottom: $card-columns-margin; // Accordion
} //
@include media-breakpoint-up(sm) { .accordion {
column-count: $card-columns-count; > .card {
column-gap: $card-columns-gap; overflow: hidden;
orphans: 1;
widows: 1; &:not(:first-of-type) {
.card-header:first-child {
.card { @include border-radius(0);
display: inline-block; // Don't let them vertically span multiple columns }
width: 100%; // Don't let their width change
} &:not(:last-of-type) {
} border-bottom: 0;
} @include border-radius(0);
}
}
//
// Accordion &:first-of-type {
// border-bottom: 0;
@include border-bottom-radius(0);
.accordion { }
.card:not(:first-of-type):not(:last-of-type) {
border-bottom: 0; &:last-of-type {
border-radius: 0; @include border-top-radius(0);
} }
.card:not(:first-of-type) { .card-header {
.card-header:first-child { margin-bottom: -$card-border-width;
border-radius: 0; }
} }
} }
.card:first-of-type {
border-bottom: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.card:last-of-type {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
+197 -236
View File
@@ -1,236 +1,197 @@
// Notes on the classes: // Notes on the classes:
// //
// 1. The .carousel-item-left and .carousel-item-right is used to indicate where // 1. .carousel.pointer-event should ideally be pan-y (to allow for users to scroll vertically)
// the active slide is heading. // even when their scroll action started on a carousel, but for compatibility (with Firefox)
// 2. .active.carousel-item is the current slide. // we're preventing all actions instead
// 3. .active.carousel-item-left and .active.carousel-item-right is the current // 2. The .carousel-item-left and .carousel-item-right is used to indicate where
// slide in its in-transition state. Only one of these occurs at a time. // the active slide is heading.
// 4. .carousel-item-next.carousel-item-left and .carousel-item-prev.carousel-item-right // 3. .active.carousel-item is the current slide.
// is the upcoming slide in transition. // 4. .active.carousel-item-left and .active.carousel-item-right is the current
// slide in its in-transition state. Only one of these occurs at a time.
.carousel { // 5. .carousel-item-next.carousel-item-left and .carousel-item-prev.carousel-item-right
position: relative; // is the upcoming slide in transition.
}
.carousel {
.carousel-inner { position: relative;
position: relative; }
width: 100%;
overflow: hidden; .carousel.pointer-event {
} touch-action: pan-y;
}
.carousel-item {
position: relative; .carousel-inner {
display: none; position: relative;
align-items: center; width: 100%;
width: 100%; overflow: hidden;
@include transition($carousel-transition); @include clearfix();
backface-visibility: hidden; }
perspective: 1000px;
} .carousel-item {
position: relative;
.carousel-item.active, display: none;
.carousel-item-next, float: left;
.carousel-item-prev { width: 100%;
display: block; margin-right: -100%;
} backface-visibility: hidden;
@include transition($carousel-transition);
.carousel-item-next, }
.carousel-item-prev {
position: absolute; .carousel-item.active,
top: 0; .carousel-item-next,
} .carousel-item-prev {
display: block;
.carousel-item-next.carousel-item-left, }
.carousel-item-prev.carousel-item-right {
transform: translateX(0); .carousel-item-next:not(.carousel-item-left),
.active.carousel-item-right {
@supports (transform-style: preserve-3d) { transform: translateX(100%);
transform: translate3d(0, 0, 0); }
}
} .carousel-item-prev:not(.carousel-item-right),
.active.carousel-item-left {
.carousel-item-next, transform: translateX(-100%);
.active.carousel-item-right { }
transform: translateX(100%);
@supports (transform-style: preserve-3d) { //
transform: translate3d(100%, 0, 0); // Alternate transitions
} //
}
.carousel-fade {
.carousel-item-prev, .carousel-item {
.active.carousel-item-left { opacity: 0;
transform: translateX(-100%); transition-property: opacity;
transform: none;
@supports (transform-style: preserve-3d) { }
transform: translate3d(-100%, 0, 0);
} .carousel-item.active,
} .carousel-item-next.carousel-item-left,
.carousel-item-prev.carousel-item-right {
z-index: 1;
// opacity: 1;
// Alternate transitions }
//
.active.carousel-item-left,
.carousel-fade { .active.carousel-item-right {
.carousel-item { z-index: 0;
opacity: 0; opacity: 0;
transition-duration: .6s; @include transition(0s $carousel-transition-duration opacity);
transition-property: opacity; }
} }
.carousel-item.active,
.carousel-item-next.carousel-item-left, //
.carousel-item-prev.carousel-item-right { // Left/right controls for nav
opacity: 1; //
}
.carousel-control-prev,
.active.carousel-item-left, .carousel-control-next {
.active.carousel-item-right { position: absolute;
opacity: 0; top: 0;
} bottom: 0;
z-index: 1;
.carousel-item-next, // Use flex for alignment (1-3)
.carousel-item-prev, display: flex; // 1. allow flex styles
.carousel-item.active, align-items: center; // 2. vertically center contents
.active.carousel-item-left, justify-content: center; // 3. horizontally center contents
.active.carousel-item-prev { width: $carousel-control-width;
transform: translateX(0); color: $carousel-control-color;
text-align: center;
@supports (transform-style: preserve-3d) { opacity: $carousel-control-opacity;
transform: translate3d(0, 0, 0); @include transition($carousel-control-transition);
}
} // Hover/focus state
} @include hover-focus {
color: $carousel-control-color;
text-decoration: none;
// outline: 0;
// Left/right controls for nav opacity: $carousel-control-hover-opacity;
// }
}
.carousel-control-prev, .carousel-control-prev {
.carousel-control-next { left: 0;
position: absolute; @if $enable-gradients {
top: 0; background: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
bottom: 0; }
// Use flex for alignment (1-3) }
display: flex; // 1. allow flex styles .carousel-control-next {
align-items: center; // 2. vertically center contents right: 0;
justify-content: center; // 3. horizontally center contents @if $enable-gradients {
width: $carousel-control-width; background: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
color: $carousel-control-color; }
text-align: center; }
opacity: $carousel-control-opacity;
// We can't have a transition here because WebKit cancels the carousel // Icons for within
// animation if you trip this while in the middle of another animation. .carousel-control-prev-icon,
.carousel-control-next-icon {
// Hover/focus state display: inline-block;
@include hover-focus { width: $carousel-control-icon-width;
color: $carousel-control-color; height: $carousel-control-icon-width;
text-decoration: none; background: no-repeat 50% / 100% 100%;
outline: 0; }
opacity: .9; .carousel-control-prev-icon {
} background-image: $carousel-control-prev-icon-bg;
} }
.carousel-control-prev { .carousel-control-next-icon {
left: 0; background-image: $carousel-control-next-icon-bg;
@if $enable-gradients { }
background: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
}
} // Optional indicator pips
.carousel-control-next { //
right: 0; // Add an ordered list with the following class and add a list item for each
@if $enable-gradients { // slide your carousel holds.
background: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
} .carousel-indicators {
} position: absolute;
right: 0;
// Icons for within bottom: 0;
.carousel-control-prev-icon, left: 0;
.carousel-control-next-icon { z-index: 15;
display: inline-block; display: flex;
width: $carousel-control-icon-width; justify-content: center;
height: $carousel-control-icon-width; padding-left: 0; // override <ol> default
background: transparent no-repeat center center; // Use the .carousel-control's width as margin so we don't overlay those
background-size: 100% 100%; margin-right: $carousel-control-width;
} margin-left: $carousel-control-width;
.carousel-control-prev-icon { list-style: none;
background-image: $carousel-control-prev-icon-bg;
} li {
.carousel-control-next-icon { box-sizing: content-box;
background-image: $carousel-control-next-icon-bg; flex: 0 1 auto;
} width: $carousel-indicator-width;
height: $carousel-indicator-height;
margin-right: $carousel-indicator-spacer;
// Optional indicator pips margin-left: $carousel-indicator-spacer;
// text-indent: -999px;
// Add an ordered list with the following class and add a list item for each cursor: pointer;
// slide your carousel holds. background-color: $carousel-indicator-active-bg;
background-clip: padding-box;
.carousel-indicators { // Use transparent borders to increase the hit area by 10px on top and bottom.
position: absolute; border-top: $carousel-indicator-hit-area-height solid transparent;
right: 0; border-bottom: $carousel-indicator-hit-area-height solid transparent;
bottom: 10px; opacity: .5;
left: 0; @include transition($carousel-indicator-transition);
z-index: 15; }
display: flex;
justify-content: center; .active {
padding-left: 0; // override <ol> default opacity: 1;
// Use the .carousel-control's width as margin so we don't overlay those }
margin-right: $carousel-control-width; }
margin-left: $carousel-control-width;
list-style: none;
// Optional captions
li { //
position: relative; //
flex: 0 1 auto;
width: $carousel-indicator-width; .carousel-caption {
height: $carousel-indicator-height; position: absolute;
margin-right: $carousel-indicator-spacer; right: (100% - $carousel-caption-width) / 2;
margin-left: $carousel-indicator-spacer; bottom: 20px;
text-indent: -999px; left: (100% - $carousel-caption-width) / 2;
cursor: pointer; z-index: 10;
background-color: rgba($carousel-indicator-active-bg, .5); padding-top: 20px;
padding-bottom: 20px;
// Use pseudo classes to increase the hit area by 10px on top and bottom. color: $carousel-caption-color;
&::before { text-align: center;
position: absolute; }
top: -10px;
left: 0;
display: inline-block;
width: 100%;
height: 10px;
content: "";
}
&::after {
position: absolute;
bottom: -10px;
left: 0;
display: inline-block;
width: 100%;
height: 10px;
content: "";
}
}
.active {
background-color: $carousel-indicator-active-bg;
}
}
// Optional captions
//
//
.carousel-caption {
position: absolute;
right: ((100% - $carousel-caption-width) / 2);
bottom: 20px;
left: ((100% - $carousel-caption-width) / 2);
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: $carousel-caption-color;
text-align: center;
}
+41 -34
View File
@@ -1,34 +1,41 @@
.close { .close {
float: right; float: right;
font-size: $close-font-size; @include font-size($close-font-size);
font-weight: $close-font-weight; font-weight: $close-font-weight;
line-height: 1; line-height: 1;
color: $close-color; color: $close-color;
text-shadow: $close-text-shadow; text-shadow: $close-text-shadow;
opacity: .5; opacity: .5;
@include hover-focus { // Override <a>'s hover style
color: $close-color; @include hover {
text-decoration: none; color: $close-color;
opacity: .75; text-decoration: none;
} }
// Opinionated: add "hand" cursor to non-disabled .close elements &:not(:disabled):not(.disabled) {
&:not(:disabled):not(.disabled) { @include hover-focus {
cursor: pointer; opacity: .75;
} }
} }
}
// Additional properties for button version
// iOS requires the button element instead of an anchor tag. // Additional properties for button version
// If you want the anchor version, it requires `href="#"`. // iOS requires the button element instead of an anchor tag.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile // If you want the anchor version, it requires `href="#"`.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
// stylelint-disable property-no-vendor-prefix, selector-no-qualifying-type
button.close { // stylelint-disable-next-line selector-no-qualifying-type
padding: 0; button.close {
background-color: transparent; padding: 0;
border: 0; background-color: transparent;
-webkit-appearance: none; border: 0;
} appearance: none;
// stylelint-enable }
// Future-proof disabling of clicks on `<a>` elements
// stylelint-disable-next-line selector-no-qualifying-type
a.close.disabled {
pointer-events: none;
}
+48 -48
View File
@@ -1,48 +1,48 @@
// Inline code // Inline code
code { code {
font-size: $code-font-size; @include font-size($code-font-size);
color: $code-color; color: $code-color;
word-break: break-word; word-break: break-word;
// Streamline the style when inside anchors to avoid broken underline and more // Streamline the style when inside anchors to avoid broken underline and more
a > & { a > & {
color: inherit; color: inherit;
} }
} }
// User input typically entered via keyboard // User input typically entered via keyboard
kbd { kbd {
padding: $kbd-padding-y $kbd-padding-x; padding: $kbd-padding-y $kbd-padding-x;
font-size: $kbd-font-size; @include font-size($kbd-font-size);
color: $kbd-color; color: $kbd-color;
background-color: $kbd-bg; background-color: $kbd-bg;
@include border-radius($border-radius-sm); @include border-radius($border-radius-sm);
@include box-shadow($kbd-box-shadow); @include box-shadow($kbd-box-shadow);
kbd { kbd {
padding: 0; padding: 0;
font-size: 100%; @include font-size(100%);
font-weight: $nested-kbd-font-weight; font-weight: $nested-kbd-font-weight;
@include box-shadow(none); @include box-shadow(none);
} }
} }
// Blocks of code // Blocks of code
pre { pre {
display: block; display: block;
font-size: $code-font-size; @include font-size($code-font-size);
color: $pre-color; color: $pre-color;
// Account for some code outputs that place code tags in pre tags // Account for some code outputs that place code tags in pre tags
code { code {
font-size: inherit; @include font-size(inherit);
color: inherit; color: inherit;
word-break: normal; word-break: normal;
} }
} }
// Enable scrollable blocks of code // Enable scrollable blocks of code
.pre-scrollable { .pre-scrollable {
max-height: $pre-scrollable-max-height; max-height: $pre-scrollable-max-height;
overflow-y: scroll; overflow-y: scroll;
} }
+507 -421
View File
@@ -1,421 +1,507 @@
// Embedded icons from Open Iconic. // Embedded icons from Open Iconic.
// Released under MIT and copyright 2014 Waybury. // Released under MIT and copyright 2014 Waybury.
// https://useiconic.com/open // https://useiconic.com/open
// Checkboxes and radios // Checkboxes and radios
// //
// Base class takes care of all the key behavioral aspects. // Base class takes care of all the key behavioral aspects.
.custom-control { .custom-control {
position: relative; position: relative;
display: block; display: block;
min-height: (1rem * $line-height-base); min-height: $font-size-base * $line-height-base;
padding-left: $custom-control-gutter; padding-left: $custom-control-gutter + $custom-control-indicator-size;
} }
.custom-control-inline { .custom-control-inline {
display: inline-flex; display: inline-flex;
margin-right: $custom-control-spacer-x; margin-right: $custom-control-spacer-x;
} }
.custom-control-input { .custom-control-input {
position: absolute; position: absolute;
z-index: -1; // Put the input behind the label so it doesn't overlay text z-index: -1; // Put the input behind the label so it doesn't overlay text
opacity: 0; opacity: 0;
&:checked ~ .custom-control-label::before { &:checked ~ .custom-control-label::before {
color: $custom-control-indicator-checked-color; color: $custom-control-indicator-checked-color;
@include gradient-bg($custom-control-indicator-checked-bg); border-color: $custom-control-indicator-checked-border-color;
@include box-shadow($custom-control-indicator-checked-box-shadow); @include gradient-bg($custom-control-indicator-checked-bg);
} @include box-shadow($custom-control-indicator-checked-box-shadow);
}
&:focus ~ .custom-control-label::before {
// the mixin is not used here to make sure there is feedback &:focus ~ .custom-control-label::before {
box-shadow: $custom-control-indicator-focus-box-shadow; // the mixin is not used here to make sure there is feedback
} @if $enable-shadows {
box-shadow: $input-box-shadow, $input-focus-box-shadow;
&:active ~ .custom-control-label::before { } @else {
color: $custom-control-indicator-active-color; box-shadow: $custom-control-indicator-focus-box-shadow;
background-color: $custom-control-indicator-active-bg; }
@include box-shadow($custom-control-indicator-active-box-shadow); }
}
&:focus:not(:checked) ~ .custom-control-label::before {
&:disabled { border-color: $custom-control-indicator-focus-border-color;
~ .custom-control-label { }
color: $custom-control-label-disabled-color;
&:not(:disabled):active ~ .custom-control-label::before {
&::before { color: $custom-control-indicator-active-color;
background-color: $custom-control-indicator-disabled-bg; background-color: $custom-control-indicator-active-bg;
} border-color: $custom-control-indicator-active-border-color;
} @include box-shadow($custom-control-indicator-active-box-shadow);
} }
}
&:disabled {
// Custom control indicators ~ .custom-control-label {
// color: $custom-control-label-disabled-color;
// Build the custom controls out of pseudo-elements.
&::before {
.custom-control-label { background-color: $custom-control-indicator-disabled-bg;
position: relative; }
margin-bottom: 0; }
}
// Background-color and (when enabled) gradient }
&::before {
position: absolute; // Custom control indicators
top: (($line-height-base - $custom-control-indicator-size) / 2); //
left: -$custom-control-gutter; // Build the custom controls out of pseudo-elements.
display: block;
width: $custom-control-indicator-size; .custom-control-label {
height: $custom-control-indicator-size; position: relative;
pointer-events: none; margin-bottom: 0;
content: ""; vertical-align: top;
user-select: none;
background-color: $custom-control-indicator-bg; // Background-color and (when enabled) gradient
@include box-shadow($custom-control-indicator-box-shadow); &::before {
} position: absolute;
top: ($font-size-base * $line-height-base - $custom-control-indicator-size) / 2;
// Foreground (icon) left: -($custom-control-gutter + $custom-control-indicator-size);
&::after { display: block;
position: absolute; width: $custom-control-indicator-size;
top: (($line-height-base - $custom-control-indicator-size) / 2); height: $custom-control-indicator-size;
left: -$custom-control-gutter; pointer-events: none;
display: block; content: "";
width: $custom-control-indicator-size; background-color: $custom-control-indicator-bg;
height: $custom-control-indicator-size; border: $custom-control-indicator-border-color solid $custom-control-indicator-border-width;
content: ""; @include box-shadow($custom-control-indicator-box-shadow);
background-repeat: no-repeat; }
background-position: center center;
background-size: $custom-control-indicator-bg-size; // Foreground (icon)
} &::after {
} position: absolute;
top: ($font-size-base * $line-height-base - $custom-control-indicator-size) / 2;
left: -($custom-control-gutter + $custom-control-indicator-size);
// Checkboxes display: block;
// width: $custom-control-indicator-size;
// Tweak just a few things for checkboxes. height: $custom-control-indicator-size;
content: "";
.custom-checkbox { background: no-repeat 50% / #{$custom-control-indicator-bg-size};
.custom-control-label::before { }
@include border-radius($custom-checkbox-indicator-border-radius); }
}
.custom-control-input:checked ~ .custom-control-label { // Checkboxes
&::before { //
@include gradient-bg($custom-control-indicator-checked-bg); // Tweak just a few things for checkboxes.
}
&::after { .custom-checkbox {
background-image: $custom-checkbox-indicator-icon-checked; .custom-control-label::before {
} @include border-radius($custom-checkbox-indicator-border-radius);
} }
.custom-control-input:indeterminate ~ .custom-control-label { .custom-control-input:checked ~ .custom-control-label {
&::before { &::after {
@include gradient-bg($custom-checkbox-indicator-indeterminate-bg); background-image: $custom-checkbox-indicator-icon-checked;
@include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow); }
} }
&::after {
background-image: $custom-checkbox-indicator-icon-indeterminate; .custom-control-input:indeterminate ~ .custom-control-label {
} &::before {
} border-color: $custom-checkbox-indicator-indeterminate-border-color;
@include gradient-bg($custom-checkbox-indicator-indeterminate-bg);
.custom-control-input:disabled { @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow);
&:checked ~ .custom-control-label::before { }
background-color: $custom-control-indicator-checked-disabled-bg; &::after {
} background-image: $custom-checkbox-indicator-icon-indeterminate;
&:indeterminate ~ .custom-control-label::before { }
background-color: $custom-control-indicator-checked-disabled-bg; }
}
} .custom-control-input:disabled {
} &:checked ~ .custom-control-label::before {
background-color: $custom-control-indicator-checked-disabled-bg;
// Radios }
// &:indeterminate ~ .custom-control-label::before {
// Tweak just a few things for radios. background-color: $custom-control-indicator-checked-disabled-bg;
}
.custom-radio { }
.custom-control-label::before { }
border-radius: $custom-radio-indicator-border-radius;
} // Radios
//
.custom-control-input:checked ~ .custom-control-label { // Tweak just a few things for radios.
&::before {
@include gradient-bg($custom-control-indicator-checked-bg); .custom-radio {
} .custom-control-label::before {
&::after { // stylelint-disable-next-line property-blacklist
background-image: $custom-radio-indicator-icon-checked; border-radius: $custom-radio-indicator-border-radius;
} }
}
.custom-control-input:checked ~ .custom-control-label {
.custom-control-input:disabled { &::after {
&:checked ~ .custom-control-label::before { background-image: $custom-radio-indicator-icon-checked;
background-color: $custom-control-indicator-checked-disabled-bg; }
} }
}
} .custom-control-input:disabled {
&:checked ~ .custom-control-label::before {
background-color: $custom-control-indicator-checked-disabled-bg;
// Select }
// }
// Replaces the browser default select with a custom one, mostly pulled from }
// https://primer.github.io/.
//
// switches
.custom-select { //
display: inline-block; // Tweak a few things for switches
width: 100%;
height: $custom-select-height; .custom-switch {
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x; padding-left: $custom-switch-width + $custom-control-gutter;
line-height: $custom-select-line-height;
color: $custom-select-color; .custom-control-label {
vertical-align: middle; &::before {
background: $custom-select-bg $custom-select-indicator no-repeat right $custom-select-padding-x center; left: -($custom-switch-width + $custom-control-gutter);
background-size: $custom-select-bg-size; width: $custom-switch-width;
border: $custom-select-border-width solid $custom-select-border-color; pointer-events: all;
@if $enable-rounded { // stylelint-disable-next-line property-blacklist
border-radius: $custom-select-border-radius; border-radius: $custom-switch-indicator-border-radius;
} @else { }
border-radius: 0;
} &::after {
appearance: none; top: calc(#{(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2)} + #{$custom-control-indicator-border-width * 2});
left: calc(#{-($custom-switch-width + $custom-control-gutter)} + #{$custom-control-indicator-border-width * 2});
&:focus { width: $custom-switch-indicator-size;
border-color: $custom-select-focus-border-color; height: $custom-switch-indicator-size;
outline: 0; background-color: $custom-control-indicator-border-color;
box-shadow: $custom-select-focus-box-shadow; // stylelint-disable-next-line property-blacklist
border-radius: $custom-switch-indicator-border-radius;
&::-ms-value { @include transition(transform .15s ease-in-out, $custom-forms-transition);
// For visual consistency with other platforms/browsers, }
// 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. .custom-control-input:checked ~ .custom-control-label {
// See https://github.com/twbs/bootstrap/issues/19398. &::after {
color: $input-color; background-color: $custom-control-indicator-bg;
background-color: $input-bg; transform: translateX($custom-switch-width - $custom-control-indicator-size);
} }
} }
&[multiple], .custom-control-input:disabled {
&[size]:not([size="1"]) { &:checked ~ .custom-control-label::before {
height: auto; background-color: $custom-control-indicator-checked-disabled-bg;
padding-right: $custom-select-padding-x; }
background-image: none; }
} }
&:disabled {
color: $custom-select-disabled-color; // Select
background-color: $custom-select-disabled-bg; //
} // Replaces the browser default select with a custom one, mostly pulled from
// https://primer.github.io/.
// Hides the default caret in IE11 //
&::-ms-expand {
opacity: 0; .custom-select {
} display: inline-block;
} width: 100%;
height: $custom-select-height;
.custom-select-sm { padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
height: $custom-select-height-sm; font-family: $custom-select-font-family;
padding-top: $custom-select-padding-y; @include font-size($custom-select-font-size);
padding-bottom: $custom-select-padding-y; font-weight: $custom-select-font-weight;
font-size: $custom-select-font-size-sm; line-height: $custom-select-line-height;
} color: $custom-select-color;
vertical-align: middle;
.custom-select-lg { background: $custom-select-background;
height: $custom-select-height-lg; background-color: $custom-select-bg;
padding-top: $custom-select-padding-y; border: $custom-select-border-width solid $custom-select-border-color;
padding-bottom: $custom-select-padding-y; @include border-radius($custom-select-border-radius, 0);
font-size: $custom-select-font-size-lg; @include box-shadow($custom-select-box-shadow);
} appearance: none;
&:focus {
// File border-color: $custom-select-focus-border-color;
// outline: 0;
// Custom file input. @if $enable-shadows {
box-shadow: $custom-select-box-shadow, $custom-select-focus-box-shadow;
.custom-file { } @else {
position: relative; box-shadow: $custom-select-focus-box-shadow;
display: inline-block; }
width: 100%;
height: $custom-file-height; &::-ms-value {
margin-bottom: 0; // For visual consistency with other platforms/browsers,
} // suppress the default white text on blue background highlight given to
// the selected option text when the (still closed) <select> receives focus
.custom-file-input { // in IE and (under certain conditions) Edge.
position: relative; // See https://github.com/twbs/bootstrap/issues/19398.
z-index: 2; color: $input-color;
width: 100%; background-color: $input-bg;
height: $custom-file-height; }
margin: 0; }
opacity: 0;
&[multiple],
&:focus ~ .custom-file-label { &[size]:not([size="1"]) {
border-color: $custom-file-focus-border-color; height: auto;
box-shadow: $custom-file-focus-box-shadow; padding-right: $custom-select-padding-x;
background-image: none;
&::after { }
border-color: $custom-file-focus-border-color;
} &:disabled {
} color: $custom-select-disabled-color;
background-color: $custom-select-disabled-bg;
@each $lang, $value in $custom-file-text { }
&:lang(#{$lang}) ~ .custom-file-label::after {
content: $value; // Hides the default caret in IE11
} &::-ms-expand {
} display: none;
} }
}
.custom-file-label {
position: absolute; .custom-select-sm {
top: 0; height: $custom-select-height-sm;
right: 0; padding-top: $custom-select-padding-y-sm;
left: 0; padding-bottom: $custom-select-padding-y-sm;
z-index: 1; padding-left: $custom-select-padding-x-sm;
height: $custom-file-height; @include font-size($custom-select-font-size-sm);
padding: $custom-file-padding-y $custom-file-padding-x; }
line-height: $custom-file-line-height;
color: $custom-file-color; .custom-select-lg {
background-color: $custom-file-bg; height: $custom-select-height-lg;
border: $custom-file-border-width solid $custom-file-border-color; padding-top: $custom-select-padding-y-lg;
@include border-radius($custom-file-border-radius); padding-bottom: $custom-select-padding-y-lg;
@include box-shadow($custom-file-box-shadow); padding-left: $custom-select-padding-x-lg;
@include font-size($custom-select-font-size-lg);
&::after { }
position: absolute;
top: 0;
right: 0; // File
bottom: 0; //
z-index: 3; // Custom file input.
display: block;
height: $custom-file-height-inner; .custom-file {
padding: $custom-file-padding-y $custom-file-padding-x; position: relative;
line-height: $custom-file-line-height; display: inline-block;
color: $custom-file-button-color; width: 100%;
content: "Browse"; height: $custom-file-height;
@include gradient-bg($custom-file-button-bg); margin-bottom: 0;
border-left: $custom-file-border-width solid $custom-file-border-color; }
@include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
} .custom-file-input {
} position: relative;
z-index: 2;
// Range width: 100%;
// height: $custom-file-height;
// Style range inputs the same across browsers. Vendor-specific rules for pseudo margin: 0;
// elements cannot be mixed. As such, there are no shared styles for focus or opacity: 0;
// active states on prefixed selectors.
&:focus ~ .custom-file-label {
.custom-range { border-color: $custom-file-focus-border-color;
width: 100%; box-shadow: $custom-file-focus-box-shadow;
padding-left: 0; // Firefox specific }
background-color: transparent;
appearance: none; &:disabled ~ .custom-file-label {
background-color: $custom-file-disabled-bg;
&:focus { }
outline: none;
} @each $lang, $value in $custom-file-text {
&:lang(#{$lang}) ~ .custom-file-label::after {
&::-moz-focus-outer { content: $value;
border: 0; }
} }
&::-webkit-slider-thumb { ~ .custom-file-label[data-browse]::after {
width: $custom-range-thumb-width; content: attr(data-browse);
height: $custom-range-thumb-height; }
margin-top: -($custom-range-thumb-width * .25); // Webkit specific? }
@include gradient-bg($custom-range-thumb-bg);
border: $custom-range-thumb-border; .custom-file-label {
@include border-radius($custom-range-thumb-border-radius); position: absolute;
@include box-shadow($custom-range-thumb-box-shadow); top: 0;
appearance: none; right: 0;
left: 0;
&:focus { z-index: 1;
outline: none; height: $custom-file-height;
box-shadow: $custom-range-thumb-focus-box-shadow; // No mixin for focus accessibility padding: $custom-file-padding-y $custom-file-padding-x;
} font-family: $custom-file-font-family;
font-weight: $custom-file-font-weight;
&:active { line-height: $custom-file-line-height;
@include gradient-bg($custom-range-thumb-active-bg); color: $custom-file-color;
} background-color: $custom-file-bg;
} border: $custom-file-border-width solid $custom-file-border-color;
@include border-radius($custom-file-border-radius);
&::-webkit-slider-runnable-track { @include box-shadow($custom-file-box-shadow);
width: $custom-range-track-width;
height: $custom-range-track-height; &::after {
color: transparent; // Why? position: absolute;
cursor: $custom-range-track-cursor; top: 0;
background-color: $custom-range-track-bg; right: 0;
border-color: transparent; bottom: 0;
@include border-radius($custom-range-track-border-radius); z-index: 3;
@include box-shadow($custom-range-track-box-shadow); display: block;
} height: $custom-file-height-inner;
padding: $custom-file-padding-y $custom-file-padding-x;
&::-moz-range-thumb { line-height: $custom-file-line-height;
width: $custom-range-thumb-width; color: $custom-file-button-color;
height: $custom-range-thumb-height; content: "Browse";
@include gradient-bg($custom-range-thumb-bg); @include gradient-bg($custom-file-button-bg);
border: $custom-range-thumb-border; border-left: inherit;
@include border-radius($custom-range-thumb-border-radius); @include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
@include box-shadow($custom-range-thumb-box-shadow); }
appearance: none; }
&:focus { // Range
outline: none; //
box-shadow: $custom-range-thumb-focus-box-shadow; // No mixin for focus accessibility // Style range inputs the same across browsers. Vendor-specific rules for pseudo
} // elements cannot be mixed. As such, there are no shared styles for focus or
// active states on prefixed selectors.
&:active {
@include gradient-bg($custom-range-thumb-active-bg); .custom-range {
} width: 100%;
} height: calc(#{$custom-range-thumb-height} + #{$custom-range-thumb-focus-box-shadow-width * 2});
padding: 0; // Need to reset padding
&::-moz-range-track { background-color: transparent;
width: $custom-range-track-width; appearance: none;
height: $custom-range-track-height;
color: transparent; &:focus {
cursor: $custom-range-track-cursor; outline: none;
background-color: $custom-range-track-bg;
border-color: transparent; // Firefox specific? // Pseudo-elements must be split across multiple rulesets to have an effect.
@include border-radius($custom-range-track-border-radius); // No box-shadow() mixin for focus accessibility.
@include box-shadow($custom-range-track-box-shadow); &::-webkit-slider-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
} &::-moz-range-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
&::-ms-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
&::-ms-thumb { }
width: $custom-range-thumb-width;
height: $custom-range-thumb-height; &::-moz-focus-outer {
@include gradient-bg($custom-range-thumb-bg); border: 0;
border: $custom-range-thumb-border; }
@include border-radius($custom-range-thumb-border-radius);
@include box-shadow($custom-range-thumb-box-shadow); &::-webkit-slider-thumb {
appearance: none; width: $custom-range-thumb-width;
height: $custom-range-thumb-height;
&:focus { margin-top: ($custom-range-track-height - $custom-range-thumb-height) / 2; // Webkit specific
outline: none; @include gradient-bg($custom-range-thumb-bg);
box-shadow: $custom-range-thumb-focus-box-shadow; // No mixin for focus accessibility border: $custom-range-thumb-border;
} @include border-radius($custom-range-thumb-border-radius);
@include box-shadow($custom-range-thumb-box-shadow);
&:active { @include transition($custom-forms-transition);
@include gradient-bg($custom-range-thumb-active-bg); appearance: none;
}
} &:active {
@include gradient-bg($custom-range-thumb-active-bg);
&::-ms-track { }
width: $custom-range-track-width; }
height: $custom-range-track-height;
color: transparent; &::-webkit-slider-runnable-track {
cursor: $custom-range-track-cursor; width: $custom-range-track-width;
background-color: transparent; height: $custom-range-track-height;
border-color: transparent; color: transparent; // Why?
border-width: ($custom-range-thumb-height * .5); cursor: $custom-range-track-cursor;
@include box-shadow($custom-range-track-box-shadow); background-color: $custom-range-track-bg;
} border-color: transparent;
@include border-radius($custom-range-track-border-radius);
&::-ms-fill-lower { @include box-shadow($custom-range-track-box-shadow);
background-color: $custom-range-track-bg; }
@include border-radius($custom-range-track-border-radius);
} &::-moz-range-thumb {
width: $custom-range-thumb-width;
&::-ms-fill-upper { height: $custom-range-thumb-height;
margin-right: 15px; // arbitrary? @include gradient-bg($custom-range-thumb-bg);
background-color: $custom-range-track-bg; border: $custom-range-thumb-border;
@include border-radius($custom-range-track-border-radius); @include border-radius($custom-range-thumb-border-radius);
} @include box-shadow($custom-range-thumb-box-shadow);
} @include transition($custom-forms-transition);
appearance: none;
&:active {
@include gradient-bg($custom-range-thumb-active-bg);
}
}
&::-moz-range-track {
width: $custom-range-track-width;
height: $custom-range-track-height;
color: transparent;
cursor: $custom-range-track-cursor;
background-color: $custom-range-track-bg;
border-color: transparent; // Firefox specific?
@include border-radius($custom-range-track-border-radius);
@include box-shadow($custom-range-track-box-shadow);
}
&::-ms-thumb {
width: $custom-range-thumb-width;
height: $custom-range-thumb-height;
margin-top: 0; // Edge specific
margin-right: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
margin-left: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
@include gradient-bg($custom-range-thumb-bg);
border: $custom-range-thumb-border;
@include border-radius($custom-range-thumb-border-radius);
@include box-shadow($custom-range-thumb-box-shadow);
@include transition($custom-forms-transition);
appearance: none;
&:active {
@include gradient-bg($custom-range-thumb-active-bg);
}
}
&::-ms-track {
width: $custom-range-track-width;
height: $custom-range-track-height;
color: transparent;
cursor: $custom-range-track-cursor;
background-color: transparent;
border-color: transparent;
border-width: $custom-range-thumb-height / 2;
@include box-shadow($custom-range-track-box-shadow);
}
&::-ms-fill-lower {
background-color: $custom-range-track-bg;
@include border-radius($custom-range-track-border-radius);
}
&::-ms-fill-upper {
margin-right: 15px; // arbitrary?
background-color: $custom-range-track-bg;
@include border-radius($custom-range-track-border-radius);
}
&:disabled {
&::-webkit-slider-thumb {
background-color: $custom-range-thumb-disabled-bg;
}
&::-webkit-slider-runnable-track {
cursor: default;
}
&::-moz-range-thumb {
background-color: $custom-range-thumb-disabled-bg;
}
&::-moz-range-track {
cursor: default;
}
&::-ms-thumb {
background-color: $custom-range-thumb-disabled-bg;
}
}
}
.custom-control-label::before,
.custom-file-label,
.custom-select {
@include transition($custom-forms-transition);
}
+191 -166
View File
@@ -1,166 +1,191 @@
// The dropdown wrapper (`<div>`) // The dropdown wrapper (`<div>`)
.dropup, .dropup,
.dropright, .dropright,
.dropdown, .dropdown,
.dropleft { .dropleft {
position: relative; position: relative;
} }
.dropdown-toggle { .dropdown-toggle {
// Generate the caret automatically white-space: nowrap;
@include caret;
} // Generate the caret automatically
@include caret;
// The dropdown menu }
.dropdown-menu {
position: absolute; // The dropdown menu
top: 100%; .dropdown-menu {
left: 0; position: absolute;
z-index: $zindex-dropdown; top: 100%;
display: none; // none by default, but block on "open" of the menu left: 0;
float: left; z-index: $zindex-dropdown;
min-width: $dropdown-min-width; display: none; // none by default, but block on "open" of the menu
padding: $dropdown-padding-y 0; float: left;
margin: $dropdown-spacer 0 0; // override default ul min-width: $dropdown-min-width;
font-size: $font-size-base; // Redeclare because nesting can cause inheritance issues padding: $dropdown-padding-y 0;
color: $body-color; margin: $dropdown-spacer 0 0; // override default ul
text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) @include font-size($dropdown-font-size);
list-style: none; color: $dropdown-color;
background-color: $dropdown-bg; text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
background-clip: padding-box; list-style: none;
border: $dropdown-border-width solid $dropdown-border-color; background-color: $dropdown-bg;
@include border-radius($dropdown-border-radius); background-clip: padding-box;
@include box-shadow($dropdown-box-shadow); border: $dropdown-border-width solid $dropdown-border-color;
} @include border-radius($dropdown-border-radius);
@include box-shadow($dropdown-box-shadow);
.dropdown-menu-right { }
right: 0;
left: auto; @each $breakpoint in map-keys($grid-breakpoints) {
} @include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
// Allow for dropdowns to go bottom up (aka, dropup-menu)
// Just add .dropup after the standard .dropdown class and you're set. .dropdown-menu#{$infix}-left {
.dropup { right: auto;
.dropdown-menu { left: 0;
top: auto; }
bottom: 100%;
margin-top: 0; .dropdown-menu#{$infix}-right {
margin-bottom: $dropdown-spacer; right: 0;
} left: auto;
}
.dropdown-toggle { }
@include caret(up); }
}
} // Allow for dropdowns to go bottom up (aka, dropup-menu)
// Just add .dropup after the standard .dropdown class and you're set.
.dropright { .dropup {
.dropdown-menu { .dropdown-menu {
top: 0; top: auto;
right: auto; bottom: 100%;
left: 100%; margin-top: 0;
margin-top: 0; margin-bottom: $dropdown-spacer;
margin-left: $dropdown-spacer; }
}
.dropdown-toggle {
.dropdown-toggle { @include caret(up);
@include caret(right); }
&::after { }
vertical-align: 0;
} .dropright {
} .dropdown-menu {
} top: 0;
right: auto;
.dropleft { left: 100%;
.dropdown-menu { margin-top: 0;
top: 0; margin-left: $dropdown-spacer;
right: 100%; }
left: auto;
margin-top: 0; .dropdown-toggle {
margin-right: $dropdown-spacer; @include caret(right);
} &::after {
vertical-align: 0;
.dropdown-toggle { }
@include caret(left); }
&::before { }
vertical-align: 0;
} .dropleft {
} .dropdown-menu {
} top: 0;
right: 100%;
// When enabled Popper.js, reset basic dropdown position left: auto;
// stylelint-disable no-duplicate-selectors margin-top: 0;
.dropdown-menu { margin-right: $dropdown-spacer;
&[x-placement^="top"], }
&[x-placement^="right"],
&[x-placement^="bottom"], .dropdown-toggle {
&[x-placement^="left"] { @include caret(left);
right: auto; &::before {
bottom: auto; vertical-align: 0;
} }
} }
// stylelint-enable no-duplicate-selectors }
// Dividers (basically an `<hr>`) within the dropdown // When enabled Popper.js, reset basic dropdown position
.dropdown-divider { // stylelint-disable-next-line no-duplicate-selectors
@include nav-divider($dropdown-divider-bg); .dropdown-menu {
} &[x-placement^="top"],
&[x-placement^="right"],
// Links, buttons, and more within the dropdown menu &[x-placement^="bottom"],
// &[x-placement^="left"] {
// `<button>`-specific styles are denoted with `// For <button>s` right: auto;
.dropdown-item { bottom: auto;
display: block; }
width: 100%; // For `<button>`s }
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
clear: both; // Dividers (basically an `<hr>`) within the dropdown
font-weight: $font-weight-normal; .dropdown-divider {
color: $dropdown-link-color; @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y);
text-align: inherit; // For `<button>`s }
white-space: nowrap; // prevent links from randomly breaking onto new lines
background-color: transparent; // For `<button>`s // Links, buttons, and more within the dropdown menu
border: 0; // For `<button>`s //
// `<button>`-specific styles are denoted with `// For <button>s`
@include hover-focus { .dropdown-item {
color: $dropdown-link-hover-color; display: block;
text-decoration: none; width: 100%; // For `<button>`s
@include gradient-bg($dropdown-link-hover-bg); padding: $dropdown-item-padding-y $dropdown-item-padding-x;
} clear: both;
font-weight: $font-weight-normal;
&.active, color: $dropdown-link-color;
&:active { text-align: inherit; // For `<button>`s
color: $dropdown-link-active-color; white-space: nowrap; // prevent links from randomly breaking onto new lines
text-decoration: none; background-color: transparent; // For `<button>`s
@include gradient-bg($dropdown-link-active-bg); border: 0; // For `<button>`s
}
// Prevent dropdown overflow if there's no padding
&.disabled, // See https://github.com/twbs/bootstrap/pull/27703
&:disabled { @if $dropdown-padding-y == 0 {
color: $dropdown-link-disabled-color; &:first-child {
background-color: transparent; @include border-top-radius($dropdown-inner-border-radius);
// Remove CSS gradients if they're enabled }
@if $enable-gradients {
background-image: none; &:last-child {
} @include border-bottom-radius($dropdown-inner-border-radius);
} }
} }
.dropdown-menu.show { @include hover-focus {
display: block; color: $dropdown-link-hover-color;
} text-decoration: none;
@include gradient-bg($dropdown-link-hover-bg);
// Dropdown section headers }
.dropdown-header {
display: block; &.active,
padding: $dropdown-padding-y $dropdown-item-padding-x; &:active {
margin-bottom: 0; // for use with heading elements color: $dropdown-link-active-color;
font-size: $font-size-sm; text-decoration: none;
color: $dropdown-header-color; @include gradient-bg($dropdown-link-active-bg);
white-space: nowrap; // as with > li > a }
}
&.disabled,
// Dropdown text &:disabled {
.dropdown-item-text { color: $dropdown-link-disabled-color;
display: block; pointer-events: none;
padding: $dropdown-item-padding-y $dropdown-item-padding-x; background-color: transparent;
color: $dropdown-link-color; // Remove CSS gradients if they're enabled
} @if $enable-gradients {
background-image: none;
}
}
}
.dropdown-menu.show {
display: block;
}
// Dropdown section headers
.dropdown-header {
display: block;
padding: $dropdown-padding-y $dropdown-item-padding-x;
margin-bottom: 0; // for use with heading elements
@include font-size($font-size-sm);
color: $dropdown-header-color;
white-space: nowrap; // as with > li > a
}
// Dropdown text
.dropdown-item-text {
display: block;
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
color: $dropdown-link-color;
}
+330 -335
View File
@@ -1,335 +1,330 @@
// stylelint-disable selector-no-qualifying-type // stylelint-disable selector-no-qualifying-type
// //
// Textual form controls // Textual form controls
// //
.form-control { .form-control {
display: block; display: block;
width: 100%; width: 100%;
padding: $input-padding-y $input-padding-x; height: $input-height;
font-size: $font-size-base; padding: $input-padding-y $input-padding-x;
line-height: $input-line-height; font-family: $input-font-family;
color: $input-color; @include font-size($input-font-size);
background-color: $input-bg; font-weight: $input-font-weight;
background-clip: padding-box; line-height: $input-line-height;
border: $input-border-width solid $input-border-color; color: $input-color;
background-color: $input-bg;
// Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS. background-clip: padding-box;
@if $enable-rounded { border: $input-border-width solid $input-border-color;
// Manually use the if/else instead of the mixin to account for iOS override
border-radius: $input-border-radius; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
} @else { @include border-radius($input-border-radius, 0);
// Otherwise undo the iOS default
border-radius: 0; @include box-shadow($input-box-shadow);
} @include transition($input-transition);
@include box-shadow($input-box-shadow); // Unstyle the caret on `<select>`s in IE10+.
@include transition($input-transition); &::-ms-expand {
background-color: transparent;
// Unstyle the caret on `<select>`s in IE10+. border: 0;
&::-ms-expand { }
background-color: transparent;
border: 0; // Customize the `:focus` state to imitate native WebKit styles.
} @include form-control-focus();
// Customize the `:focus` state to imitate native WebKit styles. // Placeholder
@include form-control-focus(); &::placeholder {
color: $input-placeholder-color;
// Placeholder // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
&::placeholder { opacity: 1;
color: $input-placeholder-color; }
// Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
opacity: 1; // Disabled and read-only inputs
} //
// HTML5 says that controls under a fieldset > legend:first-child won't be
// Disabled and read-only inputs // disabled if the fieldset is disabled. Due to implementation difficulty, we
// // don't honor that edge case; we style them as disabled anyway.
// HTML5 says that controls under a fieldset > legend:first-child won't be &:disabled,
// disabled if the fieldset is disabled. Due to implementation difficulty, we &[readonly] {
// don't honor that edge case; we style them as disabled anyway. background-color: $input-disabled-bg;
&:disabled, // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
&[readonly] { opacity: 1;
background-color: $input-disabled-bg; }
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655. }
opacity: 1;
} select.form-control {
} &:focus::-ms-value {
// Suppress the nested default white text on blue background highlight given to
select.form-control { // the selected option text when the (still closed) <select> receives focus
&:not([size]):not([multiple]) { // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
height: $input-height; // match the appearance of the native widget.
} // See https://github.com/twbs/bootstrap/issues/19398.
color: $input-color;
&:focus::-ms-value { background-color: $input-bg;
// Suppress the nested 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, as it looks bad and cannot be made to
// match the appearance of the native widget. // Make file inputs better match text inputs by forcing them to new lines.
// See https://github.com/twbs/bootstrap/issues/19398. .form-control-file,
color: $input-color; .form-control-range {
background-color: $input-bg; display: block;
} width: 100%;
} }
// Make file inputs better match text inputs by forcing them to new lines.
.form-control-file, //
.form-control-range { // Labels
display: block; //
width: 100%;
} // 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-padding-y} + #{$input-border-width});
// Labels padding-bottom: calc(#{$input-padding-y} + #{$input-border-width});
// margin-bottom: 0; // Override the `<label>/<legend>` default
@include font-size(inherit); // Override the `<legend>` default
// For use with horizontal and inline forms, when you need the label (or legend) line-height: $input-line-height;
// text to align with the form controls. }
.col-form-label {
padding-top: calc(#{$input-padding-y} + #{$input-border-width}); .col-form-label-lg {
padding-bottom: calc(#{$input-padding-y} + #{$input-border-width}); padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width});
margin-bottom: 0; // Override the `<label>/<legend>` default padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width});
font-size: inherit; // Override the `<legend>` default @include font-size($input-font-size-lg);
line-height: $input-line-height; line-height: $input-line-height-lg;
} }
.col-form-label-lg { .col-form-label-sm {
padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width}); padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width});
padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width}); padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width});
font-size: $font-size-lg; @include font-size($input-font-size-sm);
line-height: $input-line-height-lg; line-height: $input-line-height-sm;
} }
.col-form-label-sm {
padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width}); // Readonly controls as plain text
padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width}); //
font-size: $font-size-sm; // Apply class to a readonly input to make it appear like regular plain
line-height: $input-line-height-sm; // text (without any border, background color, focus indicator)
}
.form-control-plaintext {
display: block;
// Readonly controls as plain text width: 100%;
// padding-top: $input-padding-y;
// Apply class to a readonly input to make it appear like regular plain padding-bottom: $input-padding-y;
// text (without any border, background color, focus indicator) margin-bottom: 0; // match inputs if this class comes on inputs with default margins
line-height: $input-line-height;
.form-control-plaintext { color: $input-plaintext-color;
display: block; background-color: transparent;
width: 100%; border: solid transparent;
padding-top: $input-padding-y; border-width: $input-border-width 0;
padding-bottom: $input-padding-y;
margin-bottom: 0; // match inputs if this class comes on inputs with default margins &.form-control-sm,
line-height: $input-line-height; &.form-control-lg {
color: $input-plaintext-color; padding-right: 0;
background-color: transparent; padding-left: 0;
border: solid transparent; }
border-width: $input-border-width 0; }
&.form-control-sm,
&.form-control-lg { // Form control sizing
padding-right: 0; //
padding-left: 0; // Build on `.form-control` with modifier classes to decrease or increase the
} // height and font-size of form controls.
} //
// Repeated in `_input_group.scss` to avoid Sass extend issues.
// Form control sizing .form-control-sm {
// height: $input-height-sm;
// Build on `.form-control` with modifier classes to decrease or increase the padding: $input-padding-y-sm $input-padding-x-sm;
// height and font-size of form controls. @include font-size($input-font-size-sm);
// line-height: $input-line-height-sm;
// The `.form-group-* form-control` variations are sadly duplicated to avoid the @include border-radius($input-border-radius-sm);
// issue documented in https://github.com/twbs/bootstrap/issues/15074. }
.form-control-sm { .form-control-lg {
padding: $input-padding-y-sm $input-padding-x-sm; height: $input-height-lg;
font-size: $font-size-sm; padding: $input-padding-y-lg $input-padding-x-lg;
line-height: $input-line-height-sm; @include font-size($input-font-size-lg);
@include border-radius($input-border-radius-sm); line-height: $input-line-height-lg;
} @include border-radius($input-border-radius-lg);
}
select.form-control-sm {
&:not([size]):not([multiple]) { // stylelint-disable-next-line no-duplicate-selectors
height: $input-height-sm; select.form-control {
} &[size],
} &[multiple] {
height: auto;
.form-control-lg { }
padding: $input-padding-y-lg $input-padding-x-lg; }
font-size: $font-size-lg;
line-height: $input-line-height-lg; textarea.form-control {
@include border-radius($input-border-radius-lg); height: auto;
} }
select.form-control-lg { // Form groups
&:not([size]):not([multiple]) { //
height: $input-height-lg; // Designed to help with the organization and spacing of vertical forms. For
} // horizontal forms, use the predefined grid classes.
}
.form-group {
margin-bottom: $form-group-margin-bottom;
// Form groups }
//
// Designed to help with the organization and spacing of vertical forms. For .form-text {
// horizontal forms, use the predefined grid classes. display: block;
margin-top: $form-text-margin-top;
.form-group { }
margin-bottom: $form-group-margin-bottom;
}
// Form grid
.form-text { //
display: block; // Special replacement for our grid system's `.row` for tighter form layouts.
margin-top: $form-text-margin-top;
} .form-row {
display: flex;
flex-wrap: wrap;
// Form grid margin-right: -$form-grid-gutter-width / 2;
// margin-left: -$form-grid-gutter-width / 2;
// Special replacement for our grid system's `.row` for tighter form layouts.
> .col,
.form-row { > [class*="col-"] {
display: flex; padding-right: $form-grid-gutter-width / 2;
flex-wrap: wrap; padding-left: $form-grid-gutter-width / 2;
margin-right: -5px; }
margin-left: -5px; }
> .col,
> [class*="col-"] { // Checkboxes and radios
padding-right: 5px; //
padding-left: 5px; // Indent the labels to position radios/checkboxes as hanging controls.
}
} .form-check {
position: relative;
display: block;
// Checkboxes and radios padding-left: $form-check-input-gutter;
// }
// Indent the labels to position radios/checkboxes as hanging controls.
.form-check-input {
.form-check { position: absolute;
position: relative; margin-top: $form-check-input-margin-y;
display: block; margin-left: -$form-check-input-gutter;
padding-left: $form-check-input-gutter;
} &:disabled ~ .form-check-label {
color: $text-muted;
.form-check-input { }
position: absolute; }
margin-top: $form-check-input-margin-y;
margin-left: -$form-check-input-gutter; .form-check-label {
margin-bottom: 0; // Override default `<label>` bottom margin
&:disabled ~ .form-check-label { }
color: $text-muted;
} .form-check-inline {
} display: inline-flex;
align-items: center;
.form-check-label { padding-left: 0; // Override base .form-check
margin-bottom: 0; // Override default `<label>` bottom margin margin-right: $form-check-inline-margin-x;
}
// Undo .form-check-input defaults and add some `margin-right`.
.form-check-inline { .form-check-input {
display: inline-flex; position: static;
align-items: center; margin-top: 0;
padding-left: 0; // Override base .form-check margin-right: $form-check-inline-input-margin-x;
margin-right: $form-check-inline-margin-x; margin-left: 0;
}
// Undo .form-check-input defaults and add some `margin-right`. }
.form-check-input {
position: static;
margin-top: 0; // Form validation
margin-right: $form-check-inline-input-margin-x; //
margin-left: 0; // Provide feedback to users when form field values are valid or invalid. Works
} // primarily for client-side validation via scoped `:invalid` and `:valid`
} // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
// server side validation.
// Form validation @each $state, $data in $form-validation-states {
// @include form-validation-state($state, map-get($data, color), map-get($data, icon));
// Provide feedback to users when form field values are valid or invalid. Works }
// primarily for client-side validation via scoped `:invalid` and `:valid`
// pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for // Inline forms
// server side validation. //
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
@include form-validation-state("valid", $form-feedback-valid-color); // forms begin stacked on extra small (mobile) devices and then go inline when
@include form-validation-state("invalid", $form-feedback-invalid-color); // viewports reach <768px.
//
// Inline forms // Requires wrapping inputs and labels with `.form-group` for proper display of
// // default HTML form controls and our custom form controls (e.g., input groups).
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
// forms begin stacked on extra small (mobile) devices and then go inline when .form-inline {
// viewports reach <768px. display: flex;
// flex-flow: row wrap;
// Requires wrapping inputs and labels with `.form-group` for proper display of align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
// default HTML form controls and our custom form controls (e.g., input groups).
// Because we use flex, the initial sizing of checkboxes is collapsed and
.form-inline { // doesn't occupy the full-width (which is what we want for xs grid tier),
display: flex; // so we force that here.
flex-flow: row wrap; .form-check {
align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height) width: 100%;
}
// Because we use flex, the initial sizing of checkboxes is collapsed and
// doesn't occupy the full-width (which is what we want for xs grid tier), // Kick in the inline
// so we force that here. @include media-breakpoint-up(sm) {
.form-check { label {
width: 100%; display: flex;
} align-items: center;
justify-content: center;
// Kick in the inline margin-bottom: 0;
@include media-breakpoint-up(sm) { }
label {
display: flex; // Inline-block all the things for "inline"
align-items: center; .form-group {
justify-content: center; display: flex;
margin-bottom: 0; flex: 0 0 auto;
} flex-flow: row wrap;
align-items: center;
// Inline-block all the things for "inline" margin-bottom: 0;
.form-group { }
display: flex;
flex: 0 0 auto; // Allow folks to *not* use `.form-group`
flex-flow: row wrap; .form-control {
align-items: center; display: inline-block;
margin-bottom: 0; width: auto; // Prevent labels from stacking above inputs in `.form-group`
} vertical-align: middle;
}
// Allow folks to *not* use `.form-group`
.form-control { // Make static controls behave like regular ones
display: inline-block; .form-control-plaintext {
width: auto; // Prevent labels from stacking above inputs in `.form-group` display: inline-block;
vertical-align: middle; }
}
.input-group,
// Make static controls behave like regular ones .custom-select {
.form-control-plaintext { width: auto;
display: inline-block; }
}
// Remove default margin on radios/checkboxes that were used for stacking, and
.input-group, // then undo the floating of radios and checkboxes to match.
.custom-select { .form-check {
width: auto; display: flex;
} align-items: center;
justify-content: center;
// Remove default margin on radios/checkboxes that were used for stacking, and width: auto;
// then undo the floating of radios and checkboxes to match. padding-left: 0;
.form-check { }
display: flex; .form-check-input {
align-items: center; position: relative;
justify-content: center; flex-shrink: 0;
width: auto; margin-top: 0;
padding-left: 0; margin-right: $form-check-input-margin-x;
} margin-left: 0;
.form-check-input { }
position: relative;
margin-top: 0; .custom-control {
margin-right: $form-check-input-margin-x; align-items: center;
margin-left: 0; justify-content: center;
} }
.custom-control-label {
.custom-control { margin-bottom: 0;
align-items: center; }
justify-content: center; }
} }
.custom-control-label {
margin-bottom: 0;
}
}
}
+86 -86
View File
@@ -1,86 +1,86 @@
// Bootstrap functions // Bootstrap functions
// //
// Utility mixins and functions for evalutating source code across our variables, maps, and mixins. // Utility mixins and functions for evaluating source code across our variables, maps, and mixins.
// Ascending // Ascending
// Used to evaluate Sass maps like our grid breakpoints. // Used to evaluate Sass maps like our grid breakpoints.
@mixin _assert-ascending($map, $map-name) { @mixin _assert-ascending($map, $map-name) {
$prev-key: null; $prev-key: null;
$prev-num: null; $prev-num: null;
@each $key, $num in $map { @each $key, $num in $map {
@if $prev-num == null { @if $prev-num == null or unit($num) == "%" {
// Do nothing // Do nothing
} @else if not comparable($prev-num, $num) { } @else if not comparable($prev-num, $num) {
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !"; @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
} @else if $prev-num >= $num { } @else if $prev-num >= $num {
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !"; @warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
} }
$prev-key: $key; $prev-key: $key;
$prev-num: $num; $prev-num: $num;
} }
} }
// Starts at zero // Starts at zero
// Another grid mixin that ensures the min-width of the lowest breakpoint starts at 0. // Used to ensure the min-width of the lowest breakpoint starts at 0.
@mixin _assert-starts-at-zero($map) { @mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
$values: map-values($map); $values: map-values($map);
$first-value: nth($values, 1); $first-value: nth($values, 1);
@if $first-value != 0 { @if $first-value != 0 {
@warn "First breakpoint in `$grid-breakpoints` must start at 0, but starts at #{$first-value}."; @warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
} }
} }
// Replace `$search` with `$replace` in `$string` // Replace `$search` with `$replace` in `$string`
// Used on our SVG icon backgrounds for custom forms. // Used on our SVG icon backgrounds for custom forms.
// //
// @author Hugo Giraudel // @author Hugo Giraudel
// @param {String} $string - Initial string // @param {String} $string - Initial string
// @param {String} $search - Substring to replace // @param {String} $search - Substring to replace
// @param {String} $replace ('') - New value // @param {String} $replace ('') - New value
// @return {String} - Updated string // @return {String} - Updated string
@function str-replace($string, $search, $replace: "") { @function str-replace($string, $search, $replace: "") {
$index: str-index($string, $search); $index: str-index($string, $search);
@if $index { @if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
} }
@return $string; @return $string;
} }
// Color contrast // Color contrast
@function color-yiq($color) { @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
$r: red($color); $r: red($color);
$g: green($color); $g: green($color);
$b: blue($color); $b: blue($color);
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000; $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
@if ($yiq >= $yiq-contrasted-threshold) { @if ($yiq >= $yiq-contrasted-threshold) {
@return $yiq-text-dark; @return $dark;
} @else { } @else {
@return $yiq-text-light; @return $light;
} }
} }
// Retrieve color Sass maps // Retrieve color Sass maps
@function color($key: "blue") { @function color($key: "blue") {
@return map-get($colors, $key); @return map-get($colors, $key);
} }
@function theme-color($key: "primary") { @function theme-color($key: "primary") {
@return map-get($theme-colors, $key); @return map-get($theme-colors, $key);
} }
@function gray($key: "100") { @function gray($key: "100") {
@return map-get($grays, $key); @return map-get($grays, $key);
} }
// Request a theme color level // Request a theme color level
@function theme-color-level($color-name: "primary", $level: 0) { @function theme-color-level($color-name: "primary", $level: 0) {
$color: theme-color($color-name); $color: theme-color($color-name);
$color-base: if($level > 0, $black, $white); $color-base: if($level > 0, $black, $white);
$level: abs($level); $level: abs($level);
@return mix($color-base, $color, $level * $theme-color-interval); @return mix($color-base, $color, $level * $theme-color-interval);
} }
+52 -52
View File
@@ -1,52 +1,52 @@
// Container widths // Container widths
// //
// Set the container width, and override it for fixed navbars in media queries. // Set the container width, and override it for fixed navbars in media queries.
@if $enable-grid-classes { @if $enable-grid-classes {
.container { .container {
@include make-container(); @include make-container();
@include make-container-max-widths(); @include make-container-max-widths();
} }
} }
// Fluid container // Fluid container
// //
// Utilizes the mixin meant for fixed width containers, but with 100% width for // Utilizes the mixin meant for fixed width containers, but with 100% width for
// fluid, full width layouts. // fluid, full width layouts.
@if $enable-grid-classes { @if $enable-grid-classes {
.container-fluid { .container-fluid {
@include make-container(); @include make-container();
} }
} }
// Row // Row
// //
// Rows contain and clear the floats of your columns. // Rows contain and clear the floats of your columns.
@if $enable-grid-classes { @if $enable-grid-classes {
.row { .row {
@include make-row(); @include make-row();
} }
// Remove the negative margin from default .row, then the horizontal padding // Remove the negative margin from default .row, then the horizontal padding
// from all immediate children columns (to prevent runaway style inheritance). // from all immediate children columns (to prevent runaway style inheritance).
.no-gutters { .no-gutters {
margin-right: 0; margin-right: 0;
margin-left: 0; margin-left: 0;
> .col, > .col,
> [class*="col-"] { > [class*="col-"] {
padding-right: 0; padding-right: 0;
padding-left: 0; padding-left: 0;
} }
} }
} }
// Columns // Columns
// //
// Common styles for small and large grid columns // Common styles for small and large grid columns
@if $enable-grid-classes { @if $enable-grid-classes {
@include make-grid-columns(); @include make-grid-columns();
} }
+42 -42
View File
@@ -1,42 +1,42 @@
// Responsive images (ensure images don't scale beyond their parents) // Responsive images (ensure images don't scale beyond their parents)
// //
// This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s. // This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s.
// We previously tried the "images are responsive by default" approach in Bootstrap v2, // We previously tried the "images are responsive by default" approach in Bootstrap v2,
// and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps) // and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)
// which weren't expecting the images within themselves to be involuntarily resized. // which weren't expecting the images within themselves to be involuntarily resized.
// See also https://github.com/twbs/bootstrap/issues/18178 // See also https://github.com/twbs/bootstrap/issues/18178
.img-fluid { .img-fluid {
@include img-fluid; @include img-fluid;
} }
// Image thumbnails // Image thumbnails
.img-thumbnail { .img-thumbnail {
padding: $thumbnail-padding; padding: $thumbnail-padding;
background-color: $thumbnail-bg; background-color: $thumbnail-bg;
border: $thumbnail-border-width solid $thumbnail-border-color; border: $thumbnail-border-width solid $thumbnail-border-color;
@include border-radius($thumbnail-border-radius); @include border-radius($thumbnail-border-radius);
@include box-shadow($thumbnail-box-shadow); @include box-shadow($thumbnail-box-shadow);
// Keep them at most 100% wide // Keep them at most 100% wide
@include img-fluid; @include img-fluid;
} }
// //
// Figures // Figures
// //
.figure { .figure {
// Ensures the caption's text aligns with the image. // Ensures the caption's text aligns with the image.
display: inline-block; display: inline-block;
} }
.figure-img { .figure-img {
margin-bottom: ($spacer / 2); margin-bottom: $spacer / 2;
line-height: 1; line-height: 1;
} }
.figure-caption { .figure-caption {
font-size: $figure-caption-font-size; @include font-size($figure-caption-font-size);
color: $figure-caption-color; color: $figure-caption-color;
} }
+193 -158
View File
@@ -1,158 +1,193 @@
// stylelint-disable selector-no-qualifying-type // stylelint-disable selector-no-qualifying-type
// //
// Base styles // Base styles
// //
.input-group { .input-group {
position: relative; position: relative;
display: flex; display: flex;
flex-wrap: wrap; // For form validation feedback flex-wrap: wrap; // For form validation feedback
align-items: stretch; align-items: stretch;
width: 100%; width: 100%;
> .form-control, > .form-control,
> .custom-select, > .form-control-plaintext,
> .custom-file { > .custom-select,
position: relative; // For focus state's z-index > .custom-file {
flex: 1 1 auto; position: relative; // For focus state's z-index
// Add width 1% and flex-basis auto to ensure that button will not wrap out flex: 1 1 auto;
// the column. Applies to IE Edge+ and Firefox. Chrome does not require this. // Add width 1% and flex-basis auto to ensure that button will not wrap out
width: 1%; // the column. Applies to IE Edge+ and Firefox. Chrome does not require this.
margin-bottom: 0; width: 1%;
margin-bottom: 0;
// Bring the "active" form control to the top of surrounding elements
&:focus { + .form-control,
z-index: 3; + .custom-select,
} + .custom-file {
margin-left: -$input-border-width;
+ .form-control, }
+ .custom-select, }
+ .custom-file {
margin-left: -$input-border-width; // Bring the "active" form control to the top of surrounding elements
} > .form-control:focus,
} > .custom-select:focus,
> .custom-file .custom-file-input:focus ~ .custom-file-label {
> .form-control, z-index: 3;
> .custom-select { }
&:not(:last-child) { @include border-right-radius(0); }
&:not(:first-child) { @include border-left-radius(0); } // Bring the custom file input above the label
} > .custom-file .custom-file-input:focus {
z-index: 4;
// Custom file inputs have more complex markup, thus requiring different }
// border-radius overrides.
> .custom-file { > .form-control,
display: flex; > .custom-select {
align-items: center; &:not(:last-child) { @include border-right-radius(0); }
&:not(:first-child) { @include border-left-radius(0); }
&:not(:last-child) .custom-file-label, }
&:not(:last-child) .custom-file-label::after { @include border-right-radius(0); }
&:not(:first-child) .custom-file-label { @include border-left-radius(0); } // Custom file inputs have more complex markup, thus requiring different
} // border-radius overrides.
} > .custom-file {
display: flex;
align-items: center;
// Prepend and append
// &:not(:last-child) .custom-file-label,
// While it requires one extra layer of HTML for each, dedicated prepend and &:not(:last-child) .custom-file-label::after { @include border-right-radius(0); }
// append elements allow us to 1) be less clever, 2) simplify our selectors, and &:not(:first-child) .custom-file-label { @include border-left-radius(0); }
// 3) support HTML5 form validation. }
}
.input-group-prepend,
.input-group-append {
display: flex; // Prepend and append
//
// Ensure buttons are always above inputs for more visually pleasing borders. // While it requires one extra layer of HTML for each, dedicated prepend and
// This isn't needed for `.input-group-text` since it shares the same border-color // append elements allow us to 1) be less clever, 2) simplify our selectors, and
// as our inputs. // 3) support HTML5 form validation.
.btn {
position: relative; .input-group-prepend,
z-index: 2; .input-group-append {
} display: flex;
.btn + .btn, // Ensure buttons are always above inputs for more visually pleasing borders.
.btn + .input-group-text, // This isn't needed for `.input-group-text` since it shares the same border-color
.input-group-text + .input-group-text, // as our inputs.
.input-group-text + .btn { .btn {
margin-left: -$input-border-width; position: relative;
} z-index: 2;
}
&:focus {
.input-group-prepend { margin-right: -$input-border-width; } z-index: 3;
.input-group-append { margin-left: -$input-border-width; } }
}
// Textual addons .btn + .btn,
// .btn + .input-group-text,
// Serves as a catch-all element for any text or radio/checkbox input you wish .input-group-text + .input-group-text,
// to prepend or append to an input. .input-group-text + .btn {
margin-left: -$input-border-width;
.input-group-text { }
display: flex; }
align-items: center;
padding: $input-padding-y $input-padding-x; .input-group-prepend { margin-right: -$input-border-width; }
margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom .input-group-append { margin-left: -$input-border-width; }
font-size: $font-size-base; // Match inputs
font-weight: $font-weight-normal;
line-height: $input-line-height; // Textual addons
color: $input-group-addon-color; //
text-align: center; // Serves as a catch-all element for any text or radio/checkbox input you wish
white-space: nowrap; // to prepend or append to an input.
background-color: $input-group-addon-bg;
border: $input-border-width solid $input-group-addon-border-color; .input-group-text {
@include border-radius($input-border-radius); display: flex;
align-items: center;
// Nuke default margins from checkboxes and radios to vertically center within. padding: $input-padding-y $input-padding-x;
input[type="radio"], margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
input[type="checkbox"] { @include font-size($input-font-size); // Match inputs
margin-top: 0; font-weight: $font-weight-normal;
} line-height: $input-line-height;
} color: $input-group-addon-color;
text-align: center;
white-space: nowrap;
// Sizing background-color: $input-group-addon-bg;
// border: $input-border-width solid $input-group-addon-border-color;
// Remix the default form control sizing classes into new ones for easier @include border-radius($input-border-radius);
// manipulation.
// Nuke default margins from checkboxes and radios to vertically center within.
.input-group-lg > .form-control, input[type="radio"],
.input-group-lg > .input-group-prepend > .input-group-text, input[type="checkbox"] {
.input-group-lg > .input-group-append > .input-group-text, margin-top: 0;
.input-group-lg > .input-group-prepend > .btn, }
.input-group-lg > .input-group-append > .btn { }
@extend .form-control-lg;
}
// Sizing
.input-group-sm > .form-control, //
.input-group-sm > .input-group-prepend > .input-group-text, // Remix the default form control sizing classes into new ones for easier
.input-group-sm > .input-group-append > .input-group-text, // manipulation.
.input-group-sm > .input-group-prepend > .btn,
.input-group-sm > .input-group-append > .btn { .input-group-lg > .form-control:not(textarea),
@extend .form-control-sm; .input-group-lg > .custom-select {
} height: $input-height-lg;
}
// Prepend and append rounded corners .input-group-lg > .form-control,
// .input-group-lg > .custom-select,
// These rulesets must come after the sizing ones to properly override sm and lg .input-group-lg > .input-group-prepend > .input-group-text,
// border-radius values when extending. They're more specific than we'd like .input-group-lg > .input-group-append > .input-group-text,
// with the `.input-group >` part, but without it, we cannot override the sizing. .input-group-lg > .input-group-prepend > .btn,
.input-group-lg > .input-group-append > .btn {
padding: $input-padding-y-lg $input-padding-x-lg;
.input-group > .input-group-prepend > .btn, @include font-size($input-font-size-lg);
.input-group > .input-group-prepend > .input-group-text, line-height: $input-line-height-lg;
.input-group > .input-group-append:not(:last-child) > .btn, @include border-radius($input-border-radius-lg);
.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) { .input-group-sm > .form-control:not(textarea),
@include border-right-radius(0); .input-group-sm > .custom-select {
} height: $input-height-sm;
}
.input-group > .input-group-append > .btn,
.input-group > .input-group-append > .input-group-text, .input-group-sm > .form-control,
.input-group > .input-group-prepend:not(:first-child) > .btn, .input-group-sm > .custom-select,
.input-group > .input-group-prepend:not(:first-child) > .input-group-text, .input-group-sm > .input-group-prepend > .input-group-text,
.input-group > .input-group-prepend:first-child > .btn:not(:first-child), .input-group-sm > .input-group-append > .input-group-text,
.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) { .input-group-sm > .input-group-prepend > .btn,
@include border-left-radius(0); .input-group-sm > .input-group-append > .btn {
} padding: $input-padding-y-sm $input-padding-x-sm;
@include font-size($input-font-size-sm);
line-height: $input-line-height-sm;
@include border-radius($input-border-radius-sm);
}
.input-group-lg > .custom-select,
.input-group-sm > .custom-select {
padding-right: $custom-select-padding-x + $custom-select-indicator-padding;
}
// Prepend and append rounded corners
//
// 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 > .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);
}
.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);
}
+17 -16
View File
@@ -1,16 +1,17 @@
.jumbotron { .jumbotron {
padding: $jumbotron-padding ($jumbotron-padding / 2); padding: $jumbotron-padding ($jumbotron-padding / 2);
margin-bottom: $jumbotron-padding; margin-bottom: $jumbotron-padding;
background-color: $jumbotron-bg; color: $jumbotron-color;
@include border-radius($border-radius-lg); background-color: $jumbotron-bg;
@include border-radius($border-radius-lg);
@include media-breakpoint-up(sm) {
padding: ($jumbotron-padding * 2) $jumbotron-padding; @include media-breakpoint-up(sm) {
} padding: ($jumbotron-padding * 2) $jumbotron-padding;
} }
}
.jumbotron-fluid {
padding-right: 0; .jumbotron-fluid {
padding-left: 0; padding-right: 0;
@include border-radius(0); padding-left: 0;
} @include border-radius(0);
}
+149 -115
View File
@@ -1,115 +1,149 @@
// Base class // Base class
// //
// Easily usable on <ul>, <ol>, or <div>. // Easily usable on <ul>, <ol>, or <div>.
.list-group { .list-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
// No need to set list-style: none; since .list-group-item is block level // No need to set list-style: none; since .list-group-item is block level
padding-left: 0; // reset padding because ul and ol padding-left: 0; // reset padding because ul and ol
margin-bottom: 0; margin-bottom: 0;
} }
// Interactive list items // Interactive list items
// //
// Use anchor or button elements instead of `li`s or `div`s to create interactive // Use anchor or button elements instead of `li`s or `div`s to create interactive
// list items. Includes an extra `.active` modifier class for selected items. // list items. Includes an extra `.active` modifier class for selected items.
.list-group-item-action { .list-group-item-action {
width: 100%; // For `<button>`s (anchors become 100% by default though) width: 100%; // For `<button>`s (anchors become 100% by default though)
color: $list-group-action-color; color: $list-group-action-color;
text-align: inherit; // For `<button>`s (anchors inherit) text-align: inherit; // For `<button>`s (anchors inherit)
// Hover state // Hover state
@include hover-focus { @include hover-focus {
color: $list-group-action-hover-color; z-index: 1; // Place hover/focus items above their siblings for proper border styling
text-decoration: none; color: $list-group-action-hover-color;
background-color: $list-group-hover-bg; text-decoration: none;
} background-color: $list-group-hover-bg;
}
&:active {
color: $list-group-action-active-color; &:active {
background-color: $list-group-action-active-bg; color: $list-group-action-active-color;
} background-color: $list-group-action-active-bg;
} }
}
// Individual list items
// // Individual list items
// Use on `li`s or `div`s within the `.list-group` parent. //
// Use on `li`s or `div`s within the `.list-group` parent.
.list-group-item {
position: relative; .list-group-item {
display: block; position: relative;
padding: $list-group-item-padding-y $list-group-item-padding-x; display: block;
// Place the border on the list items and negative margin up for better styling padding: $list-group-item-padding-y $list-group-item-padding-x;
margin-bottom: -$list-group-border-width; // Place the border on the list items and negative margin up for better styling
background-color: $list-group-bg; margin-bottom: -$list-group-border-width;
border: $list-group-border-width solid $list-group-border-color; color: $list-group-color;
background-color: $list-group-bg;
&:first-child { border: $list-group-border-width solid $list-group-border-color;
@include border-top-radius($list-group-border-radius);
} &:first-child {
@include border-top-radius($list-group-border-radius);
&:last-child { }
margin-bottom: 0;
@include border-bottom-radius($list-group-border-radius); &:last-child {
} margin-bottom: 0;
@include border-bottom-radius($list-group-border-radius);
@include hover-focus { }
z-index: 1; // Place hover/active items above their siblings for proper border styling
text-decoration: none; &.disabled,
} &:disabled {
color: $list-group-disabled-color;
&.disabled, pointer-events: none;
&:disabled { background-color: $list-group-disabled-bg;
color: $list-group-disabled-color; }
background-color: $list-group-disabled-bg;
} // Include both here for `<a>`s and `<button>`s
&.active {
// Include both here for `<a>`s and `<button>`s z-index: 2; // Place active items above their siblings for proper border styling
&.active { color: $list-group-active-color;
z-index: 2; // Place active items above their siblings for proper border styling background-color: $list-group-active-bg;
color: $list-group-active-color; border-color: $list-group-active-border-color;
background-color: $list-group-active-bg; }
border-color: $list-group-active-border-color; }
}
}
// Horizontal
//
// Flush list items // Change the layout of list group items from vertical (default) to horizontal.
//
// Remove borders and border-radius to keep list group items edge-to-edge. Most @each $breakpoint in map-keys($grid-breakpoints) {
// useful within other components (e.g., cards). @include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.list-group-flush {
.list-group-item { .list-group-horizontal#{$infix} {
border-right: 0; flex-direction: row;
border-left: 0;
@include border-radius(0); .list-group-item {
} margin-right: -$list-group-border-width;
margin-bottom: 0;
&:first-child {
.list-group-item:first-child { &:first-child {
border-top: 0; @include border-left-radius($list-group-border-radius);
} @include border-top-right-radius(0);
} }
&:last-child { &:last-child {
.list-group-item:last-child { margin-right: 0;
border-bottom: 0; @include border-right-radius($list-group-border-radius);
} @include border-bottom-left-radius(0);
} }
} }
}
}
// Contextual variants }
//
// Add modifier classes to change text and background color on individual items.
// Organizationally, this must come after the `:hover` states. // Flush list items
//
@each $color, $value in $theme-colors { // Remove borders and border-radius to keep list group items edge-to-edge. Most
@include list-group-item-variant($color, theme-color-level($color, -9), theme-color-level($color, 6)); // useful within other components (e.g., cards).
}
.list-group-flush {
.list-group-item {
border-right: 0;
border-left: 0;
@include border-radius(0);
&:last-child {
margin-bottom: -$list-group-border-width;
}
}
&:first-child {
.list-group-item:first-child {
border-top: 0;
}
}
&:last-child {
.list-group-item:last-child {
margin-bottom: 0;
border-bottom: 0;
}
}
}
// Contextual variants
//
// Add modifier classes to change text and background color on individual items.
// Organizationally, this must come after the `:hover` states.
@each $color, $value in $theme-colors {
@include list-group-item-variant($color, theme-color-level($color, -9), theme-color-level($color, 6));
}
+8 -8
View File
@@ -1,8 +1,8 @@
.media { .media {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.media-body { .media-body {
flex: 1; flex: 1;
} }
+47 -41
View File
@@ -1,41 +1,47 @@
// Toggles // Toggles
// //
// Used in conjunction with global variables to enable certain theme features. // Used in conjunction with global variables to enable certain theme features.
// Utilities // Vendor
@import "mixins/breakpoints"; @import "vendor/rfs";
@import "mixins/hover";
@import "mixins/image"; // Deprecate
@import "mixins/badge"; @import "mixins/deprecate";
@import "mixins/resize";
@import "mixins/screen-reader"; // Utilities
@import "mixins/size"; @import "mixins/breakpoints";
@import "mixins/reset-text"; @import "mixins/hover";
@import "mixins/text-emphasis"; @import "mixins/image";
@import "mixins/text-hide"; @import "mixins/badge";
@import "mixins/text-truncate"; @import "mixins/resize";
@import "mixins/visibility"; @import "mixins/screen-reader";
@import "mixins/size";
// // Components @import "mixins/reset-text";
@import "mixins/alert"; @import "mixins/text-emphasis";
@import "mixins/buttons"; @import "mixins/text-hide";
@import "mixins/caret"; @import "mixins/text-truncate";
@import "mixins/pagination"; @import "mixins/visibility";
@import "mixins/lists";
@import "mixins/list-group"; // // Components
@import "mixins/nav-divider"; @import "mixins/alert";
@import "mixins/forms"; @import "mixins/buttons";
@import "mixins/table-row"; @import "mixins/caret";
@import "mixins/pagination";
// // Skins @import "mixins/lists";
@import "mixins/background-variant"; @import "mixins/list-group";
@import "mixins/border-radius"; @import "mixins/nav-divider";
@import "mixins/box-shadow"; @import "mixins/forms";
@import "mixins/gradients"; @import "mixins/table-row";
@import "mixins/transition";
// // Skins
// // Layout @import "mixins/background-variant";
@import "mixins/clearfix"; @import "mixins/border-radius";
@import "mixins/grid-framework"; @import "mixins/box-shadow";
@import "mixins/grid"; @import "mixins/gradients";
@import "mixins/float"; @import "mixins/transition";
// // Layout
@import "mixins/clearfix";
@import "mixins/grid-framework";
@import "mixins/grid";
@import "mixins/float";
+229 -168
View File
@@ -1,168 +1,229 @@
// .modal-open - body class for killing the scroll // .modal-open - body class for killing the scroll
// .modal - container to scroll within // .modal - container to scroll within
// .modal-dialog - positioning shell for the actual modal // .modal-dialog - positioning shell for the actual modal
// .modal-content - actual modal w/ bg and corners and stuff // .modal-content - actual modal w/ bg and corners and stuff
// Kill the scroll on the body .modal-open {
.modal-open { // Kill the scroll on the body
overflow: hidden; overflow: hidden;
}
.modal {
// Container that the modal scrolls within overflow-x: hidden;
.modal { overflow-y: auto;
position: fixed; }
top: 0; }
right: 0;
bottom: 0; // Container that the modal scrolls within
left: 0; .modal {
z-index: $zindex-modal; position: fixed;
display: none; top: 0;
overflow: hidden; left: 0;
// Prevent Chrome on Windows from adding a focus outline. For details, see z-index: $zindex-modal;
// https://github.com/twbs/bootstrap/pull/10951. display: none;
outline: 0; width: 100%;
// We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a height: 100%;
// gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342 overflow: hidden;
// See also https://github.com/twbs/bootstrap/issues/17695 // Prevent Chrome on Windows from adding a focus outline. For details, see
// https://github.com/twbs/bootstrap/pull/10951.
.modal-open & { outline: 0;
overflow-x: hidden; // We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a
overflow-y: auto; // gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
} // See also https://github.com/twbs/bootstrap/issues/17695
} }
// Shell div to position the modal with bottom padding // Shell div to position the modal with bottom padding
.modal-dialog { .modal-dialog {
position: relative; position: relative;
width: auto; width: auto;
margin: $modal-dialog-margin; margin: $modal-dialog-margin;
// allow clicks to pass through for custom click handling to close modal // allow clicks to pass through for custom click handling to close modal
pointer-events: none; pointer-events: none;
// When fading in the modal, animate it to slide down // When fading in the modal, animate it to slide down
.modal.fade & { .modal.fade & {
@include transition($modal-transition); @include transition($modal-transition);
transform: translate(0, -25%); transform: $modal-fade-transform;
} }
.modal.show & { .modal.show & {
transform: translate(0, 0); transform: $modal-show-transform;
} }
} }
.modal-dialog-centered { .modal-dialog-scrollable {
display: flex; display: flex; // IE10/11
align-items: center; max-height: calc(100% - #{$modal-dialog-margin * 2});
min-height: calc(100% - (#{$modal-dialog-margin} * 2));
} .modal-content {
max-height: calc(100vh - #{$modal-dialog-margin * 2}); // IE10/11
// Actual modal overflow: hidden;
.modal-content { }
position: relative;
display: flex; .modal-header,
flex-direction: column; .modal-footer {
width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog` flex-shrink: 0;
// counteract the pointer-events: none; in the .modal-dialog }
pointer-events: auto;
background-color: $modal-content-bg; .modal-body {
background-clip: padding-box; overflow-y: auto;
border: $modal-content-border-width solid $modal-content-border-color; }
@include border-radius($modal-content-border-radius); }
@include box-shadow($modal-content-box-shadow-xs);
// Remove focus outline from opened modal .modal-dialog-centered {
outline: 0; display: flex;
} align-items: center;
min-height: calc(100% - #{$modal-dialog-margin * 2});
// Modal background
.modal-backdrop { // Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
position: fixed; &::before {
top: 0; display: block; // IE10
right: 0; height: calc(100vh - #{$modal-dialog-margin * 2});
bottom: 0; content: "";
left: 0; }
z-index: $zindex-modal-backdrop;
background-color: $modal-backdrop-bg; // Ensure `.modal-body` shows scrollbar (IE10/11)
&.modal-dialog-scrollable {
// Fade for backdrop flex-direction: column;
&.fade { opacity: 0; } justify-content: center;
&.show { opacity: $modal-backdrop-opacity; } height: 100%;
}
.modal-content {
// Modal header max-height: none;
// Top section of the modal w/ title and dismiss }
.modal-header {
display: flex; &::before {
align-items: flex-start; // so the close btn always stays on the upper right corner content: none;
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($modal-content-border-radius);
// Actual modal
.close { .modal-content {
padding: $modal-header-padding; position: relative;
// auto on the left force icon to the right even when there is no .modal-title display: flex;
margin: (-$modal-header-padding) (-$modal-header-padding) (-$modal-header-padding) auto; 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
color: $modal-content-color;
// Title text within header pointer-events: auto;
.modal-title { background-color: $modal-content-bg;
margin-bottom: 0; background-clip: padding-box;
line-height: $modal-title-line-height; border: $modal-content-border-width solid $modal-content-border-color;
} @include border-radius($modal-content-border-radius);
@include box-shadow($modal-content-box-shadow-xs);
// Modal body // Remove focus outline from opened modal
// Where all modal content resides (sibling of .modal-header and .modal-footer) outline: 0;
.modal-body { }
position: relative;
// Enable `flex-grow: 1` so that the body take up as much space as possible // Modal background
// when should there be a fixed height on `.modal-dialog`. .modal-backdrop {
flex: 1 1 auto; position: fixed;
padding: $modal-inner-padding; top: 0;
} left: 0;
z-index: $zindex-modal-backdrop;
// Footer (for actions) width: 100vw;
.modal-footer { height: 100vh;
display: flex; background-color: $modal-backdrop-bg;
align-items: center; // vertically center
justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items // Fade for backdrop
padding: $modal-inner-padding; &.fade { opacity: 0; }
border-top: $modal-footer-border-width solid $modal-footer-border-color; &.show { opacity: $modal-backdrop-opacity; }
}
// Easily place margin between footer elements
> :not(:first-child) { margin-left: .25rem; } // Modal header
> :not(:last-child) { margin-right: .25rem; } // Top section of the modal w/ title and dismiss
} .modal-header {
display: flex;
// Measure scrollbar width for padding body during modal show/hide align-items: flex-start; // so the close btn always stays on the upper right corner
.modal-scrollbar-measure { justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
position: absolute; padding: $modal-header-padding;
top: -9999px; border-bottom: $modal-header-border-width solid $modal-header-border-color;
width: 50px; @include border-top-radius($modal-content-border-radius);
height: 50px;
overflow: scroll; .close {
} padding: $modal-header-padding;
// auto on the left force icon to the right even when there is no .modal-title
// Scale up the modal margin: (-$modal-header-padding-y) (-$modal-header-padding-x) (-$modal-header-padding-y) auto;
@include media-breakpoint-up(sm) { }
// Automatically set modal's width for larger viewports }
.modal-dialog {
max-width: $modal-md; // Title text within header
margin: $modal-dialog-margin-y-sm-up auto; .modal-title {
} margin-bottom: 0;
line-height: $modal-title-line-height;
.modal-dialog-centered { }
min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2));
} // Modal body
// Where all modal content resides (sibling of .modal-header and .modal-footer)
.modal-content { .modal-body {
@include box-shadow($modal-content-box-shadow-sm-up); position: relative;
} // Enable `flex-grow: 1` so that the body take up as much space as possible
// when should there be a fixed height on `.modal-dialog`.
.modal-sm { max-width: $modal-sm; } flex: 1 1 auto;
padding: $modal-inner-padding;
} }
@include media-breakpoint-up(lg) { // Footer (for actions)
.modal-lg { max-width: $modal-lg; } .modal-footer {
} display: flex;
align-items: center; // vertically center
justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
padding: $modal-inner-padding;
border-top: $modal-footer-border-width solid $modal-footer-border-color;
@include border-bottom-radius($modal-content-border-radius);
// Easily place margin between footer elements
> :not(:first-child) { margin-left: .25rem; }
> :not(:last-child) { margin-right: .25rem; }
}
// Measure scrollbar width for padding body during modal show/hide
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
// Scale up the modal
@include media-breakpoint-up(sm) {
// Automatically set modal's width for larger viewports
.modal-dialog {
max-width: $modal-md;
margin: $modal-dialog-margin-y-sm-up auto;
}
.modal-dialog-scrollable {
max-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2});
.modal-content {
max-height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2});
}
}
.modal-dialog-centered {
min-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2});
&::before {
height: calc(100vh - #{$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) {
.modal-lg,
.modal-xl {
max-width: $modal-lg;
}
}
@include media-breakpoint-up(xl) {
.modal-xl { max-width: $modal-xl; }
}
+120 -118
View File
@@ -1,118 +1,120 @@
// Base class // Base class
// //
// Kickstart any navigation component with a set of style resets. Works with // Kickstart any navigation component with a set of style resets. Works with
// `<nav>`s or `<ul>`s. // `<nav>`s or `<ul>`s.
.nav { .nav {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding-left: 0; padding-left: 0;
margin-bottom: 0; margin-bottom: 0;
list-style: none; list-style: none;
} }
.nav-link { .nav-link {
display: block; display: block;
padding: $nav-link-padding-y $nav-link-padding-x; padding: $nav-link-padding-y $nav-link-padding-x;
@include hover-focus { @include hover-focus {
text-decoration: none; text-decoration: none;
} }
// Disabled state lightens text // Disabled state lightens text
&.disabled { &.disabled {
color: $nav-link-disabled-color; color: $nav-link-disabled-color;
} pointer-events: none;
} cursor: default;
}
// }
// Tabs
// //
// Tabs
.nav-tabs { //
border-bottom: $nav-tabs-border-width solid $nav-tabs-border-color;
.nav-tabs {
.nav-item { border-bottom: $nav-tabs-border-width solid $nav-tabs-border-color;
margin-bottom: -$nav-tabs-border-width;
} .nav-item {
margin-bottom: -$nav-tabs-border-width;
.nav-link { }
border: $nav-tabs-border-width solid transparent;
@include border-top-radius($nav-tabs-border-radius); .nav-link {
border: $nav-tabs-border-width solid transparent;
@include hover-focus { @include border-top-radius($nav-tabs-border-radius);
border-color: $nav-tabs-link-hover-border-color;
} @include hover-focus {
border-color: $nav-tabs-link-hover-border-color;
&.disabled { }
color: $nav-link-disabled-color;
background-color: transparent; &.disabled {
border-color: transparent; color: $nav-link-disabled-color;
} background-color: transparent;
} border-color: transparent;
}
.nav-link.active, }
.nav-item.show .nav-link {
color: $nav-tabs-link-active-color; .nav-link.active,
background-color: $nav-tabs-link-active-bg; .nav-item.show .nav-link {
border-color: $nav-tabs-link-active-border-color; color: $nav-tabs-link-active-color;
} background-color: $nav-tabs-link-active-bg;
border-color: $nav-tabs-link-active-border-color;
.dropdown-menu { }
// Make dropdown border overlap tab border
margin-top: -$nav-tabs-border-width; .dropdown-menu {
// Remove the top rounded corners here since there is a hard edge above the menu // Make dropdown border overlap tab border
@include border-top-radius(0); margin-top: -$nav-tabs-border-width;
} // Remove the top rounded corners here since there is a hard edge above the menu
} @include border-top-radius(0);
}
}
//
// Pills
// //
// Pills
.nav-pills { //
.nav-link {
@include border-radius($nav-pills-border-radius); .nav-pills {
} .nav-link {
@include border-radius($nav-pills-border-radius);
.nav-link.active, }
.show > .nav-link {
color: $nav-pills-link-active-color; .nav-link.active,
background-color: $nav-pills-link-active-bg; .show > .nav-link {
} color: $nav-pills-link-active-color;
} background-color: $nav-pills-link-active-bg;
}
}
//
// Justified variants
// //
// Justified variants
.nav-fill { //
.nav-item {
flex: 1 1 auto; .nav-fill {
text-align: center; .nav-item {
} flex: 1 1 auto;
} text-align: center;
}
.nav-justified { }
.nav-item {
flex-basis: 0; .nav-justified {
flex-grow: 1; .nav-item {
text-align: center; flex-basis: 0;
} flex-grow: 1;
} text-align: center;
}
}
// Tabbable tabs
//
// Hide tabbable panes to start, show them when `.active` // Tabbable tabs
//
.tab-content { // Hide tabbable panes to start, show them when `.active`
> .tab-pane {
display: none; .tab-content {
} > .tab-pane {
> .active { display: none;
display: block; }
} > .active {
} display: block;
}
}
+294 -299
View File
@@ -1,299 +1,294 @@
// Contents // Contents
// //
// Navbar // Navbar
// Navbar brand // Navbar brand
// Navbar nav // Navbar nav
// Navbar text // Navbar text
// Navbar divider // Navbar divider
// Responsive navbar // Responsive navbar
// Navbar position // Navbar position
// Navbar themes // Navbar themes
// Navbar // Navbar
// //
// Provide a static navbar from which we expand to create full-width, fixed, and // Provide a static navbar from which we expand to create full-width, fixed, and
// other navbar variations. // other navbar variations.
.navbar { .navbar {
position: relative; position: relative;
display: flex; display: flex;
flex-wrap: wrap; // allow us to do the line break for collapsing content flex-wrap: wrap; // allow us to do the line break for collapsing content
align-items: center; align-items: center;
justify-content: space-between; // space out brand from logo justify-content: space-between; // space out brand from logo
padding: $navbar-padding-y $navbar-padding-x; padding: $navbar-padding-y $navbar-padding-x;
// Because flex properties aren't inherited, we need to redeclare these first // Because flex properties aren't inherited, we need to redeclare these first
// few properities so that content nested within behave properly. // few properties so that content nested within behave properly.
> .container, > .container,
> .container-fluid { > .container-fluid {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
} }
// Navbar brand // Navbar brand
// //
// Used for brand, project, or site names. // Used for brand, project, or site names.
.navbar-brand { .navbar-brand {
display: inline-block; display: inline-block;
padding-top: $navbar-brand-padding-y; padding-top: $navbar-brand-padding-y;
padding-bottom: $navbar-brand-padding-y; padding-bottom: $navbar-brand-padding-y;
margin-right: $navbar-padding-x; margin-right: $navbar-padding-x;
font-size: $navbar-brand-font-size; @include font-size($navbar-brand-font-size);
line-height: inherit; line-height: inherit;
white-space: nowrap; white-space: nowrap;
@include hover-focus { @include hover-focus {
text-decoration: none; text-decoration: none;
} }
} }
// Navbar nav // Navbar nav
// //
// Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`). // Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
.navbar-nav { .navbar-nav {
display: flex; display: flex;
flex-direction: column; // cannot use `inherit` to get the `.navbar`s value flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
padding-left: 0; padding-left: 0;
margin-bottom: 0; margin-bottom: 0;
list-style: none; list-style: none;
.nav-link { .nav-link {
padding-right: 0; padding-right: 0;
padding-left: 0; padding-left: 0;
} }
.dropdown-menu { .dropdown-menu {
position: static; position: static;
float: none; float: none;
} }
} }
// Navbar text // Navbar text
// //
// //
.navbar-text { .navbar-text {
display: inline-block; display: inline-block;
padding-top: $nav-link-padding-y; padding-top: $nav-link-padding-y;
padding-bottom: $nav-link-padding-y; padding-bottom: $nav-link-padding-y;
} }
// Responsive navbar // Responsive navbar
// //
// Custom styles for responsive collapsing and toggling of navbar contents. // Custom styles for responsive collapsing and toggling of navbar contents.
// Powered by the collapse Bootstrap JavaScript plugin. // Powered by the collapse Bootstrap JavaScript plugin.
// When collapsed, prevent the toggleable navbar contents from appearing in // When collapsed, prevent the toggleable navbar contents from appearing in
// the default flexbox row orienation. Requires the use of `flex-wrap: wrap` // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
// on the `.navbar` parent. // on the `.navbar` parent.
.navbar-collapse { .navbar-collapse {
flex-basis: 100%; flex-basis: 100%;
flex-grow: 1; flex-grow: 1;
// For always expanded or extra full navbars, ensure content aligns itself // For always expanded or extra full navbars, ensure content aligns itself
// properly vertically. Can be easily overridden with flex utilities. // properly vertically. Can be easily overridden with flex utilities.
align-items: center; align-items: center;
} }
// Button for toggling the navbar when in its collapsed state // Button for toggling the navbar when in its collapsed state
.navbar-toggler { .navbar-toggler {
padding: $navbar-toggler-padding-y $navbar-toggler-padding-x; padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
font-size: $navbar-toggler-font-size; @include font-size($navbar-toggler-font-size);
line-height: 1; line-height: 1;
background-color: transparent; // remove default button style background-color: transparent; // remove default button style
border: $border-width solid transparent; // remove default button style border: $border-width solid transparent; // remove default button style
@include border-radius($navbar-toggler-border-radius); @include border-radius($navbar-toggler-border-radius);
@include hover-focus { @include hover-focus {
text-decoration: none; text-decoration: none;
} }
}
// Opinionated: add "hand" cursor to non-disabled .navbar-toggler elements
&:not(:disabled):not(.disabled) { // Keep as a separate element so folks can easily override it with another icon
cursor: pointer; // or image file as needed.
} .navbar-toggler-icon {
} display: inline-block;
width: 1.5em;
// Keep as a separate element so folks can easily override it with another icon height: 1.5em;
// or image file as needed. vertical-align: middle;
.navbar-toggler-icon { content: "";
display: inline-block; background: no-repeat center center;
width: 1.5em; background-size: 100% 100%;
height: 1.5em; }
vertical-align: middle;
content: ""; // Generate series of `.navbar-expand-*` responsive classes for configuring
background: no-repeat center center; // where your navbar collapses.
background-size: 100% 100%; .navbar-expand {
} @each $breakpoint in map-keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints);
// Generate series of `.navbar-expand-*` responsive classes for configuring $infix: breakpoint-infix($next, $grid-breakpoints);
// where your navbar collapses.
.navbar-expand { &#{$infix} {
@each $breakpoint in map-keys($grid-breakpoints) { @include media-breakpoint-down($breakpoint) {
$next: breakpoint-next($breakpoint, $grid-breakpoints); > .container,
$infix: breakpoint-infix($next, $grid-breakpoints); > .container-fluid {
padding-right: 0;
&#{$infix} { padding-left: 0;
@include media-breakpoint-down($breakpoint) { }
> .container, }
> .container-fluid {
padding-right: 0; @include media-breakpoint-up($next) {
padding-left: 0; flex-flow: row nowrap;
} justify-content: flex-start;
}
.navbar-nav {
@include media-breakpoint-up($next) { flex-direction: row;
flex-flow: row nowrap;
justify-content: flex-start; .dropdown-menu {
position: absolute;
.navbar-nav { }
flex-direction: row;
.nav-link {
.dropdown-menu { padding-right: $navbar-nav-link-padding-x;
position: absolute; padding-left: $navbar-nav-link-padding-x;
} }
}
.nav-link {
padding-right: $navbar-nav-link-padding-x; // For nesting containers, have to redeclare for alignment purposes
padding-left: $navbar-nav-link-padding-x; > .container,
} > .container-fluid {
} flex-wrap: nowrap;
}
// For nesting containers, have to redeclare for alignment purposes
> .container, .navbar-collapse {
> .container-fluid { display: flex !important; // stylelint-disable-line declaration-no-important
flex-wrap: nowrap;
} // Changes flex-bases to auto because of an IE10 bug
flex-basis: auto;
.navbar-collapse { }
display: flex !important; // stylelint-disable-line declaration-no-important
.navbar-toggler {
// Changes flex-bases to auto because of an IE10 bug display: none;
flex-basis: auto; }
} }
}
.navbar-toggler { }
display: none; }
}
}
} // Navbar themes
} //
} // Styles for switching between navbars with light or dark background.
// Dark links against a light background
// Navbar themes .navbar-light {
// .navbar-brand {
// Styles for switching between navbars with light or dark background. color: $navbar-light-brand-color;
// Dark links against a light background @include hover-focus {
.navbar-light { color: $navbar-light-brand-hover-color;
.navbar-brand { }
color: $navbar-light-active-color; }
@include hover-focus { .navbar-nav {
color: $navbar-light-active-color; .nav-link {
} color: $navbar-light-color;
}
@include hover-focus {
.navbar-nav { color: $navbar-light-hover-color;
.nav-link { }
color: $navbar-light-color;
&.disabled {
@include hover-focus { color: $navbar-light-disabled-color;
color: $navbar-light-hover-color; }
} }
&.disabled { .show > .nav-link,
color: $navbar-light-disabled-color; .active > .nav-link,
} .nav-link.show,
} .nav-link.active {
color: $navbar-light-active-color;
.show > .nav-link, }
.active > .nav-link, }
.nav-link.show,
.nav-link.active { .navbar-toggler {
color: $navbar-light-active-color; color: $navbar-light-color;
} border-color: $navbar-light-toggler-border-color;
} }
.navbar-toggler { .navbar-toggler-icon {
color: $navbar-light-color; background-image: $navbar-light-toggler-icon-bg;
border-color: $navbar-light-toggler-border-color; }
}
.navbar-text {
.navbar-toggler-icon { color: $navbar-light-color;
background-image: $navbar-light-toggler-icon-bg; a {
} color: $navbar-light-active-color;
.navbar-text { @include hover-focus {
color: $navbar-light-color; color: $navbar-light-active-color;
a { }
color: $navbar-light-active-color; }
}
@include hover-focus { }
color: $navbar-light-active-color;
} // White links against a dark background
} .navbar-dark {
} .navbar-brand {
} color: $navbar-dark-brand-color;
// White links against a dark background @include hover-focus {
.navbar-dark { color: $navbar-dark-brand-hover-color;
.navbar-brand { }
color: $navbar-dark-active-color; }
@include hover-focus { .navbar-nav {
color: $navbar-dark-active-color; .nav-link {
} color: $navbar-dark-color;
}
@include hover-focus {
.navbar-nav { color: $navbar-dark-hover-color;
.nav-link { }
color: $navbar-dark-color;
&.disabled {
@include hover-focus { color: $navbar-dark-disabled-color;
color: $navbar-dark-hover-color; }
} }
&.disabled { .show > .nav-link,
color: $navbar-dark-disabled-color; .active > .nav-link,
} .nav-link.show,
} .nav-link.active {
color: $navbar-dark-active-color;
.show > .nav-link, }
.active > .nav-link, }
.nav-link.show,
.nav-link.active { .navbar-toggler {
color: $navbar-dark-active-color; color: $navbar-dark-color;
} border-color: $navbar-dark-toggler-border-color;
} }
.navbar-toggler { .navbar-toggler-icon {
color: $navbar-dark-color; background-image: $navbar-dark-toggler-icon-bg;
border-color: $navbar-dark-toggler-border-color; }
}
.navbar-text {
.navbar-toggler-icon { color: $navbar-dark-color;
background-image: $navbar-dark-toggler-icon-bg; a {
} color: $navbar-dark-active-color;
.navbar-text { @include hover-focus {
color: $navbar-dark-color; color: $navbar-dark-active-color;
a { }
color: $navbar-dark-active-color; }
}
@include hover-focus { }
color: $navbar-dark-active-color;
}
}
}
}
+73 -78
View File
@@ -1,78 +1,73 @@
.pagination { .pagination {
display: flex; display: flex;
@include list-unstyled(); @include list-unstyled();
@include border-radius(); @include border-radius();
} }
.page-link { .page-link {
position: relative; position: relative;
display: block; display: block;
padding: $pagination-padding-y $pagination-padding-x; padding: $pagination-padding-y $pagination-padding-x;
margin-left: -$pagination-border-width; margin-left: -$pagination-border-width;
line-height: $pagination-line-height; line-height: $pagination-line-height;
color: $pagination-color; color: $pagination-color;
background-color: $pagination-bg; background-color: $pagination-bg;
border: $pagination-border-width solid $pagination-border-color; border: $pagination-border-width solid $pagination-border-color;
&:hover { &:hover {
z-index: 2; z-index: 2;
color: $pagination-hover-color; color: $pagination-hover-color;
text-decoration: none; text-decoration: none;
background-color: $pagination-hover-bg; background-color: $pagination-hover-bg;
border-color: $pagination-hover-border-color; border-color: $pagination-hover-border-color;
} }
&:focus { &:focus {
z-index: 2; z-index: 2;
outline: $pagination-focus-outline; outline: $pagination-focus-outline;
box-shadow: $pagination-focus-box-shadow; box-shadow: $pagination-focus-box-shadow;
} }
}
// Opinionated: add "hand" cursor to non-disabled .page-link elements
&:not(:disabled):not(.disabled) { .page-item {
cursor: pointer; &:first-child {
} .page-link {
} margin-left: 0;
@include border-left-radius($border-radius);
.page-item { }
&:first-child { }
.page-link { &:last-child {
margin-left: 0; .page-link {
@include border-left-radius($border-radius); @include border-right-radius($border-radius);
} }
} }
&:last-child {
.page-link { &.active .page-link {
@include border-right-radius($border-radius); z-index: 1;
} color: $pagination-active-color;
} background-color: $pagination-active-bg;
border-color: $pagination-active-border-color;
&.active .page-link { }
z-index: 1;
color: $pagination-active-color; &.disabled .page-link {
background-color: $pagination-active-bg; color: $pagination-disabled-color;
border-color: $pagination-active-border-color; pointer-events: none;
} // Opinionated: remove the "hand" cursor set previously for .page-link
cursor: auto;
&.disabled .page-link { background-color: $pagination-disabled-bg;
color: $pagination-disabled-color; border-color: $pagination-disabled-border-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; //
} // Sizing
} //
.pagination-lg {
// @include pagination-size($pagination-padding-y-lg, $pagination-padding-x-lg, $font-size-lg, $line-height-lg, $border-radius-lg);
// Sizing }
//
.pagination-sm {
.pagination-lg { @include pagination-size($pagination-padding-y-sm, $pagination-padding-x-sm, $font-size-sm, $line-height-sm, $border-radius-sm);
@include pagination-size($pagination-padding-y-lg, $pagination-padding-x-lg, $font-size-lg, $line-height-lg, $border-radius-lg); }
}
.pagination-sm {
@include pagination-size($pagination-padding-y-sm, $pagination-padding-x-sm, $font-size-sm, $line-height-sm, $border-radius-sm);
}
+171 -183
View File
@@ -1,183 +1,171 @@
.popover { .popover {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: $zindex-popover; z-index: $zindex-popover;
display: block; display: block;
max-width: $popover-max-width; max-width: $popover-max-width;
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. // 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. // So reset our font and text properties to avoid inheriting weird values.
@include reset-text(); @include reset-text();
font-size: $popover-font-size; @include font-size($popover-font-size);
// Allow breaking very long words so they don't overflow the popover's bounds // Allow breaking very long words so they don't overflow the popover's bounds
word-wrap: break-word; word-wrap: break-word;
background-color: $popover-bg; background-color: $popover-bg;
background-clip: padding-box; background-clip: padding-box;
border: $popover-border-width solid $popover-border-color; border: $popover-border-width solid $popover-border-color;
@include border-radius($popover-border-radius); @include border-radius($popover-border-radius);
@include box-shadow($popover-box-shadow); @include box-shadow($popover-box-shadow);
.arrow { .arrow {
position: absolute; position: absolute;
display: block; display: block;
width: $popover-arrow-width; width: $popover-arrow-width;
height: $popover-arrow-height; height: $popover-arrow-height;
margin: 0 $border-radius-lg; margin: 0 $border-radius-lg;
&::before, &::before,
&::after { &::after {
position: absolute; position: absolute;
display: block; display: block;
content: ""; content: "";
border-color: transparent; border-color: transparent;
border-style: solid; border-style: solid;
} }
} }
} }
.bs-popover-top { .bs-popover-top {
margin-bottom: $popover-arrow-height; margin-bottom: $popover-arrow-height;
.arrow { > .arrow {
bottom: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); bottom: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1);
}
&::before {
.arrow::before, bottom: 0;
.arrow::after { border-width: $popover-arrow-height ($popover-arrow-width / 2) 0;
border-width: $popover-arrow-height ($popover-arrow-width / 2) 0; border-top-color: $popover-arrow-outer-color;
} }
.arrow::before { &::after {
bottom: 0; bottom: $popover-border-width;
border-top-color: $popover-arrow-outer-color; border-width: $popover-arrow-height ($popover-arrow-width / 2) 0;
} border-top-color: $popover-arrow-color;
}
.arrow::after { }
bottom: $popover-border-width; }
border-top-color: $popover-arrow-color;
} .bs-popover-right {
} margin-left: $popover-arrow-height;
.bs-popover-right { > .arrow {
margin-left: $popover-arrow-height; left: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1);
width: $popover-arrow-height;
.arrow { height: $popover-arrow-width;
left: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners
width: $popover-arrow-height;
height: $popover-arrow-width; &::before {
margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners left: 0;
} border-width: ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2) 0;
border-right-color: $popover-arrow-outer-color;
.arrow::before, }
.arrow::after {
border-width: ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2) 0; &::after {
} left: $popover-border-width;
border-width: ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2) 0;
.arrow::before { border-right-color: $popover-arrow-color;
left: 0; }
border-right-color: $popover-arrow-outer-color; }
} }
.arrow::after { .bs-popover-bottom {
left: $popover-border-width; margin-top: $popover-arrow-height;
border-right-color: $popover-arrow-color;
} > .arrow {
} top: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1);
.bs-popover-bottom { &::before {
margin-top: $popover-arrow-height; top: 0;
border-width: 0 ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2);
.arrow { border-bottom-color: $popover-arrow-outer-color;
top: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); }
}
&::after {
.arrow::before, top: $popover-border-width;
.arrow::after { border-width: 0 ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2);
border-width: 0 ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2); border-bottom-color: $popover-arrow-color;
} }
}
.arrow::before {
top: 0; // This will remove the popover-header's border just below the arrow
border-bottom-color: $popover-arrow-outer-color; .popover-header::before {
} position: absolute;
top: 0;
.arrow::after { left: 50%;
top: $popover-border-width; display: block;
border-bottom-color: $popover-arrow-color; width: $popover-arrow-width;
} margin-left: -$popover-arrow-width / 2;
content: "";
// This will remove the popover-header's border just below the arrow border-bottom: $popover-border-width solid $popover-header-bg;
.popover-header::before { }
position: absolute; }
top: 0;
left: 50%; .bs-popover-left {
display: block; margin-right: $popover-arrow-height;
width: $popover-arrow-width;
margin-left: ($popover-arrow-width / -2); > .arrow {
content: ""; right: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1);
border-bottom: $popover-border-width solid $popover-header-bg; 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 { &::before {
margin-right: $popover-arrow-height; right: 0;
border-width: ($popover-arrow-width / 2) 0 ($popover-arrow-width / 2) $popover-arrow-height;
.arrow { border-left-color: $popover-arrow-outer-color;
right: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); }
width: $popover-arrow-height;
height: $popover-arrow-width; &::after {
margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners right: $popover-border-width;
} border-width: ($popover-arrow-width / 2) 0 ($popover-arrow-width / 2) $popover-arrow-height;
border-left-color: $popover-arrow-color;
.arrow::before, }
.arrow::after { }
border-width: ($popover-arrow-width / 2) 0 ($popover-arrow-width / 2) $popover-arrow-height; }
}
.bs-popover-auto {
.arrow::before { &[x-placement^="top"] {
right: 0; @extend .bs-popover-top;
border-left-color: $popover-arrow-outer-color; }
} &[x-placement^="right"] {
@extend .bs-popover-right;
.arrow::after { }
right: $popover-border-width; &[x-placement^="bottom"] {
border-left-color: $popover-arrow-color; @extend .bs-popover-bottom;
} }
} &[x-placement^="left"] {
@extend .bs-popover-left;
.bs-popover-auto { }
&[x-placement^="top"] { }
@extend .bs-popover-top;
}
&[x-placement^="right"] { // Offset the popover to account for the popover arrow
@extend .bs-popover-right; .popover-header {
} padding: $popover-header-padding-y $popover-header-padding-x;
&[x-placement^="bottom"] { margin-bottom: 0; // Reset the default from Reboot
@extend .bs-popover-bottom; @include font-size($font-size-base);
} color: $popover-header-color;
&[x-placement^="left"] { background-color: $popover-header-bg;
@extend .bs-popover-left; border-bottom: $popover-border-width solid darken($popover-header-bg, 5%);
} $offset-border-width: calc(#{$border-radius-lg} - #{$popover-border-width});
} @include border-top-radius($offset-border-width);
&:empty {
// Offset the popover to account for the popover arrow display: none;
.popover-header { }
padding: $popover-header-padding-y $popover-header-padding-x; }
margin-bottom: 0; // Reset the default from Reboot
font-size: $font-size-base; .popover-body {
color: $popover-header-color; padding: $popover-body-padding-y $popover-body-padding-x;
background-color: $popover-header-bg; color: $popover-body-color;
border-bottom: $popover-border-width solid darken($popover-header-bg, 5%); }
$offset-border-width: calc(#{$border-radius-lg} - #{$popover-border-width});
@include border-top-radius($offset-border-width);
&:empty {
display: none;
}
}
.popover-body {
padding: $popover-body-padding-y $popover-body-padding-x;
color: $popover-body-color;
}
+141 -141
View File
@@ -1,141 +1,141 @@
// stylelint-disable declaration-no-important, selector-no-qualifying-type // stylelint-disable declaration-no-important, selector-no-qualifying-type
// Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css // Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css
// ========================================================================== // ==========================================================================
// Print styles. // Print styles.
// Inlined to avoid the additional HTTP request: // Inlined to avoid the additional HTTP request:
// https://www.phpied.com/delay-loading-your-print-css/ // https://www.phpied.com/delay-loading-your-print-css/
// ========================================================================== // ==========================================================================
@if $enable-print-styles { @if $enable-print-styles {
@media print { @media print {
*, *,
*::before, *::before,
*::after { *::after {
// Bootstrap specific; comment out `color` and `background` // Bootstrap specific; comment out `color` and `background`
//color: $black !important; // Black prints faster //color: $black !important; // Black prints faster
text-shadow: none !important; text-shadow: none !important;
//background: transparent !important; //background: transparent !important;
box-shadow: none !important; box-shadow: none !important;
} }
a { a {
&:not(.btn) { &:not(.btn) {
text-decoration: underline; text-decoration: underline;
} }
} }
// Bootstrap specific; comment the following selector out // Bootstrap specific; comment the following selector out
//a[href]::after { //a[href]::after {
// content: " (" attr(href) ")"; // content: " (" attr(href) ")";
//} //}
abbr[title]::after { abbr[title]::after {
content: " (" attr(title) ")"; content: " (" attr(title) ")";
} }
// Bootstrap specific; comment the following selector out // Bootstrap specific; comment the following selector out
// //
// Don't show links that are fragment identifiers, // Don't show links that are fragment identifiers,
// or use the `javascript:` pseudo protocol // or use the `javascript:` pseudo protocol
// //
//a[href^="#"]::after, //a[href^="#"]::after,
//a[href^="javascript:"]::after { //a[href^="javascript:"]::after {
// content: ""; // content: "";
//} //}
pre { pre {
white-space: pre-wrap !important; white-space: pre-wrap !important;
} }
pre, pre,
blockquote { blockquote {
border: $border-width solid $gray-500; // Bootstrap custom code; using `$border-width` instead of 1px border: $border-width solid $gray-500; // Bootstrap custom code; using `$border-width` instead of 1px
page-break-inside: avoid; page-break-inside: avoid;
} }
// //
// Printing Tables: // Printing Tables:
// http://css-discuss.incutio.com/wiki/Printing_Tables // http://css-discuss.incutio.com/wiki/Printing_Tables
// //
thead { thead {
display: table-header-group; display: table-header-group;
} }
tr, tr,
img { img {
page-break-inside: avoid; page-break-inside: avoid;
} }
p, p,
h2, h2,
h3 { h3 {
orphans: 3; orphans: 3;
widows: 3; widows: 3;
} }
h2, h2,
h3 { h3 {
page-break-after: avoid; page-break-after: avoid;
} }
// Bootstrap specific changes start // Bootstrap specific changes start
// Specify a size and min-width to make printing closer across browsers. // Specify a size and min-width to make printing closer across browsers.
// We don't set margin here because it breaks `size` in Chrome. We also // We don't set margin here because it breaks `size` in Chrome. We also
// don't use `!important` on `size` as it breaks in Chrome. // don't use `!important` on `size` as it breaks in Chrome.
@page { @page {
size: $print-page-size; size: $print-page-size;
} }
body { body {
min-width: $print-body-min-width !important; min-width: $print-body-min-width !important;
} }
.container { .container {
min-width: $print-body-min-width !important; min-width: $print-body-min-width !important;
} }
// Bootstrap components // Bootstrap components
.navbar { .navbar {
display: none; display: none;
} }
.badge { .badge {
border: $border-width solid $black; border: $border-width solid $black;
} }
.table { .table {
border-collapse: collapse !important; border-collapse: collapse !important;
td, td,
th { th {
background-color: $white !important; background-color: $white !important;
} }
} }
.table-bordered { .table-bordered {
th, th,
td { td {
border: 1px solid $gray-300 !important; border: 1px solid $gray-300 !important;
} }
} }
.table-dark { .table-dark {
color: inherit; color: inherit;
th, th,
td, td,
thead th, thead th,
tbody + tbody { tbody + tbody {
border-color: $table-border-color; border-color: $table-border-color;
} }
} }
.table .thead-dark th { .table .thead-dark th {
color: inherit; color: inherit;
border-color: $table-border-color; border-color: $table-border-color;
} }
// Bootstrap specific changes end // Bootstrap specific changes end
} }
} }
+43 -34
View File
@@ -1,34 +1,43 @@
@keyframes progress-bar-stripes { // Disable animation if transitions are disabled
from { background-position: $progress-height 0; } @if $enable-transitions {
to { background-position: 0 0; } @keyframes progress-bar-stripes {
} from { background-position: $progress-height 0; }
to { background-position: 0 0; }
.progress { }
display: flex; }
height: $progress-height;
overflow: hidden; // force rounded corners by cropping it .progress {
font-size: $progress-font-size; display: flex;
background-color: $progress-bg; height: $progress-height;
@include border-radius($progress-border-radius); overflow: hidden; // force rounded corners by cropping it
@include box-shadow($progress-box-shadow); @include font-size($progress-font-size);
} background-color: $progress-bg;
@include border-radius($progress-border-radius);
.progress-bar { @include box-shadow($progress-box-shadow);
display: flex; }
flex-direction: column;
justify-content: center; .progress-bar {
color: $progress-bar-color; display: flex;
text-align: center; flex-direction: column;
white-space: nowrap; justify-content: center;
background-color: $progress-bar-bg; color: $progress-bar-color;
@include transition($progress-bar-transition); text-align: center;
} white-space: nowrap;
background-color: $progress-bar-bg;
.progress-bar-striped { @include transition($progress-bar-transition);
@include gradient-striped(); }
background-size: $progress-height $progress-height;
} .progress-bar-striped {
@include gradient-striped();
.progress-bar-animated { background-size: $progress-height $progress-height;
animation: progress-bar-stripes $progress-bar-animation-timing; }
}
@if $enable-transitions {
.progress-bar-animated {
animation: progress-bar-stripes $progress-bar-animation-timing;
@media (prefers-reduced-motion: reduce) {
animation: none;
}
}
}
+483 -480
View File
@@ -1,480 +1,483 @@
// stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix // stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
// Reboot // Reboot
// //
// Normalization of HTML elements, manually forked from Normalize.css to remove // Normalization of HTML elements, manually forked from Normalize.css to remove
// styles targeting irrelevant browsers while applying new styles. // styles targeting irrelevant browsers while applying new styles.
// //
// Normalize is licensed MIT. https://github.com/necolas/normalize.css // Normalize is licensed MIT. https://github.com/necolas/normalize.css
// Document // Document
// //
// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`. // 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
// 2. Change the default font family in all browsers. // 2. Change the default font family in all browsers.
// 3. Correct the line height in all browsers. // 3. Correct the line height in all browsers.
// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS. // 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so // 5. Change the default tap highlight to be completely transparent in iOS.
// we force a non-overlapping, non-auto-hiding scrollbar to counteract.
// 6. Change the default tap highlight to be completely transparent in iOS. *,
*::before,
*, *::after {
*::before, box-sizing: border-box; // 1
*::after { }
box-sizing: border-box; // 1
} html {
font-family: sans-serif; // 2
html { line-height: 1.15; // 3
font-family: sans-serif; // 2 -webkit-text-size-adjust: 100%; // 4
line-height: 1.15; // 3 -webkit-tap-highlight-color: rgba($black, 0); // 5
-webkit-text-size-adjust: 100%; // 4 }
-ms-text-size-adjust: 100%; // 4
-ms-overflow-style: scrollbar; // 5 // Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
-webkit-tap-highlight-color: rgba($black, 0); // 6 // TODO: remove in v5
} // stylelint-disable-next-line selector-list-comma-newline-after
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
// IE10+ doesn't honor `<meta name="viewport">` in some cases. display: block;
@at-root { }
@-ms-viewport {
width: device-width; // Body
} //
} // 1. Remove the margin in all browsers.
// 2. As a best practice, apply a default `background-color`.
// stylelint-disable selector-list-comma-newline-after // 3. Set an explicit initial text-align value so that we can later use
// Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers) // the `inherit` value on things like `<th>` elements.
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block; body {
} margin: 0; // 1
// stylelint-enable selector-list-comma-newline-after font-family: $font-family-base;
@include font-size($font-size-base);
// Body font-weight: $font-weight-base;
// line-height: $line-height-base;
// 1. Remove the margin in all browsers. color: $body-color;
// 2. As a best practice, apply a default `background-color`. text-align: left; // 3
// 3. Set an explicit initial text-align value so that we can later use the background-color: $body-bg; // 2
// the `inherit` value on things like `<th>` elements. }
body { // Suppress the focus outline on elements that cannot be accessed via keyboard.
margin: 0; // 1 // This prevents an unwanted focus outline from appearing around elements that
font-family: $font-family-base; // might still respond to pointer events.
font-size: $font-size-base; //
font-weight: $font-weight-base; // Credit: https://github.com/suitcss/base
line-height: $line-height-base; [tabindex="-1"]:focus {
color: $body-color; outline: 0 !important;
text-align: left; // 3 }
background-color: $body-bg; // 2
}
// Content grouping
// Suppress the focus outline on elements that cannot be accessed via keyboard. //
// This prevents an unwanted focus outline from appearing around elements that // 1. Add the correct box sizing in Firefox.
// might still respond to pointer events. // 2. Show the overflow in Edge and IE.
//
// Credit: https://github.com/suitcss/base hr {
[tabindex="-1"]:focus { box-sizing: content-box; // 1
outline: 0 !important; height: 0; // 1
} overflow: visible; // 2
}
// Content grouping
// //
// 1. Add the correct box sizing in Firefox. // Typography
// 2. Show the overflow in Edge and IE. //
hr { // Remove top margins from headings
box-sizing: content-box; // 1 //
height: 0; // 1 // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
overflow: visible; // 2 // margin for easier control within type scales as it avoids margin collapsing.
} // stylelint-disable-next-line selector-list-comma-newline-after
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
// margin-bottom: $headings-margin-bottom;
// Typography }
//
// Reset margins on paragraphs
// Remove top margins from headings //
// // Similarly, the top margin on `<p>`s get reset. However, we also reset the
// By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top // bottom margin to use `rem` units instead of `em`.
// margin for easier control within type scales as it avoids margin collapsing. p {
// stylelint-disable selector-list-comma-newline-after margin-top: 0;
h1, h2, h3, h4, h5, h6 { margin-bottom: $paragraph-margin-bottom;
margin-top: 0; }
margin-bottom: $headings-margin-bottom;
} // Abbreviations
// stylelint-enable selector-list-comma-newline-after //
// 1. Duplicate behavior to the data-* attribute for our tooltip plugin
// Reset margins on paragraphs // 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
// // 3. Add explicit cursor to indicate changed behavior.
// Similarly, the top margin on `<p>`s get reset. However, we also reset the // 4. Remove the bottom border in Firefox 39-.
// bottom margin to use `rem` units instead of `em`. // 5. Prevent the text-decoration to be skipped.
p {
margin-top: 0; abbr[title],
margin-bottom: $paragraph-margin-bottom; abbr[data-original-title] { // 1
} text-decoration: underline; // 2
text-decoration: underline dotted; // 2
// Abbreviations cursor: help; // 3
// border-bottom: 0; // 4
// 1. Remove the bottom border in Firefox 39-. text-decoration-skip-ink: none; // 5
// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. }
// 3. Add explicit cursor to indicate changed behavior.
// 4. Duplicate behavior to the data-* attribute for our tooltip plugin address {
margin-bottom: 1rem;
abbr[title], font-style: normal;
abbr[data-original-title] { // 4 line-height: inherit;
text-decoration: underline; // 2 }
text-decoration: underline dotted; // 2
cursor: help; // 3 ol,
border-bottom: 0; // 1 ul,
} dl {
margin-top: 0;
address { margin-bottom: 1rem;
margin-bottom: 1rem; }
font-style: normal;
line-height: inherit; ol ol,
} ul ul,
ol ul,
ol, ul ol {
ul, margin-bottom: 0;
dl { }
margin-top: 0;
margin-bottom: 1rem; dt {
} font-weight: $dt-font-weight;
}
ol ol,
ul ul, dd {
ol ul, margin-bottom: .5rem;
ul ol { margin-left: 0; // Undo browser default
margin-bottom: 0; }
}
blockquote {
dt { margin: 0 0 1rem;
font-weight: $dt-font-weight; }
}
b,
dd { strong {
margin-bottom: .5rem; font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari
margin-left: 0; // Undo browser default }
}
small {
blockquote { @include font-size(80%); // Add the correct font size in all browsers
margin: 0 0 1rem; }
}
//
dfn { // Prevent `sub` and `sup` elements from affecting the line height in
font-style: italic; // Add the correct font style in Android 4.3- // all browsers.
} //
// stylelint-disable font-weight-notation sub,
b, sup {
strong { position: relative;
font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari @include font-size(75%);
} line-height: 0;
// stylelint-enable font-weight-notation vertical-align: baseline;
}
small {
font-size: 80%; // Add the correct font size in all browsers sub { bottom: -.25em; }
} sup { top: -.5em; }
//
// Prevent `sub` and `sup` elements from affecting the line height in //
// all browsers. // Links
// //
sub, a {
sup { color: $link-color;
position: relative; text-decoration: $link-decoration;
font-size: 75%; background-color: transparent; // Remove the gray background on active links in IE 10.
line-height: 0;
vertical-align: baseline; @include hover {
} color: $link-hover-color;
text-decoration: $link-hover-decoration;
sub { bottom: -.25em; } }
sup { top: -.5em; } }
// And undo these styles for placeholder links/named anchors (without href)
// // which have not been made explicitly keyboard-focusable (without tabindex).
// Links // It would be more straightforward to just use a[href] in previous block, but that
// // causes specificity issues in many other styles that are too complex to fix.
// See https://github.com/twbs/bootstrap/issues/19402
a {
color: $link-color; a:not([href]):not([tabindex]) {
text-decoration: $link-decoration; color: inherit;
background-color: transparent; // Remove the gray background on active links in IE 10. text-decoration: none;
-webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.
@include hover-focus {
@include hover { color: inherit;
color: $link-hover-color; text-decoration: none;
text-decoration: $link-hover-decoration; }
}
} &:focus {
outline: 0;
// And undo these styles for placeholder links/named anchors (without href) }
// which have not been made explicitly keyboard-focusable (without tabindex). }
// It would be more straightforward to just use a[href] in previous block, but that
// causes specificity issues in many other styles that are too complex to fix.
// See https://github.com/twbs/bootstrap/issues/19402 //
// Code
a:not([href]):not([tabindex]) { //
color: inherit;
text-decoration: none; pre,
code,
@include hover-focus { kbd,
color: inherit; samp {
text-decoration: none; font-family: $font-family-monospace;
} @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
}
&:focus {
outline: 0; pre {
} // Remove browser default top margin
} margin-top: 0;
// Reset browser default of `1em` to use `rem`s
margin-bottom: 1rem;
// // Don't allow content to break outside
// Code overflow: auto;
// }
pre,
code, //
kbd, // Figures
samp { //
font-family: $font-family-monospace;
font-size: 1em; // Correct the odd `em` font sizing in all browsers. figure {
} // Apply a consistent margin strategy (matches our type styles).
margin: 0 0 1rem;
pre { }
// Remove browser default top margin
margin-top: 0;
// Reset browser default of `1em` to use `rem`s //
margin-bottom: 1rem; // Images and content
// Don't allow content to break outside //
overflow: auto;
// We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so img {
// we force a non-overlapping, non-auto-hiding scrollbar to counteract. vertical-align: middle;
-ms-overflow-style: scrollbar; border-style: none; // Remove the border on images inside links in IE 10-.
} }
svg {
// // Workaround for the SVG overflow bug in IE10/11 is still required.
// Figures // See https://github.com/twbs/bootstrap/issues/26878
// overflow: hidden;
vertical-align: middle;
figure { }
// Apply a consistent margin strategy (matches our type styles).
margin: 0 0 1rem;
} //
// Tables
//
//
// Images and content table {
// border-collapse: collapse; // Prevent double borders
}
img {
vertical-align: middle; caption {
border-style: none; // Remove the border on images inside links in IE 10-. padding-top: $table-cell-padding;
} padding-bottom: $table-cell-padding;
color: $table-caption-color;
svg:not(:root) { text-align: left;
overflow: hidden; // Hide the overflow in IE caption-side: bottom;
} }
th {
// // Matches default `<td>` alignment by inheriting from the `<body>`, or the
// Tables // closest parent with a set `text-align`.
// text-align: inherit;
}
table {
border-collapse: collapse; // Prevent double borders
} //
// Forms
caption { //
padding-top: $table-cell-padding;
padding-bottom: $table-cell-padding; label {
color: $table-caption-color; // Allow labels to use `margin` for spacing.
text-align: left; display: inline-block;
caption-side: bottom; margin-bottom: $label-margin-bottom;
} }
th { // Remove the default `border-radius` that macOS Chrome adds.
// Matches default `<td>` alignment by inheriting from the `<body>`, or the //
// closest parent with a set `text-align`. // Details at https://github.com/twbs/bootstrap/issues/24093
text-align: inherit; button {
} // stylelint-disable-next-line property-blacklist
border-radius: 0;
}
//
// Forms // Work around a Firefox/IE bug where the transparent `button` background
// // results in a loss of the default `button` focus styles.
//
label { // Credit: https://github.com/suitcss/base/
// Allow labels to use `margin` for spacing. button:focus {
display: inline-block; outline: 1px dotted;
margin-bottom: $label-margin-bottom; outline: 5px auto -webkit-focus-ring-color;
} }
// Remove the default `border-radius` that macOS Chrome adds. input,
// button,
// Details at https://github.com/twbs/bootstrap/issues/24093 select,
button { optgroup,
border-radius: 0; textarea {
} margin: 0; // Remove the margin in Firefox and Safari
font-family: inherit;
// Work around a Firefox/IE bug where the transparent `button` background @include font-size(inherit);
// results in a loss of the default `button` focus styles. line-height: inherit;
// }
// Credit: https://github.com/suitcss/base/
button:focus { button,
outline: 1px dotted; input {
outline: 5px auto -webkit-focus-ring-color; overflow: visible; // Show the overflow in Edge
} }
input, button,
button, select {
select, text-transform: none; // Remove the inheritance of text transform in Firefox
optgroup, }
textarea {
margin: 0; // Remove the margin in Firefox and Safari // Remove the inheritance of word-wrap in Safari.
font-family: inherit; //
font-size: inherit; // Details at https://github.com/twbs/bootstrap/issues/24990
line-height: inherit; select {
} word-wrap: normal;
}
button,
input {
overflow: visible; // Show the overflow in Edge // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
} // controls in Android 4.
// 2. Correct the inability to style clickable types in iOS and Safari.
button, button,
select { [type="button"], // 1
text-transform: none; // Remove the inheritance of text transform in Firefox [type="reset"],
} [type="submit"] {
-webkit-appearance: button; // 2
// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` }
// controls in Android 4.
// 2. Correct the inability to style clickable types in iOS and Safari. // Opinionated: add "hand" cursor to non-disabled button elements.
button, @if $enable-pointer-cursor-for-buttons {
html [type="button"], // 1 button,
[type="reset"], [type="button"],
[type="submit"] { [type="reset"],
-webkit-appearance: button; // 2 [type="submit"] {
} &:not(:disabled) {
cursor: pointer;
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize. }
button::-moz-focus-inner, }
[type="button"]::-moz-focus-inner, }
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner { // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
padding: 0; button::-moz-focus-inner,
border-style: none; [type="button"]::-moz-focus-inner,
} [type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
input[type="radio"], padding: 0;
input[type="checkbox"] { border-style: none;
box-sizing: border-box; // 1. Add the correct box sizing in IE 10- }
padding: 0; // 2. Remove the padding in IE 10-
} input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box; // 1. Add the correct box sizing in IE 10-
input[type="date"], padding: 0; // 2. Remove the padding in IE 10-
input[type="time"], }
input[type="datetime-local"],
input[type="month"] {
// Remove the default appearance of temporal inputs to avoid a Mobile Safari input[type="date"],
// bug where setting a custom line-height prevents text from being vertically input[type="time"],
// centered within the input. input[type="datetime-local"],
// See https://bugs.webkit.org/show_bug.cgi?id=139848 input[type="month"] {
// and https://github.com/twbs/bootstrap/issues/11266 // Remove the default appearance of temporal inputs to avoid a Mobile Safari
-webkit-appearance: listbox; // bug where setting a custom line-height prevents text from being vertically
} // centered within the input.
// See https://bugs.webkit.org/show_bug.cgi?id=139848
textarea { // and https://github.com/twbs/bootstrap/issues/11266
overflow: auto; // Remove the default vertical scrollbar in IE. -webkit-appearance: listbox;
// Textareas should really only resize vertically so they don't break their (horizontal) containers. }
resize: vertical;
} textarea {
overflow: auto; // Remove the default vertical scrollbar in IE.
fieldset { // Textareas should really only resize vertically so they don't break their (horizontal) containers.
// Browsers set a default `min-width: min-content;` on fieldsets, resize: vertical;
// unlike e.g. `<div>`s, which have `min-width: 0;` by default. }
// So we reset that to ensure fieldsets behave more like a standard block element.
// See https://github.com/twbs/bootstrap/issues/12359 fieldset {
// and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements // Browsers set a default `min-width: min-content;` on fieldsets,
min-width: 0; // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
// Reset the default outline behavior of fieldsets so they don't affect page layout. // So we reset that to ensure fieldsets behave more like a standard block element.
padding: 0; // See https://github.com/twbs/bootstrap/issues/12359
margin: 0; // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
border: 0; min-width: 0;
} // Reset the default outline behavior of fieldsets so they don't affect page layout.
padding: 0;
// 1. Correct the text wrapping in Edge and IE. margin: 0;
// 2. Correct the color inheritance from `fieldset` elements in IE. border: 0;
legend { }
display: block;
width: 100%; // 1. Correct the text wrapping in Edge and IE.
max-width: 100%; // 1 // 2. Correct the color inheritance from `fieldset` elements in IE.
padding: 0; legend {
margin-bottom: .5rem; display: block;
font-size: 1.5rem; width: 100%;
line-height: inherit; max-width: 100%; // 1
color: inherit; // 2 padding: 0;
white-space: normal; // 1 margin-bottom: .5rem;
} @include font-size(1.5rem);
line-height: inherit;
progress { color: inherit; // 2
vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera. white-space: normal; // 1
} }
// Correct the cursor style of increment and decrement buttons in Chrome. progress {
[type="number"]::-webkit-inner-spin-button, vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.
[type="number"]::-webkit-outer-spin-button { }
height: auto;
} // Correct the cursor style of increment and decrement buttons in Chrome.
[type="number"]::-webkit-inner-spin-button,
[type="search"] { [type="number"]::-webkit-outer-spin-button {
// This overrides the extra rounded corners on search inputs in iOS so that our height: auto;
// `.form-control` class can properly style them. Note that this cannot simply }
// be added to `.form-control` as it's not specific enough. For details, see
// https://github.com/twbs/bootstrap/issues/11586. [type="search"] {
outline-offset: -2px; // 2. Correct the outline style in Safari. // This overrides the extra rounded corners on search inputs in iOS so that our
-webkit-appearance: none; // `.form-control` class can properly style them. Note that this cannot simply
} // be added to `.form-control` as it's not specific enough. For details, see
// https://github.com/twbs/bootstrap/issues/11586.
// outline-offset: -2px; // 2. Correct the outline style in Safari.
// Remove the inner padding and cancel buttons in Chrome and Safari on macOS. -webkit-appearance: none;
// }
[type="search"]::-webkit-search-cancel-button, //
[type="search"]::-webkit-search-decoration { // Remove the inner padding in Chrome and Safari on macOS.
-webkit-appearance: none; //
}
[type="search"]::-webkit-search-decoration {
// -webkit-appearance: none;
// 1. Correct the inability to style clickable types in iOS and Safari. }
// 2. Change font properties to `inherit` in Safari.
// //
// 1. Correct the inability to style clickable types in iOS and Safari.
::-webkit-file-upload-button { // 2. Change font properties to `inherit` in Safari.
font: inherit; // 2 //
-webkit-appearance: button; // 1
} ::-webkit-file-upload-button {
font: inherit; // 2
// -webkit-appearance: button; // 1
// Correct element displays }
//
//
output { // Correct element displays
display: inline-block; //
}
output {
summary { display: inline-block;
display: list-item; // Add the correct display in all browsers }
cursor: pointer;
} summary {
display: list-item; // Add the correct display in all browsers
template { cursor: pointer;
display: none; // Add the correct display in IE }
}
template {
// Always hide an element with the `hidden` HTML attribute (from PureCSS). display: none; // Add the correct display in IE
// Needed for proper display in IE 10-. }
[hidden] {
display: none !important; // Always hide an element with the `hidden` HTML attribute (from PureCSS).
} // Needed for proper display in IE 10-.
[hidden] {
display: none !important;
}
+19 -19
View File
@@ -1,19 +1,19 @@
:root { :root {
// Custom variable values only support SassScript inside `#{}`. // Custom variable values only support SassScript inside `#{}`.
@each $color, $value in $colors { @each $color, $value in $colors {
--#{$color}: #{$value}; --#{$color}: #{$value};
} }
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
--#{$color}: #{$value}; --#{$color}: #{$value};
} }
@each $bp, $value in $grid-breakpoints { @each $bp, $value in $grid-breakpoints {
--breakpoint-#{$bp}: #{$value}; --breakpoint-#{$bp}: #{$value};
} }
// Use `inspect` for lists so that quoted items keep the quotes. // Use `inspect` for lists so that quoted items keep the quotes.
// See https://github.com/sass/sass/issues/2383#issuecomment-336349172 // See https://github.com/sass/sass/issues/2383#issuecomment-336349172
--font-family-sans-serif: #{inspect($font-family-sans-serif)}; --font-family-sans-serif: #{inspect($font-family-sans-serif)};
--font-family-monospace: #{inspect($font-family-monospace)}; --font-family-monospace: #{inspect($font-family-monospace)};
} }
+55
View File
@@ -0,0 +1,55 @@
//
// Rotating border
//
@keyframes spinner-border {
to { transform: rotate(360deg); }
}
.spinner-border {
display: inline-block;
width: $spinner-width;
height: $spinner-height;
vertical-align: text-bottom;
border: $spinner-border-width solid currentColor;
border-right-color: transparent;
// stylelint-disable-next-line property-blacklist
border-radius: 50%;
animation: spinner-border .75s linear infinite;
}
.spinner-border-sm {
width: $spinner-width-sm;
height: $spinner-height-sm;
border-width: $spinner-border-width-sm;
}
//
// Growing circle
//
@keyframes spinner-grow {
0% {
transform: scale(0);
}
50% {
opacity: 1;
}
}
.spinner-grow {
display: inline-block;
width: $spinner-width;
height: $spinner-height;
vertical-align: text-bottom;
background-color: currentColor;
// stylelint-disable-next-line property-blacklist
border-radius: 50%;
opacity: 0;
animation: spinner-grow .75s linear infinite;
}
.spinner-grow-sm {
width: $spinner-width-sm;
height: $spinner-height-sm;
}
+185 -188
View File
@@ -1,188 +1,185 @@
// //
// Basic Bootstrap table // Basic Bootstrap table
// //
.table { .table {
width: 100%; width: 100%;
max-width: 100%; margin-bottom: $spacer;
margin-bottom: $spacer; color: $table-color;
background-color: $table-bg; // Reset for nesting within parents with `background-color`. background-color: $table-bg; // Reset for nesting within parents with `background-color`.
th, th,
td { td {
padding: $table-cell-padding; padding: $table-cell-padding;
vertical-align: top; vertical-align: top;
border-top: $table-border-width solid $table-border-color; border-top: $table-border-width solid $table-border-color;
} }
thead th { thead th {
vertical-align: bottom; vertical-align: bottom;
border-bottom: (2 * $table-border-width) solid $table-border-color; border-bottom: (2 * $table-border-width) solid $table-border-color;
} }
tbody + tbody { tbody + tbody {
border-top: (2 * $table-border-width) solid $table-border-color; border-top: (2 * $table-border-width) solid $table-border-color;
} }
}
.table {
background-color: $body-bg;
} //
} // Condensed table w/ half padding
//
// .table-sm {
// Condensed table w/ half padding th,
// td {
padding: $table-cell-padding-sm;
.table-sm { }
th, }
td {
padding: $table-cell-padding-sm;
} // Border versions
} //
// Add or remove borders all around the table and between all the columns.
// Border versions .table-bordered {
// border: $table-border-width solid $table-border-color;
// Add or remove borders all around the table and between all the columns.
th,
.table-bordered { td {
border: $table-border-width solid $table-border-color; border: $table-border-width solid $table-border-color;
}
th,
td { thead {
border: $table-border-width solid $table-border-color; th,
} td {
border-bottom-width: 2 * $table-border-width;
thead { }
th, }
td { }
border-bottom-width: (2 * $table-border-width);
} .table-borderless {
} th,
} td,
thead th,
.table-borderless { tbody + tbody {
th, border: 0;
td, }
thead th, }
tbody + tbody {
border: 0; // Zebra-striping
} //
} // Default zebra-stripe styles (alternating gray and transparent backgrounds)
// Zebra-striping .table-striped {
// tbody tr:nth-of-type(#{$table-striped-order}) {
// Default zebra-stripe styles (alternating gray and transparent backgrounds) background-color: $table-accent-bg;
}
.table-striped { }
tbody tr:nth-of-type(#{$table-striped-order}) {
background-color: $table-accent-bg;
} // Hover effect
} //
// Placed here since it has to come after the potential zebra striping
// Hover effect .table-hover {
// tbody tr {
// Placed here since it has to come after the potential zebra striping @include hover {
color: $table-hover-color;
.table-hover { background-color: $table-hover-bg;
tbody tr { }
@include hover { }
background-color: $table-hover-bg; }
}
}
} // Table backgrounds
//
// Exact selectors below required to override `.table-striped` and prevent
// Table backgrounds // inheritance to nested tables.
//
// Exact selectors below required to override `.table-striped` and prevent @each $color, $value in $theme-colors {
// inheritance to nested tables. @include table-row-variant($color, theme-color-level($color, $table-bg-level), theme-color-level($color, $table-border-level));
}
@each $color, $value in $theme-colors {
@include table-row-variant($color, theme-color-level($color, -9)); @include table-row-variant(active, $table-active-bg);
}
@include table-row-variant(active, $table-active-bg); // Dark styles
//
// Same table markup, but inverted color scheme: dark background and light text.
// Dark styles
// // stylelint-disable-next-line no-duplicate-selectors
// Same table markup, but inverted color scheme: dark background and light text. .table {
.thead-dark {
// stylelint-disable-next-line no-duplicate-selectors th {
.table { color: $table-dark-color;
.thead-dark { background-color: $table-dark-bg;
th { border-color: $table-dark-border-color;
color: $table-dark-color; }
background-color: $table-dark-bg; }
border-color: $table-dark-border-color;
} .thead-light {
} th {
color: $table-head-color;
.thead-light { background-color: $table-head-bg;
th { border-color: $table-border-color;
color: $table-head-color; }
background-color: $table-head-bg; }
border-color: $table-border-color; }
}
} .table-dark {
} color: $table-dark-color;
background-color: $table-dark-bg;
.table-dark {
color: $table-dark-color; th,
background-color: $table-dark-bg; td,
thead th {
th, border-color: $table-dark-border-color;
td, }
thead th {
border-color: $table-dark-border-color; &.table-bordered {
} border: 0;
}
&.table-bordered {
border: 0; &.table-striped {
} tbody tr:nth-of-type(odd) {
background-color: $table-dark-accent-bg;
&.table-striped { }
tbody tr:nth-of-type(odd) { }
background-color: $table-dark-accent-bg;
} &.table-hover {
} tbody tr {
@include hover {
&.table-hover { color: $table-dark-hover-color;
tbody tr { background-color: $table-dark-hover-bg;
@include hover { }
background-color: $table-dark-hover-bg; }
} }
} }
}
}
// Responsive tables
//
// Responsive tables // Generate series of `.table-responsive-*` classes for configuring the screen
// // size of where your table will overflow.
// Generate series of `.table-responsive-*` classes for configuring the screen
// size of where your table will overflow. .table-responsive {
@each $breakpoint in map-keys($grid-breakpoints) {
.table-responsive { $next: breakpoint-next($breakpoint, $grid-breakpoints);
@each $breakpoint in map-keys($grid-breakpoints) { $infix: breakpoint-infix($next, $grid-breakpoints);
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints); &#{$infix} {
@include media-breakpoint-down($breakpoint) {
&#{$infix} { display: block;
@include media-breakpoint-down($breakpoint) { width: 100%;
display: block; overflow-x: auto;
width: 100%; -webkit-overflow-scrolling: touch;
overflow-x: auto;
-webkit-overflow-scrolling: touch; // Prevent double border on horizontal scroll due to use of `display: block;`
-ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 > .table-bordered {
border: 0;
// Prevent double border on horizontal scroll due to use of `display: block;` }
> .table-bordered { }
border: 0; }
} }
} }
}
}
}
+44
View File
@@ -0,0 +1,44 @@
.toast {
max-width: $toast-max-width;
overflow: hidden; // cheap rounded corners on nested items
@include font-size($toast-font-size);
color: $toast-color;
background-color: $toast-background-color;
background-clip: padding-box;
border: $toast-border-width solid $toast-border-color;
box-shadow: $toast-box-shadow;
backdrop-filter: blur(10px);
opacity: 0;
@include border-radius($toast-border-radius);
&:not(:last-child) {
margin-bottom: $toast-padding-x;
}
&.showing {
opacity: 1;
}
&.show {
display: block;
opacity: 1;
}
&.hide {
display: none;
}
}
.toast-header {
display: flex;
align-items: center;
padding: $toast-padding-y $toast-padding-x;
color: $toast-header-color;
background-color: $toast-header-background-color;
background-clip: padding-box;
border-bottom: $toast-border-width solid $toast-header-border-color;
}
.toast-body {
padding: $toast-padding-x; // apply to both vertical and horizontal
}
+115 -115
View File
@@ -1,115 +1,115 @@
// Base class // Base class
.tooltip { .tooltip {
position: absolute; position: absolute;
z-index: $zindex-tooltip; z-index: $zindex-tooltip;
display: block; display: block;
margin: $tooltip-margin; margin: $tooltip-margin;
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. // 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. // So reset our font and text properties to avoid inheriting weird values.
@include reset-text(); @include reset-text();
font-size: $tooltip-font-size; @include font-size($tooltip-font-size);
// Allow breaking very long words so they don't overflow the tooltip's bounds // Allow breaking very long words so they don't overflow the tooltip's bounds
word-wrap: break-word; word-wrap: break-word;
opacity: 0; opacity: 0;
&.show { opacity: $tooltip-opacity; } &.show { opacity: $tooltip-opacity; }
.arrow { .arrow {
position: absolute; position: absolute;
display: block; display: block;
width: $tooltip-arrow-width; width: $tooltip-arrow-width;
height: $tooltip-arrow-height; height: $tooltip-arrow-height;
&::before { &::before {
position: absolute; position: absolute;
content: ""; content: "";
border-color: transparent; border-color: transparent;
border-style: solid; border-style: solid;
} }
} }
} }
.bs-tooltip-top { .bs-tooltip-top {
padding: $tooltip-arrow-height 0; padding: $tooltip-arrow-height 0;
.arrow { .arrow {
bottom: 0; bottom: 0;
&::before { &::before {
top: 0; top: 0;
border-width: $tooltip-arrow-height ($tooltip-arrow-width / 2) 0; border-width: $tooltip-arrow-height ($tooltip-arrow-width / 2) 0;
border-top-color: $tooltip-arrow-color; border-top-color: $tooltip-arrow-color;
} }
} }
} }
.bs-tooltip-right { .bs-tooltip-right {
padding: 0 $tooltip-arrow-height; padding: 0 $tooltip-arrow-height;
.arrow { .arrow {
left: 0; left: 0;
width: $tooltip-arrow-height; width: $tooltip-arrow-height;
height: $tooltip-arrow-width; height: $tooltip-arrow-width;
&::before { &::before {
right: 0; right: 0;
border-width: ($tooltip-arrow-width / 2) $tooltip-arrow-height ($tooltip-arrow-width / 2) 0; border-width: ($tooltip-arrow-width / 2) $tooltip-arrow-height ($tooltip-arrow-width / 2) 0;
border-right-color: $tooltip-arrow-color; border-right-color: $tooltip-arrow-color;
} }
} }
} }
.bs-tooltip-bottom { .bs-tooltip-bottom {
padding: $tooltip-arrow-height 0; padding: $tooltip-arrow-height 0;
.arrow { .arrow {
top: 0; top: 0;
&::before { &::before {
bottom: 0; bottom: 0;
border-width: 0 ($tooltip-arrow-width / 2) $tooltip-arrow-height; border-width: 0 ($tooltip-arrow-width / 2) $tooltip-arrow-height;
border-bottom-color: $tooltip-arrow-color; border-bottom-color: $tooltip-arrow-color;
} }
} }
} }
.bs-tooltip-left { .bs-tooltip-left {
padding: 0 $tooltip-arrow-height; padding: 0 $tooltip-arrow-height;
.arrow { .arrow {
right: 0; right: 0;
width: $tooltip-arrow-height; width: $tooltip-arrow-height;
height: $tooltip-arrow-width; height: $tooltip-arrow-width;
&::before { &::before {
left: 0; left: 0;
border-width: ($tooltip-arrow-width / 2) 0 ($tooltip-arrow-width / 2) $tooltip-arrow-height; border-width: ($tooltip-arrow-width / 2) 0 ($tooltip-arrow-width / 2) $tooltip-arrow-height;
border-left-color: $tooltip-arrow-color; border-left-color: $tooltip-arrow-color;
} }
} }
} }
.bs-tooltip-auto { .bs-tooltip-auto {
&[x-placement^="top"] { &[x-placement^="top"] {
@extend .bs-tooltip-top; @extend .bs-tooltip-top;
} }
&[x-placement^="right"] { &[x-placement^="right"] {
@extend .bs-tooltip-right; @extend .bs-tooltip-right;
} }
&[x-placement^="bottom"] { &[x-placement^="bottom"] {
@extend .bs-tooltip-bottom; @extend .bs-tooltip-bottom;
} }
&[x-placement^="left"] { &[x-placement^="left"] {
@extend .bs-tooltip-left; @extend .bs-tooltip-left;
} }
} }
// Wrapper for the tooltip content // Wrapper for the tooltip content
.tooltip-inner { .tooltip-inner {
max-width: $tooltip-max-width; max-width: $tooltip-max-width;
padding: $tooltip-padding-y $tooltip-padding-x; padding: $tooltip-padding-y $tooltip-padding-x;
color: $tooltip-color; color: $tooltip-color;
text-align: center; text-align: center;
background-color: $tooltip-bg; background-color: $tooltip-bg;
@include border-radius($tooltip-border-radius); @include border-radius($tooltip-border-radius);
} }
+20 -22
View File
@@ -1,22 +1,20 @@
// stylelint-disable selector-no-qualifying-type .fade {
@include transition($transition-fade);
.fade {
@include transition($transition-fade); &:not(.show) {
opacity: 0;
&:not(.show) { }
opacity: 0; }
}
} .collapse {
&:not(.show) {
.collapse { display: none;
&:not(.show) { }
display: none; }
}
} .collapsing {
position: relative;
.collapsing { height: 0;
position: relative; overflow: hidden;
height: 0; @include transition($transition-collapse);
overflow: hidden; }
@include transition($transition-collapse);
}
+125 -125
View File
@@ -1,125 +1,125 @@
// stylelint-disable declaration-no-important, selector-list-comma-newline-after // stylelint-disable declaration-no-important, selector-list-comma-newline-after
// //
// Headings // Headings
// //
h1, h2, h3, h4, h5, h6, h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 { .h1, .h2, .h3, .h4, .h5, .h6 {
margin-bottom: $headings-margin-bottom; margin-bottom: $headings-margin-bottom;
font-family: $headings-font-family; font-family: $headings-font-family;
font-weight: $headings-font-weight; font-weight: $headings-font-weight;
line-height: $headings-line-height; line-height: $headings-line-height;
color: $headings-color; color: $headings-color;
} }
h1, .h1 { font-size: $h1-font-size; } h1, .h1 { @include font-size($h1-font-size); }
h2, .h2 { font-size: $h2-font-size; } h2, .h2 { @include font-size($h2-font-size); }
h3, .h3 { font-size: $h3-font-size; } h3, .h3 { @include font-size($h3-font-size); }
h4, .h4 { font-size: $h4-font-size; } h4, .h4 { @include font-size($h4-font-size); }
h5, .h5 { font-size: $h5-font-size; } h5, .h5 { @include font-size($h5-font-size); }
h6, .h6 { font-size: $h6-font-size; } h6, .h6 { @include font-size($h6-font-size); }
.lead { .lead {
font-size: $lead-font-size; @include font-size($lead-font-size);
font-weight: $lead-font-weight; font-weight: $lead-font-weight;
} }
// Type display classes // Type display classes
.display-1 { .display-1 {
font-size: $display1-size; @include font-size($display1-size);
font-weight: $display1-weight; font-weight: $display1-weight;
line-height: $display-line-height; line-height: $display-line-height;
} }
.display-2 { .display-2 {
font-size: $display2-size; @include font-size($display2-size);
font-weight: $display2-weight; font-weight: $display2-weight;
line-height: $display-line-height; line-height: $display-line-height;
} }
.display-3 { .display-3 {
font-size: $display3-size; @include font-size($display3-size);
font-weight: $display3-weight; font-weight: $display3-weight;
line-height: $display-line-height; line-height: $display-line-height;
} }
.display-4 { .display-4 {
font-size: $display4-size; @include font-size($display4-size);
font-weight: $display4-weight; font-weight: $display4-weight;
line-height: $display-line-height; line-height: $display-line-height;
} }
// //
// Horizontal rules // Horizontal rules
// //
hr { hr {
margin-top: $hr-margin-y; margin-top: $hr-margin-y;
margin-bottom: $hr-margin-y; margin-bottom: $hr-margin-y;
border: 0; border: 0;
border-top: $hr-border-width solid $hr-border-color; border-top: $hr-border-width solid $hr-border-color;
} }
// //
// Emphasis // Emphasis
// //
small, small,
.small { .small {
font-size: $small-font-size; @include font-size($small-font-size);
font-weight: $font-weight-normal; font-weight: $font-weight-normal;
} }
mark, mark,
.mark { .mark {
padding: $mark-padding; padding: $mark-padding;
background-color: $mark-bg; background-color: $mark-bg;
} }
// //
// Lists // Lists
// //
.list-unstyled { .list-unstyled {
@include list-unstyled; @include list-unstyled;
} }
// Inline turns list items into inline-block // Inline turns list items into inline-block
.list-inline { .list-inline {
@include list-unstyled; @include list-unstyled;
} }
.list-inline-item { .list-inline-item {
display: inline-block; display: inline-block;
&:not(:last-child) { &:not(:last-child) {
margin-right: $list-inline-padding; margin-right: $list-inline-padding;
} }
} }
// //
// Misc // Misc
// //
// Builds on `abbr` // Builds on `abbr`
.initialism { .initialism {
font-size: 90%; @include font-size(90%);
text-transform: uppercase; text-transform: uppercase;
} }
// Blockquotes // Blockquotes
.blockquote { .blockquote {
margin-bottom: $spacer; margin-bottom: $spacer;
font-size: $blockquote-font-size; @include font-size($blockquote-font-size);
} }
.blockquote-footer { .blockquote-footer {
display: block; display: block;
font-size: 80%; // back to default font-size @include font-size($blockquote-small-font-size);
color: $blockquote-small-color; color: $blockquote-small-color;
&::before { &::before {
content: "\2014 \00A0"; // em dash, nbsp content: "\2014\00A0"; // em dash, nbsp
} }
} }
+17 -15
View File
@@ -1,15 +1,17 @@
@import "utilities/align"; @import "utilities/align";
@import "utilities/background"; @import "utilities/background";
@import "utilities/borders"; @import "utilities/borders";
@import "utilities/clearfix"; @import "utilities/clearfix";
@import "utilities/display"; @import "utilities/display";
@import "utilities/embed"; @import "utilities/embed";
@import "utilities/flex"; @import "utilities/flex";
@import "utilities/float"; @import "utilities/float";
@import "utilities/position"; @import "utilities/overflow";
@import "utilities/screenreaders"; @import "utilities/position";
@import "utilities/shadows"; @import "utilities/screenreaders";
@import "utilities/sizing"; @import "utilities/shadows";
@import "utilities/spacing"; @import "utilities/sizing";
@import "utilities/text"; @import "utilities/stretched-link";
@import "utilities/visibility"; @import "utilities/spacing";
@import "utilities/text";
@import "utilities/visibility";
File diff suppressed because it is too large Load Diff
+29 -32
View File
@@ -1,32 +1,29 @@
/*! /*!
* Bootstrap Grid v4.1.1 (https://getbootstrap.com/) * Bootstrap Grid v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2018 The Bootstrap Authors * Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc. * Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/ */
@at-root { html {
@-ms-viewport { width: device-width; } // stylelint-disable-line at-rule-no-vendor-prefix box-sizing: border-box;
} -ms-overflow-style: scrollbar;
}
html {
box-sizing: border-box; *,
-ms-overflow-style: scrollbar; *::before,
} *::after {
box-sizing: inherit;
*, }
*::before,
*::after { @import "functions";
box-sizing: inherit; @import "variables";
}
@import "mixins/breakpoints";
@import "functions"; @import "mixins/grid-framework";
@import "variables"; @import "mixins/grid";
@import "mixins/breakpoints"; @import "grid";
@import "mixins/grid-framework"; @import "utilities/display";
@import "mixins/grid"; @import "utilities/flex";
@import "utilities/spacing";
@import "grid";
@import "utilities/display";
@import "utilities/flex";
+12 -12
View File
@@ -1,12 +1,12 @@
/*! /*!
* Bootstrap Reboot v4.1.1 (https://getbootstrap.com/) * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2018 The Bootstrap Authors * Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc. * Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/ */
@import "functions"; @import "functions";
@import "variables"; @import "variables";
@import "mixins"; @import "mixins";
@import "reboot"; @import "reboot";
+44 -42
View File
@@ -1,42 +1,44 @@
/*! /*!
* Bootstrap v4.1.1 (https://getbootstrap.com/) * Bootstrap v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2018 The Bootstrap Authors * Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc. * Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/ */
@import "functions"; @import "functions";
@import "variables"; @import "variables";
@import "mixins"; @import "mixins";
@import "root"; @import "root";
@import "reboot"; @import "reboot";
@import "type"; @import "type";
@import "images"; @import "images";
@import "code"; @import "code";
@import "grid"; @import "grid";
@import "tables"; @import "tables";
@import "forms"; @import "forms";
@import "buttons"; @import "buttons";
@import "transitions"; @import "transitions";
@import "dropdown"; @import "dropdown";
@import "button-group"; @import "button-group";
@import "input-group"; @import "input-group";
@import "custom-forms"; @import "custom-forms";
@import "nav"; @import "nav";
@import "navbar"; @import "navbar";
@import "card"; @import "card";
@import "breadcrumb"; @import "breadcrumb";
@import "pagination"; @import "pagination";
@import "badge"; @import "badge";
@import "jumbotron"; @import "jumbotron";
@import "alert"; @import "alert";
@import "progress"; @import "progress";
@import "media"; @import "media";
@import "list-group"; @import "list-group";
@import "close"; @import "close";
@import "modal"; @import "toasts";
@import "tooltip"; @import "modal";
@import "popover"; @import "tooltip";
@import "carousel"; @import "popover";
@import "utilities"; @import "carousel";
@import "print"; @import "spinners";
@import "utilities";
@import "print";
+13 -13
View File
@@ -1,13 +1,13 @@
@mixin alert-variant($background, $border, $color) { @mixin alert-variant($background, $border, $color) {
color: $color; color: $color;
@include gradient-bg($background); @include gradient-bg($background);
border-color: $border; border-color: $border;
hr { hr {
border-top-color: darken($border, 5%); border-top-color: darken($border, 5%);
} }
.alert-link { .alert-link {
color: darken($color, 10%); color: darken($color, 10%);
} }
} }
+21 -21
View File
@@ -1,21 +1,21 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Contextual backgrounds // Contextual backgrounds
@mixin bg-variant($parent, $color) { @mixin bg-variant($parent, $color) {
#{$parent} { #{$parent} {
background-color: $color !important; background-color: $color !important;
} }
a#{$parent}, a#{$parent},
button#{$parent} { button#{$parent} {
@include hover-focus { @include hover-focus {
background-color: darken($color, 10%) !important; background-color: darken($color, 10%) !important;
} }
} }
} }
@mixin bg-gradient-variant($parent, $color) { @mixin bg-gradient-variant($parent, $color) {
#{$parent} { #{$parent} {
background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important; background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important;
} }
} }
+17 -12
View File
@@ -1,12 +1,17 @@
@mixin badge-variant($bg) { @mixin badge-variant($bg) {
color: color-yiq($bg); color: color-yiq($bg);
background-color: $bg; background-color: $bg;
&[href] { @at-root a#{&} {
@include hover-focus { @include hover-focus {
color: color-yiq($bg); color: color-yiq($bg);
text-decoration: none; background-color: darken($bg, 10%);
background-color: darken($bg, 10%); }
}
} &:focus,
} &.focus {
outline: 0;
box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5);
}
}
}
+63 -35
View File
@@ -1,35 +1,63 @@
// Single side border-radius // stylelint-disable property-blacklist
// Single side border-radius
@mixin border-radius($radius: $border-radius) {
@if $enable-rounded { @mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
border-radius: $radius; @if $enable-rounded {
} border-radius: $radius;
} }
@else if $fallback-border-radius != false {
@mixin border-top-radius($radius) { border-radius: $fallback-border-radius;
@if $enable-rounded { }
border-top-left-radius: $radius; }
border-top-right-radius: $radius;
} @mixin border-top-radius($radius) {
} @if $enable-rounded {
border-top-left-radius: $radius;
@mixin border-right-radius($radius) { border-top-right-radius: $radius;
@if $enable-rounded { }
border-top-right-radius: $radius; }
border-bottom-right-radius: $radius;
} @mixin border-right-radius($radius) {
} @if $enable-rounded {
border-top-right-radius: $radius;
@mixin border-bottom-radius($radius) { border-bottom-right-radius: $radius;
@if $enable-rounded { }
border-bottom-right-radius: $radius; }
border-bottom-left-radius: $radius;
} @mixin border-bottom-radius($radius) {
} @if $enable-rounded {
border-bottom-right-radius: $radius;
@mixin border-left-radius($radius) { border-bottom-left-radius: $radius;
@if $enable-rounded { }
border-top-left-radius: $radius; }
border-bottom-left-radius: $radius;
} @mixin border-left-radius($radius) {
} @if $enable-rounded {
border-top-left-radius: $radius;
border-bottom-left-radius: $radius;
}
}
@mixin border-top-left-radius($radius) {
@if $enable-rounded {
border-top-left-radius: $radius;
}
}
@mixin border-top-right-radius($radius) {
@if $enable-rounded {
border-top-right-radius: $radius;
}
}
@mixin border-bottom-right-radius($radius) {
@if $enable-rounded {
border-bottom-right-radius: $radius;
}
}
@mixin border-bottom-left-radius($radius) {
@if $enable-rounded {
border-bottom-left-radius: $radius;
}
}
+20 -5
View File
@@ -1,5 +1,20 @@
@mixin box-shadow($shadow...) { @mixin box-shadow($shadow...) {
@if $enable-shadows { @if $enable-shadows {
box-shadow: $shadow; $result: ();
}
} @if (length($shadow) == 1) {
// We can pass `@include box-shadow(none);`
$result: $shadow;
} @else {
// Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;`
@for $i from 1 through length($shadow) {
@if nth($shadow, $i) != "none" {
$result: append($result, nth($shadow, $i), "comma");
}
}
}
@if (length($result) > 0) {
box-shadow: $result;
}
}
}
+123 -123
View File
@@ -1,123 +1,123 @@
// Breakpoint viewport sizes and media queries. // Breakpoint viewport sizes and media queries.
// //
// Breakpoints are defined as a map of (name: minimum width), order from small to large: // Breakpoints are defined as a map of (name: minimum width), order from small to large:
// //
// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px) // (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
// //
// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default. // The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
// Name of the next breakpoint, or null for the last breakpoint. // Name of the next breakpoint, or null for the last breakpoint.
// //
// >> breakpoint-next(sm) // >> breakpoint-next(sm)
// md // md
// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// md // md
// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl)) // >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))
// md // md
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
$n: index($breakpoint-names, $name); $n: index($breakpoint-names, $name);
@return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null); @return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
} }
// Minimum breakpoint width. Null for the smallest (first) breakpoint. // Minimum breakpoint width. Null for the smallest (first) breakpoint.
// //
// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// 576px // 576px
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) { @function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
$min: map-get($breakpoints, $name); $min: map-get($breakpoints, $name);
@return if($min != 0, $min, null); @return if($min != 0, $min, null);
} }
// Maximum breakpoint width. Null for the largest (last) breakpoint. // Maximum breakpoint width. Null for the largest (last) breakpoint.
// The maximum value is calculated as the minimum of the next one less 0.02px // The maximum value is calculated as the minimum of the next one less 0.02px
// to work around the limitations of `min-` and `max-` prefixes and viewports with fractional widths. // 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 // See https://www.w3.org/TR/mediaqueries-4/#mq-min-max
// Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari. // Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.
// See https://bugs.webkit.org/show_bug.cgi?id=178261 // See https://bugs.webkit.org/show_bug.cgi?id=178261
// //
// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// 767.98px // 767.98px
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) { @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
$next: breakpoint-next($name, $breakpoints); $next: breakpoint-next($name, $breakpoints);
@return if($next, breakpoint-min($next, $breakpoints) - .02px, null); @return if($next, breakpoint-min($next, $breakpoints) - .02, null);
} }
// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront. // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
// Useful for making responsive utilities. // Useful for making responsive utilities.
// //
// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// "" (Returns a blank string) // "" (Returns a blank string)
// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// "-sm" // "-sm"
@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) { @function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
@return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}"); @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
} }
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint. // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
// Makes the @content apply to the given breakpoint and wider. // Makes the @content apply to the given breakpoint and wider.
@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) { @mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
$min: breakpoint-min($name, $breakpoints); $min: breakpoint-min($name, $breakpoints);
@if $min { @if $min {
@media (min-width: $min) { @media (min-width: $min) {
@content; @content;
} }
} @else { } @else {
@content; @content;
} }
} }
// Media of at most the maximum breakpoint width. No query for the largest breakpoint. // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
// Makes the @content apply to the given breakpoint and narrower. // Makes the @content apply to the given breakpoint and narrower.
@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) { @mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
$max: breakpoint-max($name, $breakpoints); $max: breakpoint-max($name, $breakpoints);
@if $max { @if $max {
@media (max-width: $max) { @media (max-width: $max) {
@content; @content;
} }
} @else { } @else {
@content; @content;
} }
} }
// Media that spans multiple breakpoint widths. // Media that spans multiple breakpoint widths.
// Makes the @content apply between the min and max breakpoints // Makes the @content apply between the min and max breakpoints
@mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) { @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
$min: breakpoint-min($lower, $breakpoints); $min: breakpoint-min($lower, $breakpoints);
$max: breakpoint-max($upper, $breakpoints); $max: breakpoint-max($upper, $breakpoints);
@if $min != null and $max != null { @if $min != null and $max != null {
@media (min-width: $min) and (max-width: $max) { @media (min-width: $min) and (max-width: $max) {
@content; @content;
} }
} @else if $max == null { } @else if $max == null {
@include media-breakpoint-up($lower, $breakpoints) { @include media-breakpoint-up($lower, $breakpoints) {
@content; @content;
} }
} @else if $min == null { } @else if $min == null {
@include media-breakpoint-down($upper, $breakpoints) { @include media-breakpoint-down($upper, $breakpoints) {
@content; @content;
} }
} }
} }
// Media between the breakpoint's minimum and maximum widths. // Media between the breakpoint's minimum and maximum widths.
// No minimum for the smallest breakpoint, and no maximum for the largest one. // No minimum for the smallest breakpoint, and no maximum for the largest one.
// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower. // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) { @mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
$min: breakpoint-min($name, $breakpoints); $min: breakpoint-min($name, $breakpoints);
$max: breakpoint-max($name, $breakpoints); $max: breakpoint-max($name, $breakpoints);
@if $min != null and $max != null { @if $min != null and $max != null {
@media (min-width: $min) and (max-width: $max) { @media (min-width: $min) and (max-width: $max) {
@content; @content;
} }
} @else if $max == null { } @else if $max == null {
@include media-breakpoint-up($name, $breakpoints) { @include media-breakpoint-up($name, $breakpoints) {
@content; @content;
} }
} @else if $min == null { } @else if $min == null {
@include media-breakpoint-down($name, $breakpoints) { @include media-breakpoint-down($name, $breakpoints) {
@content; @content;
} }
} }
} }
+107 -109
View File
@@ -1,109 +1,107 @@
// Button variants // Button variants
// //
// Easily pump out default styles, as well as :hover, :focus, :active, // Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons // and disabled options for all buttons
@mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) { @mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
color: color-yiq($background); color: color-yiq($background);
@include gradient-bg($background); @include gradient-bg($background);
border-color: $border; border-color: $border;
@include box-shadow($btn-box-shadow); @include box-shadow($btn-box-shadow);
@include hover { @include hover {
color: color-yiq($hover-background); color: color-yiq($hover-background);
@include gradient-bg($hover-background); @include gradient-bg($hover-background);
border-color: $hover-border; border-color: $hover-border;
} }
&:focus, &:focus,
&.focus { &.focus {
// Avoid using mixin so we can pass custom focus shadow properly // Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows { @if $enable-shadows {
box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5); box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
} @else { } @else {
box-shadow: 0 0 0 $btn-focus-width rgba($border, .5); box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
} }
} }
// Disabled comes first so active can properly restyle // Disabled comes first so active can properly restyle
&.disabled, &.disabled,
&:disabled { &:disabled {
color: color-yiq($background); color: color-yiq($background);
background-color: $background; background-color: $background;
border-color: $border; border-color: $border;
} // Remove CSS gradients if they're enabled
@if $enable-gradients {
&:not(:disabled):not(.disabled):active, background-image: none;
&:not(:disabled):not(.disabled).active, }
.show > &.dropdown-toggle { }
color: color-yiq($active-background);
background-color: $active-background; &:not(:disabled):not(.disabled):active,
@if $enable-gradients { &:not(:disabled):not(.disabled).active,
background-image: none; // Remove the gradient for the pressed/active state .show > &.dropdown-toggle {
} color: color-yiq($active-background);
border-color: $active-border; background-color: $active-background;
@if $enable-gradients {
&:focus { background-image: none; // Remove the gradient for the pressed/active state
// Avoid using mixin so we can pass custom focus shadow properly }
@if $enable-shadows { border-color: $active-border;
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
} @else { &:focus {
box-shadow: 0 0 0 $btn-focus-width rgba($border, .5); // Avoid using mixin so we can pass custom focus shadow properly
} @if $enable-shadows and $btn-active-box-shadow != none {
} box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
} } @else {
} box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
}
@mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) { }
color: $color; }
background-color: transparent; }
background-image: none;
border-color: $color; @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
color: $color;
&:hover { border-color: $color;
color: $color-hover;
background-color: $active-background; @include hover {
border-color: $active-border; color: $color-hover;
} background-color: $active-background;
border-color: $active-border;
&:focus, }
&.focus {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5); &:focus,
} &.focus {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
&.disabled, }
&:disabled {
color: $color; &.disabled,
background-color: transparent; &:disabled {
} color: $color;
background-color: transparent;
&:not(:disabled):not(.disabled):active, }
&:not(:disabled):not(.disabled).active,
.show > &.dropdown-toggle { &:not(:disabled):not(.disabled):active,
color: color-yiq($active-background); &:not(:disabled):not(.disabled).active,
background-color: $active-background; .show > &.dropdown-toggle {
border-color: $active-border; color: color-yiq($active-background);
background-color: $active-background;
&:focus { border-color: $active-border;
// Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows and $btn-active-box-shadow != none { &:focus {
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5); // Avoid using mixin so we can pass custom focus shadow properly
} @else { @if $enable-shadows and $btn-active-box-shadow != none {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5); box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
} } @else {
} box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
} }
} }
}
// Button sizes }
@mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
padding: $padding-y $padding-x; // Button sizes
font-size: $font-size; @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
line-height: $line-height; padding: $padding-y $padding-x;
// Manually declare to provide an override to the browser default @include font-size($font-size);
@if $enable-rounded { line-height: $line-height;
border-radius: $border-radius; // Manually declare to provide an override to the browser default
} @else { @include border-radius($border-radius, 0);
border-radius: 0; }
}
}
+62 -66
View File
@@ -1,66 +1,62 @@
@mixin caret-down { @mixin caret-down {
border-top: $caret-width solid; border-top: $caret-width solid;
border-right: $caret-width solid transparent; border-right: $caret-width solid transparent;
border-bottom: 0; border-bottom: 0;
border-left: $caret-width solid transparent; border-left: $caret-width solid transparent;
} }
@mixin caret-up { @mixin caret-up {
border-top: 0; border-top: 0;
border-right: $caret-width solid transparent; border-right: $caret-width solid transparent;
border-bottom: $caret-width solid; border-bottom: $caret-width solid;
border-left: $caret-width solid transparent; border-left: $caret-width solid transparent;
} }
@mixin caret-right { @mixin caret-right {
border-top: $caret-width solid transparent; border-top: $caret-width solid transparent;
border-right: 0; border-right: 0;
border-bottom: $caret-width solid transparent; border-bottom: $caret-width solid transparent;
border-left: $caret-width solid; border-left: $caret-width solid;
} }
@mixin caret-left { @mixin caret-left {
border-top: $caret-width solid transparent; border-top: $caret-width solid transparent;
border-right: $caret-width solid; border-right: $caret-width solid;
border-bottom: $caret-width solid transparent; border-bottom: $caret-width solid transparent;
} }
@mixin caret($direction: down) { @mixin caret($direction: down) {
@if $enable-caret { @if $enable-caret {
&::after { &::after {
display: inline-block; display: inline-block;
width: 0; margin-left: $caret-spacing;
height: 0; vertical-align: $caret-vertical-align;
margin-left: $caret-width * .85; content: "";
vertical-align: $caret-width * .85; @if $direction == down {
content: ""; @include caret-down;
@if $direction == down { } @else if $direction == up {
@include caret-down; @include caret-up;
} @else if $direction == up { } @else if $direction == right {
@include caret-up; @include caret-right;
} @else if $direction == right { }
@include caret-right; }
}
} @if $direction == left {
&::after {
@if $direction == left { display: none;
&::after { }
display: none;
} &::before {
display: inline-block;
&::before { margin-right: $caret-spacing;
display: inline-block; vertical-align: $caret-vertical-align;
width: 0; content: "";
height: 0; @include caret-left;
margin-right: $caret-width * .85; }
vertical-align: $caret-width * .85; }
content: "";
@include caret-left; &:empty::after {
} margin-left: 0;
} }
}
&:empty::after { }
margin-left: 0;
}
}
}
+7 -7
View File
@@ -1,7 +1,7 @@
@mixin clearfix() { @mixin clearfix() {
&::after { &::after {
display: block; display: block;
clear: both; clear: both;
content: ""; content: "";
} }
} }
+10
View File
@@ -0,0 +1,10 @@
// Deprecate mixin
//
// This mixin can be used to deprecate mixins or functions.
// `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to
// some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap)
@mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning: false) {
@if ($enable-deprecation-messages != false and $ignore-warning != true) {
@warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}.";
}
}
+14 -11
View File
@@ -1,11 +1,14 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
@mixin float-left { @mixin float-left {
float: left !important; float: left !important;
} @include deprecate("The `float-left` mixin", "v4.3.0", "v5");
@mixin float-right { }
float: right !important; @mixin float-right {
} float: right !important;
@mixin float-none { @include deprecate("The `float-right` mixin", "v4.3.0", "v5");
float: none !important; }
} @mixin float-none {
float: none !important;
@include deprecate("The `float-none` mixin", "v4.3.0", "v5");
}
+192 -147
View File
@@ -1,147 +1,192 @@
// Form control focus state // Form control focus state
// //
// Generate a customized focus state and for any input with the specified color, // Generate a customized focus state and for any input with the specified color,
// which defaults to the `$input-focus-border-color` variable. // which defaults to the `$input-focus-border-color` variable.
// //
// We highly encourage you to not customize the default value, but instead use // 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 // this to tweak colors on an as-needed basis. This aesthetic change is based on
// WebKit's default styles, but applicable to a wider range of browsers. Its // WebKit's default styles, but applicable to a wider range of browsers. Its
// usability and accessibility should be taken into account with any change. // usability and accessibility should be taken into account with any change.
// //
// Example usage: change the default blue border and shadow to white for better // Example usage: change the default blue border and shadow to white for better
// contrast against a dark gray background. // contrast against a dark gray background.
@mixin form-control-focus() { @mixin form-control-focus() {
&:focus { &:focus {
color: $input-focus-color; color: $input-focus-color;
background-color: $input-focus-bg; background-color: $input-focus-bg;
border-color: $input-focus-border-color; border-color: $input-focus-border-color;
outline: 0; outline: 0;
// Avoid using mixin so we can pass custom focus shadow properly // Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows { @if $enable-shadows {
box-shadow: $input-box-shadow, $input-focus-box-shadow; box-shadow: $input-box-shadow, $input-focus-box-shadow;
} @else { } @else {
box-shadow: $input-focus-box-shadow; box-shadow: $input-focus-box-shadow;
} }
} }
} }
@mixin form-validation-state($state, $color) { @mixin form-validation-state($state, $color, $icon) {
.#{$state}-feedback { .#{$state}-feedback {
display: none; display: none;
width: 100%; width: 100%;
margin-top: $form-feedback-margin-top; margin-top: $form-feedback-margin-top;
font-size: $form-feedback-font-size; @include font-size($form-feedback-font-size);
color: $color; color: $color;
} }
.#{$state}-tooltip { .#{$state}-tooltip {
position: absolute; position: absolute;
top: 100%; top: 100%;
z-index: 5; z-index: 5;
display: none; display: none;
max-width: 100%; // Contain to parent when possible max-width: 100%; // Contain to parent when possible
padding: .5rem; padding: $form-feedback-tooltip-padding-y $form-feedback-tooltip-padding-x;
margin-top: .1rem; margin-top: .1rem;
font-size: .875rem; @include font-size($form-feedback-tooltip-font-size);
line-height: 1; line-height: $form-feedback-tooltip-line-height;
color: $white; color: color-yiq($color);
background-color: rgba($color, .8); background-color: rgba($color, $form-feedback-tooltip-opacity);
border-radius: .2rem; @include border-radius($form-feedback-tooltip-border-radius);
} }
.form-control, .form-control {
.custom-select { .was-validated &:#{$state},
.was-validated &:#{$state}, &.is-#{$state} {
&.is-#{$state} { border-color: $color;
border-color: $color;
@if $enable-validation-icons {
&:focus { padding-right: $input-height-inner;
border-color: $color; background-image: $icon;
box-shadow: 0 0 0 $input-focus-width rgba($color, .25); background-repeat: no-repeat;
} background-position: center right $input-height-inner-quarter;
background-size: $input-height-inner-half $input-height-inner-half;
~ .#{$state}-feedback, }
~ .#{$state}-tooltip {
display: block; &:focus {
} border-color: $color;
} box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
} }
.form-control-file { ~ .#{$state}-feedback,
.was-validated &:#{$state}, ~ .#{$state}-tooltip {
&.is-#{$state} { display: block;
~ .#{$state}-feedback, }
~ .#{$state}-tooltip { }
display: block; }
}
} // stylelint-disable-next-line selector-no-qualifying-type
} textarea.form-control {
.was-validated &:#{$state},
.form-check-input { &.is-#{$state} {
.was-validated &:#{$state}, @if $enable-validation-icons {
&.is-#{$state} { padding-right: $input-height-inner;
~ .form-check-label { background-position: top $input-height-inner-quarter right $input-height-inner-quarter;
color: $color; }
} }
}
~ .#{$state}-feedback,
~ .#{$state}-tooltip { .custom-select {
display: block; .was-validated &:#{$state},
} &.is-#{$state} {
} border-color: $color;
}
@if $enable-validation-icons {
.custom-control-input { padding-right: $custom-select-feedback-icon-padding-right;
.was-validated &:#{$state}, background: $custom-select-background, $icon $custom-select-bg no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size;
&.is-#{$state} { }
~ .custom-control-label {
color: $color; &:focus {
border-color: $color;
&::before { box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
background-color: lighten($color, 25%); }
}
} ~ .#{$state}-feedback,
~ .#{$state}-tooltip {
~ .#{$state}-feedback, display: block;
~ .#{$state}-tooltip { }
display: block; }
} }
&:checked {
~ .custom-control-label::before { .form-control-file {
@include gradient-bg(lighten($color, 10%)); .was-validated &:#{$state},
} &.is-#{$state} {
} ~ .#{$state}-feedback,
~ .#{$state}-tooltip {
&:focus { display: block;
~ .custom-control-label::before { }
box-shadow: 0 0 0 1px $body-bg, 0 0 0 $input-focus-width rgba($color, .25); }
} }
}
} .form-check-input {
} .was-validated &:#{$state},
&.is-#{$state} {
// custom file ~ .form-check-label {
.custom-file-input { color: $color;
.was-validated &:#{$state}, }
&.is-#{$state} {
~ .custom-file-label { ~ .#{$state}-feedback,
border-color: $color; ~ .#{$state}-tooltip {
display: block;
&::before { border-color: inherit; } }
} }
}
~ .#{$state}-feedback,
~ .#{$state}-tooltip { .custom-control-input {
display: block; .was-validated &:#{$state},
} &.is-#{$state} {
~ .custom-control-label {
&:focus { color: $color;
~ .custom-file-label {
box-shadow: 0 0 0 $input-focus-width rgba($color, .25); &::before {
} border-color: $color;
} }
} }
}
} ~ .#{$state}-feedback,
~ .#{$state}-tooltip {
display: block;
}
&:checked {
~ .custom-control-label::before {
border-color: lighten($color, 10%);
@include gradient-bg(lighten($color, 10%));
}
}
&:focus {
~ .custom-control-label::before {
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
}
&:not(:checked) ~ .custom-control-label::before {
border-color: $color;
}
}
}
}
// custom file
.custom-file-input {
.was-validated &:#{$state},
&.is-#{$state} {
~ .custom-file-label {
border-color: $color;
}
~ .#{$state}-feedback,
~ .#{$state}-tooltip {
display: block;
}
&:focus {
~ .custom-file-label {
border-color: $color;
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
}
}
}
}
}
+45 -45
View File
@@ -1,45 +1,45 @@
// Gradients // Gradients
@mixin gradient-bg($color) { @mixin gradient-bg($color) {
@if $enable-gradients { @if $enable-gradients {
background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x; background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x;
} @else { } @else {
background-color: $color; background-color: $color;
} }
} }
// Horizontal gradient, from left to right // Horizontal gradient, from left to right
// //
// Creates two color stops, start and end, by specifying a color and position for each color stop. // Creates two color stops, start and end, by specifying a color and position for each color stop.
@mixin gradient-x($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) { @mixin gradient-x($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) {
background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent);
background-repeat: repeat-x; background-repeat: repeat-x;
} }
// Vertical gradient, from top to bottom // Vertical gradient, from top to bottom
// //
// Creates two color stops, start and end, by specifying a color and position for each color stop. // Creates two color stops, start and end, by specifying a color and position for each color stop.
@mixin gradient-y($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) { @mixin gradient-y($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) {
background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent);
background-repeat: repeat-x; background-repeat: repeat-x;
} }
@mixin gradient-directional($start-color: $gray-700, $end-color: $gray-800, $deg: 45deg) { @mixin gradient-directional($start-color: $gray-700, $end-color: $gray-800, $deg: 45deg) {
background-image: linear-gradient($deg, $start-color, $end-color); background-image: linear-gradient($deg, $start-color, $end-color);
background-repeat: repeat-x; background-repeat: repeat-x;
} }
@mixin gradient-x-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) { @mixin gradient-x-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) {
background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color); background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@mixin gradient-y-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) { @mixin gradient-y-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) {
background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color); background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@mixin gradient-radial($inner-color: $gray-700, $outer-color: $gray-800) { @mixin gradient-radial($inner-color: $gray-700, $outer-color: $gray-800) {
background-image: radial-gradient(circle, $inner-color, $outer-color); background-image: radial-gradient(circle, $inner-color, $outer-color);
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@mixin gradient-striped($color: rgba($white, .15), $angle: 45deg) { @mixin gradient-striped($color: rgba($white, .15), $angle: 45deg) {
background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
} }
+66 -67
View File
@@ -1,67 +1,66 @@
// Framework grid generation // Framework grid generation
// //
// Used only by Bootstrap to generate the correct number of grid classes given // Used only by Bootstrap to generate the correct number of grid classes given
// any value of `$grid-columns`. // any value of `$grid-columns`.
@mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) { @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
// Common properties for all breakpoints // Common properties for all breakpoints
%grid-column { %grid-column {
position: relative; position: relative;
width: 100%; width: 100%;
min-height: 1px; // Prevent columns from collapsing when empty padding-right: $gutter / 2;
padding-right: ($gutter / 2); padding-left: $gutter / 2;
padding-left: ($gutter / 2); }
}
@each $breakpoint in map-keys($breakpoints) {
@each $breakpoint in map-keys($breakpoints) { $infix: breakpoint-infix($breakpoint, $breakpoints);
$infix: breakpoint-infix($breakpoint, $breakpoints);
// Allow columns to stretch full width below their breakpoints
// Allow columns to stretch full width below their breakpoints @for $i from 1 through $columns {
@for $i from 1 through $columns { .col#{$infix}-#{$i} {
.col#{$infix}-#{$i} { @extend %grid-column;
@extend %grid-column; }
} }
} .col#{$infix},
.col#{$infix}, .col#{$infix}-auto {
.col#{$infix}-auto { @extend %grid-column;
@extend %grid-column; }
}
@include media-breakpoint-up($breakpoint, $breakpoints) {
@include media-breakpoint-up($breakpoint, $breakpoints) { // Provide basic `.col-{bp}` classes for equal-width flexbox columns
// Provide basic `.col-{bp}` classes for equal-width flexbox columns .col#{$infix} {
.col#{$infix} { flex-basis: 0;
flex-basis: 0; flex-grow: 1;
flex-grow: 1; max-width: 100%;
max-width: 100%; }
} .col#{$infix}-auto {
.col#{$infix}-auto { flex: 0 0 auto;
flex: 0 0 auto; width: auto;
width: auto; max-width: 100%; // Reset earlier grid tiers
max-width: none; // Reset earlier grid tiers }
}
@for $i from 1 through $columns {
@for $i from 1 through $columns { .col#{$infix}-#{$i} {
.col#{$infix}-#{$i} { @include make-col($i, $columns);
@include make-col($i, $columns); }
} }
}
.order#{$infix}-first { order: -1; }
.order#{$infix}-first { order: -1; }
.order#{$infix}-last { order: $columns + 1; }
.order#{$infix}-last { order: $columns + 1; }
@for $i from 0 through $columns {
@for $i from 0 through $columns { .order#{$infix}-#{$i} { order: $i; }
.order#{$infix}-#{$i} { order: $i; } }
}
// `$columns - 1` because offsetting by the width of an entire row isn't possible
// `$columns - 1` because offsetting by the width of an entire row isn't possible @for $i from 0 through ($columns - 1) {
@for $i from 0 through ($columns - 1) { @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0 .offset#{$infix}-#{$i} {
.offset#{$infix}-#{$i} { @include make-col-offset($i, $columns);
@include make-col-offset($i, $columns); }
} }
} }
} }
} }
} }
}
+51 -52
View File
@@ -1,52 +1,51 @@
/// Grid system /// Grid system
// //
// Generate semantic grid columns with these mixins. // Generate semantic grid columns with these mixins.
@mixin make-container() { @mixin make-container($gutter: $grid-gutter-width) {
width: 100%; width: 100%;
padding-right: ($grid-gutter-width / 2); padding-right: $gutter / 2;
padding-left: ($grid-gutter-width / 2); padding-left: $gutter / 2;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
} }
// For each breakpoint, define the maximum width of the container in a media query // For each breakpoint, define the maximum width of the container in a media query
@mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) { @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
@each $breakpoint, $container-max-width in $max-widths { @each $breakpoint, $container-max-width in $max-widths {
@include media-breakpoint-up($breakpoint, $breakpoints) { @include media-breakpoint-up($breakpoint, $breakpoints) {
max-width: $container-max-width; max-width: $container-max-width;
} }
} }
} }
@mixin make-row() { @mixin make-row($gutter: $grid-gutter-width) {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-right: ($grid-gutter-width / -2); margin-right: -$gutter / 2;
margin-left: ($grid-gutter-width / -2); margin-left: -$gutter / 2;
} }
@mixin make-col-ready() { @mixin make-col-ready($gutter: $grid-gutter-width) {
position: relative; position: relative;
// Prevent columns from becoming too narrow when at smaller grid tiers by // Prevent columns from becoming too narrow when at smaller grid tiers by
// always setting `width: 100%;`. This works because we use `flex` values // always setting `width: 100%;`. This works because we use `flex` values
// later on to override this initial width. // later on to override this initial width.
width: 100%; width: 100%;
min-height: 1px; // Prevent collapsing padding-right: $gutter / 2;
padding-right: ($grid-gutter-width / 2); padding-left: $gutter / 2;
padding-left: ($grid-gutter-width / 2); }
}
@mixin make-col($size, $columns: $grid-columns) {
@mixin make-col($size, $columns: $grid-columns) { flex: 0 0 percentage($size / $columns);
flex: 0 0 percentage($size / $columns); // Add a `max-width` to ensure content within each column does not blow out
// Add a `max-width` to ensure content within each column does not blow out // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari // do not appear to require this.
// do not appear to require this. max-width: percentage($size / $columns);
max-width: percentage($size / $columns); }
}
@mixin make-col-offset($size, $columns: $grid-columns) {
@mixin make-col-offset($size, $columns: $grid-columns) { $num: $size / $columns;
$num: $size / $columns; margin-left: if($num == 0, 0, percentage($num));
margin-left: if($num == 0, 0, percentage($num)); }
}
+37 -37
View File
@@ -1,37 +1,37 @@
// Hover mixin and `$enable-hover-media-query` are deprecated. // Hover mixin and `$enable-hover-media-query` are deprecated.
// //
// Origally added during our alphas and maintained during betas, this mixin was // Originally added during our alphas and maintained during betas, this mixin was
// designed to prevent `:hover` stickiness on iOS-an issue where hover styles // designed to prevent `:hover` stickiness on iOS-an issue where hover styles
// would persist after initial touch. // would persist after initial touch.
// //
// For backward compatibility, we've kept these mixins and updated them to // For backward compatibility, we've kept these mixins and updated them to
// always return their regular pseudo-classes instead of a shimmed media query. // always return their regular pseudo-classes instead of a shimmed media query.
// //
// Issue: https://github.com/twbs/bootstrap/issues/25195 // Issue: https://github.com/twbs/bootstrap/issues/25195
@mixin hover { @mixin hover {
&:hover { @content; } &:hover { @content; }
} }
@mixin hover-focus { @mixin hover-focus {
&:hover, &:hover,
&:focus { &:focus {
@content; @content;
} }
} }
@mixin plain-hover-focus { @mixin plain-hover-focus {
&, &,
&:hover, &:hover,
&:focus { &:focus {
@content; @content;
} }
} }
@mixin hover-focus-active { @mixin hover-focus-active {
&:hover, &:hover,
&:focus, &:focus,
&:active { &:active {
@content; @content;
} }
} }
+36 -36
View File
@@ -1,36 +1,36 @@
// Image Mixins // Image Mixins
// - Responsive image // - Responsive image
// - Retina image // - Retina image
// Responsive image // Responsive image
// //
// Keep images from scaling beyond the width of their parents. // Keep images from scaling beyond the width of their parents.
@mixin img-fluid { @mixin img-fluid {
// Part 1: Set a maximum relative to the parent // Part 1: Set a maximum relative to the parent
max-width: 100%; max-width: 100%;
// Part 2: Override the height to auto, otherwise images will be stretched // Part 2: Override the height to auto, otherwise images will be stretched
// when setting a width and height attribute on the img element. // when setting a width and height attribute on the img element.
height: auto; height: auto;
} }
// Retina image // Retina image
// //
// Short retina mixin for setting background-image and -size. // 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) {
@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { background-image: url($file-1x);
background-image: url($file-1x);
// Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,
// Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio, // but doesn't convert dppx=>dpi.
// but doesn't convert dppx=>dpi. // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
// There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard. // Compatibility info: https://caniuse.com/#feat=css-media-resolution
// Compatibility info: https://caniuse.com/#feat=css-media-resolution @media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
@media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx only screen and (min-resolution: 2dppx) { // Standardized
only screen and (min-resolution: 2dppx) { // Standardized background-image: url($file-2x);
background-image: url($file-2x); background-size: $width-1x $height-1x;
background-size: $width-1x $height-1x; }
} @include deprecate("`img-retina()`", "v4.3.0", "v5");
} }
+21 -21
View File
@@ -1,21 +1,21 @@
// List Groups // List Groups
@mixin list-group-item-variant($state, $background, $color) { @mixin list-group-item-variant($state, $background, $color) {
.list-group-item-#{$state} { .list-group-item-#{$state} {
color: $color; color: $color;
background-color: $background; background-color: $background;
&.list-group-item-action { &.list-group-item-action {
@include hover-focus { @include hover-focus {
color: $color; color: $color;
background-color: darken($background, 5%); background-color: darken($background, 5%);
} }
&.active { &.active {
color: $white; color: $white;
background-color: $color; background-color: $color;
border-color: $color; border-color: $color;
} }
} }
} }
} }
+7 -7
View File
@@ -1,7 +1,7 @@
// Lists // Lists
// Unstyled keeps list items block level, just removes default browser padding and list-style // Unstyled keeps list items block level, just removes default browser padding and list-style
@mixin list-unstyled { @mixin list-unstyled {
padding-left: 0; padding-left: 0;
list-style: none; list-style: none;
} }
+10 -10
View File
@@ -1,10 +1,10 @@
// Horizontal dividers // Horizontal dividers
// //
// Dividers (basically an hr) within dropdowns and nav lists // Dividers (basically an hr) within dropdowns and nav lists
@mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y) { @mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y) {
height: 0; height: 0;
margin: $margin-y 0; margin: $margin-y 0;
overflow: hidden; overflow: hidden;
border-top: 1px solid $color; border-top: 1px solid $color;
} }
+22 -22
View File
@@ -1,22 +1,22 @@
// Pagination // Pagination
@mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) { @mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
.page-link { .page-link {
padding: $padding-y $padding-x; padding: $padding-y $padding-x;
font-size: $font-size; @include font-size($font-size);
line-height: $line-height; line-height: $line-height;
} }
.page-item { .page-item {
&:first-child { &:first-child {
.page-link { .page-link {
@include border-left-radius($border-radius); @include border-left-radius($border-radius);
} }
} }
&:last-child { &:last-child {
.page-link { .page-link {
@include border-right-radius($border-radius); @include border-right-radius($border-radius);
} }
} }
} }
} }
+17 -17
View File
@@ -1,17 +1,17 @@
@mixin reset-text { @mixin reset-text {
font-family: $font-family-base; font-family: $font-family-base;
// We deliberately do NOT reset font-size or word-wrap. // We deliberately do NOT reset font-size or word-wrap.
font-style: normal; font-style: normal;
font-weight: $font-weight-normal; font-weight: $font-weight-normal;
line-height: $line-height-base; line-height: $line-height-base;
text-align: left; // Fallback for where `start` is not supported text-align: left; // Fallback for where `start` is not supported
text-align: start; // stylelint-disable-line declaration-block-no-duplicate-properties text-align: start;
text-decoration: none; text-decoration: none;
text-shadow: none; text-shadow: none;
text-transform: none; text-transform: none;
letter-spacing: normal; letter-spacing: normal;
word-break: normal; word-break: normal;
word-spacing: normal; word-spacing: normal;
white-space: normal; white-space: normal;
line-break: auto; line-break: auto;
} }
+6 -6
View File
@@ -1,6 +1,6 @@
// Resize anything // Resize anything
@mixin resizable($direction) { @mixin resizable($direction) {
overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible`
resize: $direction; // Options: horizontal, vertical, both resize: $direction; // Options: horizontal, vertical, both
} }
+33 -33
View File
@@ -1,33 +1,33 @@
// Only display content to screen readers // Only display content to screen readers
// //
// See: https://a11yproject.com/posts/how-to-hide-content/ // See: https://a11yproject.com/posts/how-to-hide-content/
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/ // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
@mixin sr-only { @mixin sr-only {
position: absolute; position: absolute;
width: 1px; width: 1px;
height: 1px; height: 1px;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
clip: rect(0, 0, 0, 0); clip: rect(0, 0, 0, 0);
white-space: nowrap; white-space: nowrap;
border: 0; border: 0;
} }
// Use in conjunction with .sr-only to only display content when it's focused. // Use in conjunction with .sr-only to only display content when it's focused.
// //
// Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 // Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
// //
// Credit: HTML5 Boilerplate // Credit: HTML5 Boilerplate
@mixin sr-only-focusable { @mixin sr-only-focusable {
&:active, &:active,
&:focus { &:focus {
position: static; position: static;
width: auto; width: auto;
height: auto; height: auto;
overflow: visible; overflow: visible;
clip: auto; clip: auto;
white-space: normal; white-space: normal;
} }
} }
+7 -6
View File
@@ -1,6 +1,7 @@
// Sizing shortcuts // Sizing shortcuts
@mixin size($width, $height: $width) { @mixin size($width, $height: $width) {
width: $width; width: $width;
height: $height; height: $height;
} @include deprecate("`size()`", "v4.3.0", "v5");
}
+39 -30
View File
@@ -1,30 +1,39 @@
// Tables // Tables
@mixin table-row-variant($state, $background) { @mixin table-row-variant($state, $background, $border: null) {
// Exact selectors below required to override `.table-striped` and prevent // Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables. // inheritance to nested tables.
.table-#{$state} { .table-#{$state} {
&, &,
> th, > th,
> td { > td {
background-color: $background; background-color: $background;
} }
}
@if $border != null {
// Hover states for `.table-hover` th,
// Note: this is not available for cells or rows within `thead` or `tfoot`. td,
.table-hover { thead th,
$hover-background: darken($background, 5%); tbody + tbody {
border-color: $border;
.table-#{$state} { }
@include hover { }
background-color: $hover-background; }
> td, // Hover states for `.table-hover`
> th { // Note: this is not available for cells or rows within `thead` or `tfoot`.
background-color: $hover-background; .table-hover {
} $hover-background: darken($background, 5%);
}
} .table-#{$state} {
} @include hover {
} background-color: $hover-background;
> td,
> th {
background-color: $hover-background;
}
}
}
}
}
+16 -14
View File
@@ -1,14 +1,16 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Typography // Typography
@mixin text-emphasis-variant($parent, $color) { @mixin text-emphasis-variant($parent, $color) {
#{$parent} { #{$parent} {
color: $color !important; color: $color !important;
} }
a#{$parent} { @if $emphasized-link-hover-darken-percentage != 0 {
@include hover-focus { a#{$parent} {
color: darken($color, 10%) !important; @include hover-focus {
} color: darken($color, $emphasized-link-hover-darken-percentage) !important;
} }
} }
}
}
+11 -13
View File
@@ -1,13 +1,11 @@
// CSS image replacement // CSS image replacement
@mixin text-hide($ignore-warning: false) { @mixin text-hide($ignore-warning: false) {
// stylelint-disable-next-line font-family-no-missing-generic-family-keyword // stylelint-disable-next-line font-family-no-missing-generic-family-keyword
font: 0/0 a; font: 0/0 a;
color: transparent; color: transparent;
text-shadow: none; text-shadow: none;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
@if ($ignore-warning != true) { @include deprecate("`text-hide()`", "v4.1.0", "v5", $ignore-warning);
@warn "The `text-hide()` mixin has been deprecated as of v4.1.0. It will be removed entirely in v5."; }
}
}
+8 -8
View File
@@ -1,8 +1,8 @@
// Text truncate // Text truncate
// Requires inline-block or block for proper styling // Requires inline-block or block for proper styling
@mixin text-truncate() { @mixin text-truncate() {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
+16 -13
View File
@@ -1,13 +1,16 @@
@mixin transition($transition...) { // stylelint-disable property-blacklist
@if $enable-transitions { @mixin transition($transition...) {
@if length($transition) == 0 { @if $enable-transitions {
transition: $transition-base; @if length($transition) == 0 {
} @else { transition: $transition-base;
transition: $transition; } @else {
} transition: $transition;
} }
}
@media screen and (prefers-reduced-motion: reduce) {
transition: none; @if $enable-prefers-reduced-motion-media-query {
} @media (prefers-reduced-motion: reduce) {
} transition: none;
}
}
}
+8 -7
View File
@@ -1,7 +1,8 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Visibility // Visibility
@mixin invisible($visibility) { @mixin invisible($visibility) {
visibility: $visibility !important; visibility: $visibility !important;
} @include deprecate("`invisible()`", "v4.3.0", "v5");
}
+8 -8
View File
@@ -1,8 +1,8 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
.align-baseline { vertical-align: baseline !important; } // Browser default .align-baseline { vertical-align: baseline !important; } // Browser default
.align-top { vertical-align: top !important; } .align-top { vertical-align: top !important; }
.align-middle { vertical-align: middle !important; } .align-middle { vertical-align: middle !important; }
.align-bottom { vertical-align: bottom !important; } .align-bottom { vertical-align: bottom !important; }
.align-text-bottom { vertical-align: text-bottom !important; } .align-text-bottom { vertical-align: text-bottom !important; }
.align-text-top { vertical-align: text-top !important; } .align-text-top { vertical-align: text-top !important; }
+19 -19
View File
@@ -1,19 +1,19 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
@include bg-variant(".bg-#{$color}", $value); @include bg-variant(".bg-#{$color}", $value);
} }
@if $enable-gradients { @if $enable-gradients {
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
@include bg-gradient-variant(".bg-gradient-#{$color}", $value); @include bg-gradient-variant(".bg-gradient-#{$color}", $value);
} }
} }
.bg-white { .bg-white {
background-color: $white !important; background-color: $white !important;
} }
.bg-transparent { .bg-transparent {
background-color: transparent !important; background-color: transparent !important;
} }
+75 -59
View File
@@ -1,59 +1,75 @@
// stylelint-disable declaration-no-important // stylelint-disable property-blacklist, declaration-no-important
// //
// Border // 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-top { border-top: $border-width solid $border-color !important; }
.border-right { border-right: $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-bottom { border-bottom: $border-width solid $border-color !important; }
.border-left { border-left: $border-width solid $border-color !important; } .border-left { border-left: $border-width solid $border-color !important; }
.border-0 { border: 0 !important; } .border-0 { border: 0 !important; }
.border-top-0 { border-top: 0 !important; } .border-top-0 { border-top: 0 !important; }
.border-right-0 { border-right: 0 !important; } .border-right-0 { border-right: 0 !important; }
.border-bottom-0 { border-bottom: 0 !important; } .border-bottom-0 { border-bottom: 0 !important; }
.border-left-0 { border-left: 0 !important; } .border-left-0 { border-left: 0 !important; }
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
.border-#{$color} { .border-#{$color} {
border-color: $value !important; border-color: $value !important;
} }
} }
.border-white { .border-white {
border-color: $white !important; border-color: $white !important;
} }
// //
// Border-radius // Border-radius
// //
.rounded { .rounded-sm {
border-radius: $border-radius !important; border-radius: $border-radius-sm !important;
} }
.rounded-top {
border-top-left-radius: $border-radius !important; .rounded {
border-top-right-radius: $border-radius !important; border-radius: $border-radius !important;
} }
.rounded-right {
border-top-right-radius: $border-radius !important; .rounded-top {
border-bottom-right-radius: $border-radius !important; border-top-left-radius: $border-radius !important;
} border-top-right-radius: $border-radius !important;
.rounded-bottom { }
border-bottom-right-radius: $border-radius !important;
border-bottom-left-radius: $border-radius !important; .rounded-right {
} border-top-right-radius: $border-radius !important;
.rounded-left { border-bottom-right-radius: $border-radius !important;
border-top-left-radius: $border-radius !important; }
border-bottom-left-radius: $border-radius !important;
} .rounded-bottom {
border-bottom-right-radius: $border-radius !important;
.rounded-circle { border-bottom-left-radius: $border-radius !important;
border-radius: 50% !important; }
}
.rounded-left {
.rounded-0 { border-top-left-radius: $border-radius !important;
border-radius: 0 !important; border-bottom-left-radius: $border-radius !important;
} }
.rounded-lg {
border-radius: $border-radius-lg !important;
}
.rounded-circle {
border-radius: 50% !important;
}
.rounded-pill {
border-radius: $rounded-pill !important;
}
.rounded-0 {
border-radius: 0 !important;
}
+3 -3
View File
@@ -1,3 +1,3 @@
.clearfix { .clearfix {
@include clearfix(); @include clearfix();
} }
+26 -38
View File
@@ -1,38 +1,26 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// //
// Utilities for common `display` values // Utilities for common `display` values
// //
@each $breakpoint in map-keys($grid-breakpoints) { @each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) { @include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.d#{$infix}-none { display: none !important; } @each $value in $displays {
.d#{$infix}-inline { display: inline !important; } .d#{$infix}-#{$value} { display: $value !important; }
.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; } // Utilities for toggling `display` in print
} //
}
@media print {
@each $value in $displays {
// .d-print-#{$value} { display: $value !important; }
// Utilities for toggling `display` in print }
// }
@media print {
.d-print-none { display: none !important; }
.d-print-inline { display: inline !important; }
.d-print-inline-block { display: inline-block !important; }
.d-print-block { display: block !important; }
.d-print-table { display: table !important; }
.d-print-table-row { display: table-row !important; }
.d-print-table-cell { display: table-cell !important; }
.d-print-flex { display: flex !important; }
.d-print-inline-flex { display: inline-flex !important; }
}
+39 -52
View File
@@ -1,52 +1,39 @@
// Credit: Nicolas Gallagher and SUIT CSS. // Credit: Nicolas Gallagher and SUIT CSS.
.embed-responsive { .embed-responsive {
position: relative; position: relative;
display: block; display: block;
width: 100%; width: 100%;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
&::before { &::before {
display: block; display: block;
content: ""; content: "";
} }
.embed-responsive-item, .embed-responsive-item,
iframe, iframe,
embed, embed,
object, object,
video { video {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 0; border: 0;
} }
} }
.embed-responsive-21by9 { @each $embed-responsive-aspect-ratio in $embed-responsive-aspect-ratios {
&::before { $embed-responsive-aspect-ratio-x: nth($embed-responsive-aspect-ratio, 1);
padding-top: percentage(9 / 21); $embed-responsive-aspect-ratio-y: nth($embed-responsive-aspect-ratio, 2);
}
} .embed-responsive-#{$embed-responsive-aspect-ratio-x}by#{$embed-responsive-aspect-ratio-y} {
&::before {
.embed-responsive-16by9 { padding-top: percentage($embed-responsive-aspect-ratio-y / $embed-responsive-aspect-ratio-x);
&::before { }
padding-top: percentage(9 / 16); }
} }
}
.embed-responsive-4by3 {
&::before {
padding-top: percentage(3 / 4);
}
}
.embed-responsive-1by1 {
&::before {
padding-top: percentage(1 / 1);
}
}
+51 -51
View File
@@ -1,51 +1,51 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Flex variation // Flex variation
// //
// Custom styles for additional flex alignment options. // Custom styles for additional flex alignment options.
@each $breakpoint in map-keys($grid-breakpoints) { @each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) { @include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.flex#{$infix}-row { flex-direction: row !important; } .flex#{$infix}-row { flex-direction: row !important; }
.flex#{$infix}-column { flex-direction: column !important; } .flex#{$infix}-column { flex-direction: column !important; }
.flex#{$infix}-row-reverse { flex-direction: row-reverse !important; } .flex#{$infix}-row-reverse { flex-direction: row-reverse !important; }
.flex#{$infix}-column-reverse { flex-direction: column-reverse !important; } .flex#{$infix}-column-reverse { flex-direction: column-reverse !important; }
.flex#{$infix}-wrap { flex-wrap: wrap !important; } .flex#{$infix}-wrap { flex-wrap: wrap !important; }
.flex#{$infix}-nowrap { flex-wrap: nowrap !important; } .flex#{$infix}-nowrap { flex-wrap: nowrap !important; }
.flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; } .flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }
.flex#{$infix}-fill { flex: 1 1 auto !important; } .flex#{$infix}-fill { flex: 1 1 auto !important; }
.flex#{$infix}-grow-0 { flex-grow: 0 !important; } .flex#{$infix}-grow-0 { flex-grow: 0 !important; }
.flex#{$infix}-grow-1 { flex-grow: 1 !important; } .flex#{$infix}-grow-1 { flex-grow: 1 !important; }
.flex#{$infix}-shrink-0 { flex-shrink: 0 !important; } .flex#{$infix}-shrink-0 { flex-shrink: 0 !important; }
.flex#{$infix}-shrink-1 { flex-shrink: 1 !important; } .flex#{$infix}-shrink-1 { flex-shrink: 1 !important; }
.justify-content#{$infix}-start { justify-content: flex-start !important; } .justify-content#{$infix}-start { justify-content: flex-start !important; }
.justify-content#{$infix}-end { justify-content: flex-end !important; } .justify-content#{$infix}-end { justify-content: flex-end !important; }
.justify-content#{$infix}-center { justify-content: center !important; } .justify-content#{$infix}-center { justify-content: center !important; }
.justify-content#{$infix}-between { justify-content: space-between !important; } .justify-content#{$infix}-between { justify-content: space-between !important; }
.justify-content#{$infix}-around { justify-content: space-around !important; } .justify-content#{$infix}-around { justify-content: space-around !important; }
.align-items#{$infix}-start { align-items: flex-start !important; } .align-items#{$infix}-start { align-items: flex-start !important; }
.align-items#{$infix}-end { align-items: flex-end !important; } .align-items#{$infix}-end { align-items: flex-end !important; }
.align-items#{$infix}-center { align-items: center !important; } .align-items#{$infix}-center { align-items: center !important; }
.align-items#{$infix}-baseline { align-items: baseline !important; } .align-items#{$infix}-baseline { align-items: baseline !important; }
.align-items#{$infix}-stretch { align-items: stretch !important; } .align-items#{$infix}-stretch { align-items: stretch !important; }
.align-content#{$infix}-start { align-content: flex-start !important; } .align-content#{$infix}-start { align-content: flex-start !important; }
.align-content#{$infix}-end { align-content: flex-end !important; } .align-content#{$infix}-end { align-content: flex-end !important; }
.align-content#{$infix}-center { align-content: center !important; } .align-content#{$infix}-center { align-content: center !important; }
.align-content#{$infix}-between { align-content: space-between !important; } .align-content#{$infix}-between { align-content: space-between !important; }
.align-content#{$infix}-around { align-content: space-around !important; } .align-content#{$infix}-around { align-content: space-around !important; }
.align-content#{$infix}-stretch { align-content: stretch !important; } .align-content#{$infix}-stretch { align-content: stretch !important; }
.align-self#{$infix}-auto { align-self: auto !important; } .align-self#{$infix}-auto { align-self: auto !important; }
.align-self#{$infix}-start { align-self: flex-start !important; } .align-self#{$infix}-start { align-self: flex-start !important; }
.align-self#{$infix}-end { align-self: flex-end !important; } .align-self#{$infix}-end { align-self: flex-end !important; }
.align-self#{$infix}-center { align-self: center !important; } .align-self#{$infix}-center { align-self: center !important; }
.align-self#{$infix}-baseline { align-self: baseline !important; } .align-self#{$infix}-baseline { align-self: baseline !important; }
.align-self#{$infix}-stretch { align-self: stretch !important; } .align-self#{$infix}-stretch { align-self: stretch !important; }
} }
} }
+11 -9
View File
@@ -1,9 +1,11 @@
@each $breakpoint in map-keys($grid-breakpoints) { // stylelint-disable declaration-no-important
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); @each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
.float#{$infix}-left { @include float-left; } $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.float#{$infix}-right { @include float-right; }
.float#{$infix}-none { @include float-none; } .float#{$infix}-left { float: left !important; }
} .float#{$infix}-right { float: right !important; }
} .float#{$infix}-none { float: none !important; }
}
}
+5
View File
@@ -0,0 +1,5 @@
// stylelint-disable declaration-no-important
@each $value in $overflows {
.overflow-#{$value} { overflow: $value !important; }
}
+32 -37
View File
@@ -1,37 +1,32 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Common values // Common values
@each $position in $positions {
// Sass list not in variables since it's not intended for customization. .position-#{$position} { position: $position !important; }
// stylelint-disable-next-line scss/dollar-variable-default }
$positions: static, relative, absolute, fixed, sticky;
// Shorthand
@each $position in $positions {
.position-#{$position} { position: $position !important; } .fixed-top {
} position: fixed;
top: 0;
// Shorthand right: 0;
left: 0;
.fixed-top { z-index: $zindex-fixed;
position: fixed; }
top: 0;
right: 0; .fixed-bottom {
left: 0; position: fixed;
z-index: $zindex-fixed; right: 0;
} bottom: 0;
left: 0;
.fixed-bottom { z-index: $zindex-fixed;
position: fixed; }
right: 0;
bottom: 0; .sticky-top {
left: 0; @supports (position: sticky) {
z-index: $zindex-fixed; position: sticky;
} top: 0;
z-index: $zindex-sticky;
.sticky-top { }
@supports (position: sticky) { }
position: sticky;
top: 0;
z-index: $zindex-sticky;
}
}
+11 -11
View File
@@ -1,11 +1,11 @@
// //
// Screenreaders // Screenreaders
// //
.sr-only { .sr-only {
@include sr-only(); @include sr-only();
} }
.sr-only-focusable { .sr-only-focusable {
@include sr-only-focusable(); @include sr-only-focusable();
} }
+6 -6
View File
@@ -1,6 +1,6 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
.shadow-sm { box-shadow: $box-shadow-sm !important; } .shadow-sm { box-shadow: $box-shadow-sm !important; }
.shadow { box-shadow: $box-shadow !important; } .shadow { box-shadow: $box-shadow !important; }
.shadow-lg { box-shadow: $box-shadow-lg !important; } .shadow-lg { box-shadow: $box-shadow-lg !important; }
.shadow-none { box-shadow: none !important; } .shadow-none { box-shadow: none !important; }
+20 -12
View File
@@ -1,12 +1,20 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Width and height // Width and height
@each $prop, $abbrev in (width: w, height: h) { @each $prop, $abbrev in (width: w, height: h) {
@each $size, $length in $sizes { @each $size, $length in $sizes {
.#{$abbrev}-#{$size} { #{$prop}: $length !important; } .#{$abbrev}-#{$size} { #{$prop}: $length !important; }
} }
} }
.mw-100 { max-width: 100% !important; } .mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; } .mh-100 { max-height: 100% !important; }
// Viewport additional helpers
.min-vw-100 { min-width: 100vw !important; }
.min-vh-100 { min-height: 100vh !important; }
.vw-100 { width: 100vw !important; }
.vh-100 { height: 100vh !important; }
+73 -51
View File
@@ -1,51 +1,73 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// Margin and Padding // Margin and Padding
@each $breakpoint in map-keys($grid-breakpoints) { @each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) { @include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@each $prop, $abbrev in (margin: m, padding: p) { @each $prop, $abbrev in (margin: m, padding: p) {
@each $size, $length in $spacers { @each $size, $length in $spacers {
.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; } .#{$abbrev}t#{$infix}-#{$size},
.#{$abbrev}t#{$infix}-#{$size}, .#{$abbrev}y#{$infix}-#{$size} {
.#{$abbrev}y#{$infix}-#{$size} { #{$prop}-top: $length !important;
#{$prop}-top: $length !important; }
} .#{$abbrev}r#{$infix}-#{$size},
.#{$abbrev}r#{$infix}-#{$size}, .#{$abbrev}x#{$infix}-#{$size} {
.#{$abbrev}x#{$infix}-#{$size} { #{$prop}-right: $length !important;
#{$prop}-right: $length !important; }
} .#{$abbrev}b#{$infix}-#{$size},
.#{$abbrev}b#{$infix}-#{$size}, .#{$abbrev}y#{$infix}-#{$size} {
.#{$abbrev}y#{$infix}-#{$size} { #{$prop}-bottom: $length !important;
#{$prop}-bottom: $length !important; }
} .#{$abbrev}l#{$infix}-#{$size},
.#{$abbrev}l#{$infix}-#{$size}, .#{$abbrev}x#{$infix}-#{$size} {
.#{$abbrev}x#{$infix}-#{$size} { #{$prop}-left: $length !important;
#{$prop}-left: $length !important; }
} }
} }
}
// Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
// Some special margin utils @each $size, $length in $spacers {
.m#{$infix}-auto { margin: auto !important; } @if $size != 0 {
.mt#{$infix}-auto, .m#{$infix}-n#{$size} { margin: -$length !important; }
.my#{$infix}-auto { .mt#{$infix}-n#{$size},
margin-top: auto !important; .my#{$infix}-n#{$size} {
} margin-top: -$length !important;
.mr#{$infix}-auto, }
.mx#{$infix}-auto { .mr#{$infix}-n#{$size},
margin-right: auto !important; .mx#{$infix}-n#{$size} {
} margin-right: -$length !important;
.mb#{$infix}-auto, }
.my#{$infix}-auto { .mb#{$infix}-n#{$size},
margin-bottom: auto !important; .my#{$infix}-n#{$size} {
} margin-bottom: -$length !important;
.ml#{$infix}-auto, }
.mx#{$infix}-auto { .ml#{$infix}-n#{$size},
margin-left: auto !important; .mx#{$infix}-n#{$size} {
} margin-left: -$length !important;
} }
} }
}
// Some special margin utils
.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;
}
.mb#{$infix}-auto,
.my#{$infix}-auto {
margin-bottom: auto !important;
}
.ml#{$infix}-auto,
.mx#{$infix}-auto {
margin-left: auto !important;
}
}
}
@@ -0,0 +1,19 @@
//
// Stretched link
//
.stretched-link {
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
// Just in case `pointer-events: none` is set on a parent
pointer-events: auto;
content: "";
// IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color
background-color: rgba(0, 0, 0, 0);
}
}
+72 -58
View File
@@ -1,58 +1,72 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
// //
// Text // Text
// //
.text-monospace { font-family: $font-family-monospace; } .text-monospace { font-family: $font-family-monospace !important; }
// Alignment // Alignment
.text-justify { text-align: justify !important; } .text-justify { text-align: justify !important; }
.text-nowrap { white-space: nowrap !important; } .text-wrap { white-space: normal !important; }
.text-truncate { @include text-truncate; } .text-nowrap { white-space: nowrap !important; }
.text-truncate { @include text-truncate; }
// Responsive alignment
// Responsive alignment
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) { @each $breakpoint in map-keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); @include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.text#{$infix}-left { text-align: left !important; }
.text#{$infix}-right { text-align: right !important; } .text#{$infix}-left { text-align: left !important; }
.text#{$infix}-center { text-align: center !important; } .text#{$infix}-right { text-align: right !important; }
} .text#{$infix}-center { text-align: center !important; }
} }
}
// Transformation
// Transformation
.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; } .text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; } .text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
// Weight and italics
// Weight and italics
.font-weight-light { font-weight: $font-weight-light !important; }
.font-weight-normal { font-weight: $font-weight-normal !important; } .font-weight-light { font-weight: $font-weight-light !important; }
.font-weight-bold { font-weight: $font-weight-bold !important; } .font-weight-lighter { font-weight: $font-weight-lighter !important; }
.font-italic { font-style: italic !important; } .font-weight-normal { font-weight: $font-weight-normal !important; }
.font-weight-bold { font-weight: $font-weight-bold !important; }
// Contextual colors .font-weight-bolder { font-weight: $font-weight-bolder !important; }
.font-italic { font-style: italic !important; }
.text-white { color: $white !important; }
// Contextual colors
@each $color, $value in $theme-colors {
@include text-emphasis-variant(".text-#{$color}", $value); .text-white { color: $white !important; }
}
@each $color, $value in $theme-colors {
.text-body { color: $body-color !important; } @include text-emphasis-variant(".text-#{$color}", $value);
.text-muted { color: $text-muted !important; } }
.text-black-50 { color: rgba($black, .5) !important; } .text-body { color: $body-color !important; }
.text-white-50 { color: rgba($white, .5) !important; } .text-muted { color: $text-muted !important; }
// Misc .text-black-50 { color: rgba($black, .5) !important; }
.text-white-50 { color: rgba($white, .5) !important; }
.text-hide {
@include text-hide($ignore-warning: true); // Misc
}
.text-hide {
@include text-hide($ignore-warning: true);
}
.text-decoration-none { text-decoration: none !important; }
.text-break {
word-break: break-word !important; // IE & < Edge 18
overflow-wrap: break-word !important;
}
// Reset
.text-reset { color: inherit !important; }
+13 -11
View File
@@ -1,11 +1,13 @@
// // stylelint-disable declaration-no-important
// Visibility utilities
// //
// Visibility utilities
.visible { //
@include invisible(visible);
} .visible {
visibility: visible !important;
.invisible { }
@include invisible(hidden);
} .invisible {
visibility: hidden !important;
}
+204
View File
@@ -0,0 +1,204 @@
// stylelint-disable property-blacklist, scss/dollar-variable-default
// SCSS RFS mixin
//
// Automated font-resizing
//
// See https://github.com/twbs/rfs
// Configuration
// Base font size
$rfs-base-font-size: 1.25rem !default;
$rfs-font-size-unit: rem !default;
// Breakpoint at where font-size starts decreasing if screen width is smaller
$rfs-breakpoint: 1200px !default;
$rfs-breakpoint-unit: px !default;
// Resize font-size based on screen height and width
$rfs-two-dimensional: false !default;
// Factor of decrease
$rfs-factor: 10 !default;
@if type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
@error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
}
// Generate enable or disable classes. Possibilities: false, "enable" or "disable"
$rfs-class: false !default;
// 1 rem = $rfs-rem-value px
$rfs-rem-value: 16 !default;
// Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
$rfs-safari-iframe-resize-bug-fix: false !default;
// Disable RFS by setting $enable-responsive-font-sizes to false
$enable-responsive-font-sizes: true !default;
// Cache $rfs-base-font-size unit
$rfs-base-font-size-unit: unit($rfs-base-font-size);
// Remove px-unit from $rfs-base-font-size for calculations
@if $rfs-base-font-size-unit == "px" {
$rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1);
}
@else if $rfs-base-font-size-unit == "rem" {
$rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
}
// Cache $rfs-breakpoint unit to prevent multiple calls
$rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
// Remove unit from $rfs-breakpoint for calculations
@if $rfs-breakpoint-unit-cache == "px" {
$rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
}
@else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
$rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1 / $rfs-rem-value);
}
// Responsive font-size mixin
@mixin rfs($fs, $important: false) {
// Cache $fs unit
$fs-unit: if(type-of($fs) == "number", unit($fs), false);
// Add !important suffix if needed
$rfs-suffix: if($important, " !important", "");
// If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
@if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
font-size: #{$fs}#{$rfs-suffix};
}
@else {
// Variables for storing static and fluid rescaling
$rfs-static: null;
$rfs-fluid: null;
// Remove px-unit from $fs for calculations
@if $fs-unit == "px" {
$fs: $fs / ($fs * 0 + 1);
}
@else if $fs-unit == "rem" {
$fs: $fs / ($fs * 0 + 1 / $rfs-rem-value);
}
// Set default font-size
@if $rfs-font-size-unit == rem {
$rfs-static: #{$fs / $rfs-rem-value}rem#{$rfs-suffix};
}
@else if $rfs-font-size-unit == px {
$rfs-static: #{$fs}px#{$rfs-suffix};
}
@else {
@error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
}
// Only add media query if font-size is bigger as the minimum font-size
// If $rfs-factor == 1, no rescaling will take place
@if $fs > $rfs-base-font-size and $enable-responsive-font-sizes {
$min-width: null;
$variable-unit: null;
// Calculate minimum font-size for given font-size
$fs-min: $rfs-base-font-size + ($fs - $rfs-base-font-size) / $rfs-factor;
// Calculate difference between given font-size and minimum font-size for given font-size
$fs-diff: $fs - $fs-min;
// Base font-size formatting
// No need to check if the unit is valid, because we did that before
$min-width: if($rfs-font-size-unit == rem, #{$fs-min / $rfs-rem-value}rem, #{$fs-min}px);
// If two-dimensional, use smallest of screen width and height
$variable-unit: if($rfs-two-dimensional, vmin, vw);
// Calculate the variable width between 0 and $rfs-breakpoint
$variable-width: #{$fs-diff * 100 / $rfs-breakpoint}#{$variable-unit};
// Set the calculated font-size.
$rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
}
// Rendering
@if $rfs-fluid == null {
// Only render static font-size if no fluid font-size is available
font-size: $rfs-static;
}
@else {
$mq-value: null;
// RFS breakpoint formatting
@if $rfs-breakpoint-unit == em or $rfs-breakpoint-unit == rem {
$mq-value: #{$rfs-breakpoint / $rfs-rem-value}#{$rfs-breakpoint-unit};
}
@else if $rfs-breakpoint-unit == px {
$mq-value: #{$rfs-breakpoint}px;
}
@else {
@error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
}
@if $rfs-class == "disable" {
// Adding an extra class increases specificity,
// which prevents the media query to override the font size
&,
.disable-responsive-font-size &,
&.disable-responsive-font-size {
font-size: $rfs-static;
}
}
@else {
font-size: $rfs-static;
}
@if $rfs-two-dimensional {
@media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
@if $rfs-class == "enable" {
.enable-responsive-font-size &,
&.enable-responsive-font-size {
font-size: $rfs-fluid;
}
}
@else {
font-size: $rfs-fluid;
}
@if $rfs-safari-iframe-resize-bug-fix {
// stylelint-disable-next-line length-zero-no-unit
min-width: 0vw;
}
}
}
@else {
@media (max-width: #{$mq-value}) {
@if $rfs-class == "enable" {
.enable-responsive-font-size &,
&.enable-responsive-font-size {
font-size: $rfs-fluid;
}
}
@else {
font-size: $rfs-fluid;
}
@if $rfs-safari-iframe-resize-bug-fix {
// stylelint-disable-next-line length-zero-no-unit
min-width: 0vw;
}
}
}
}
}
}
// The font-size & responsive-font-size mixin uses RFS to rescale font sizes
@mixin font-size($fs, $important: false) {
@include rfs($fs, $important);
}
@mixin responsive-font-size($fs, $important: false) {
@include rfs($fs, $important);
}
+4 -4
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long