diff --git a/src/assets/images/icons/close.png b/src/assets/images/icons/close.png new file mode 100644 index 00000000..a723b3ea Binary files /dev/null and b/src/assets/images/icons/close.png differ diff --git a/src/assets/styles/bootstrap/_accordion.scss b/src/assets/styles/bootstrap/_accordion.scss new file mode 100644 index 00000000..ae1ca0fb --- /dev/null +++ b/src/assets/styles/bootstrap/_accordion.scss @@ -0,0 +1,116 @@ +// +// Base styles +// + +.accordion-button { + position: relative; + display: flex; + align-items: center; + width: 100%; + padding: $accordion-button-padding-y $accordion-button-padding-x; + @include font-size($font-size-base); + color: $accordion-button-color; + text-align: left; // Reset button style + background-color: $accordion-button-bg; + border: 0; + @include border-radius(0); + overflow-anchor: none; + @include transition($accordion-transition); + + &:not(.collapsed) { + color: $accordion-button-active-color; + background-color: $accordion-button-active-bg; + box-shadow: inset 0 ($accordion-border-width * -1) 0 $accordion-border-color; + + &::after { + background-image: escape-svg($accordion-button-active-icon); + transform: $accordion-icon-transform; + } + } + + // Accordion icon + &::after { + flex-shrink: 0; + width: $accordion-icon-width; + height: $accordion-icon-width; + margin-left: auto; + content: ""; + background-image: escape-svg($accordion-button-icon); + background-repeat: no-repeat; + background-size: $accordion-icon-width; + @include transition($accordion-icon-transition); + } + + &:hover { + z-index: 2; + } + + &:focus { + z-index: 3; + border-color: $accordion-button-focus-border-color; + outline: 0; + box-shadow: $accordion-button-focus-box-shadow; + } +} + +.accordion-header { + margin-bottom: 0; +} + +.accordion-item { + margin-bottom: -$accordion-border-width; + background-color: $accordion-bg; + border: $accordion-border-width solid $accordion-border-color; + + &:first-of-type { + @include border-top-radius($accordion-border-radius); + + .accordion-button { + @include border-top-radius($accordion-inner-border-radius); + } + } + + // Only set a border-radius on the last item if the accordion is collapsed + &:last-of-type { + margin-bottom: 0; + @include border-bottom-radius($accordion-border-radius); + + .accordion-button { + &.collapsed { + @include border-bottom-radius($accordion-inner-border-radius); + } + } + + .accordion-collapse { + @include border-bottom-radius($accordion-border-radius); + } + } +} + +.accordion-body { + padding: $accordion-body-padding-y $accordion-body-padding-x; +} + + +// Flush accordion items +// +// Remove borders and border-radius to keep accordion items edge-to-edge. + +.accordion-flush { + .accordion-collapse { + border-width: 0; + } + + .accordion-item { + border-right: 0; + border-left: 0; + @include border-radius(0); + + &:first-child { border-top: 0; } + &:last-child { border-bottom: 0; } + + .accordion-button { + @include border-radius(0); + } + } +} diff --git a/src/assets/styles/bootstrap/_alert.scss b/src/assets/styles/bootstrap/_alert.scss index 4aa1fc20..34f1e84e 100644 --- a/src/assets/styles/bootstrap/_alert.scss +++ b/src/assets/styles/bootstrap/_alert.scss @@ -27,26 +27,31 @@ // Expand the right padding and account for the close button's positioning. .alert-dismissible { - padding-right: $close-font-size + $alert-padding-x * 2; + padding-right: $alert-dismissible-padding-r; // Adjust close link position - .close { + .btn-close { position: absolute; top: 0; right: 0; - z-index: 2; - padding: $alert-padding-y $alert-padding-x; - color: inherit; + z-index: $stretched-link-z-index + 1; + padding: $alert-padding-y * 1.25 $alert-padding-x; } } -// Alternate styles -// +// scss-docs-start alert-modifiers // Generate contextual modifier classes for colorizing the alert. -@each $color, $value in $theme-colors { - .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)); +@each $state, $value in $theme-colors { + $alert-background: shift-color($value, $alert-bg-scale); + $alert-border: shift-color($value, $alert-border-scale); + $alert-color: shift-color($value, $alert-color-scale); + @if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) { + $alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale)); + } + .alert-#{$state} { + @include alert-variant($alert-background, $alert-border, $alert-color); } } +// scss-docs-end alert-modifiers diff --git a/src/assets/styles/bootstrap/_badge.scss b/src/assets/styles/bootstrap/_badge.scss index e6acd037..08df1b84 100644 --- a/src/assets/styles/bootstrap/_badge.scss +++ b/src/assets/styles/bootstrap/_badge.scss @@ -8,17 +8,13 @@ padding: $badge-padding-y $badge-padding-x; @include font-size($badge-font-size); font-weight: $badge-font-weight; + line-height: 1; + color: $badge-color; text-align: center; white-space: nowrap; vertical-align: baseline; @include border-radius($badge-border-radius); - @include transition($badge-transition); - - @at-root a#{&} { - @include hover-focus() { - text-decoration: none; - } - } + @include gradient-bg(); // Empty badges collapse automatically &:empty { @@ -29,24 +25,5 @@ // Quick fix for badges in buttons .btn .badge { position: relative; -} - -// Pill badges -// -// Make them extra rounded with a modifier to replace v3's badges. - -.badge-pill { - padding-right: $badge-pill-padding-x; - padding-left: $badge-pill-padding-x; - @include border-radius($badge-pill-border-radius); -} - -// Colors -// -// Contextual variations (linked badges get darker on :hover). - -@each $color, $value in $theme-colors { - .badge-#{$color} { - @include badge-variant($value); - } + top: -1px; } diff --git a/src/assets/styles/bootstrap/_breadcrumb.scss b/src/assets/styles/bootstrap/_breadcrumb.scss index a0cf7e29..f7fafe74 100644 --- a/src/assets/styles/bootstrap/_breadcrumb.scss +++ b/src/assets/styles/bootstrap/_breadcrumb.scss @@ -10,34 +10,18 @@ } .breadcrumb-item { - display: flex; - // The separator between breadcrumbs (by default, a forward-slash: "/") + .breadcrumb-item { - padding-left: $breadcrumb-item-padding; + padding-left: $breadcrumb-item-padding-x; &::before { - display: inline-block; // Suppress underlining of the separator in modern browsers - padding-right: $breadcrumb-item-padding; + float: left; // Suppress inline spacings and underlining of the separator + padding-right: $breadcrumb-item-padding-x; color: $breadcrumb-divider-color; - content: escape-svg($breadcrumb-divider); + content: var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"}; } } - // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built - // without `