Skip to content

Commit

Permalink
Merge pull request #191 from ELIXIR-Belgium/bootstrap-5.3.1
Browse files Browse the repository at this point in the history
Update Bootstrap to v5.3.1 and other assets updates
  • Loading branch information
bedroesb authored Jul 26, 2023
2 parents 79c0901 + 7a84b18 commit 1d75543
Show file tree
Hide file tree
Showing 65 changed files with 1,821 additions and 582 deletions.
9 changes: 9 additions & 0 deletions _sass/bootstrap/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,12 @@
}
}
}

@if $enable-dark-mode {
@include color-mode(dark) {
.accordion-button::after {
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)};
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)};
}
}
}
19 changes: 8 additions & 11 deletions _sass/bootstrap/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
--#{$prefix}alert-border-color: transparent;
--#{$prefix}alert-border: #{$alert-border-width} solid var(--#{$prefix}alert-border-color);
--#{$prefix}alert-border-radius: #{$alert-border-radius};
--#{$prefix}alert-link-color: inherit;
// scss-docs-end alert-css-vars

position: relative;
Expand All @@ -32,6 +33,7 @@
// Provide class for links that match alerts
.alert-link {
font-weight: $alert-link-font-weight;
color: var(--#{$prefix}alert-link-color);
}


Expand All @@ -54,18 +56,13 @@


// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert.

@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));
}
// Generate contextual modifier classes for colorizing the alert
@each $state in map-keys($theme-colors) {
.alert-#{$state} {
@include alert-variant($alert-background, $alert-border, $alert-color);
--#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}alert-border-color: var(--#{$prefix}#{$state}-border-subtle);
--#{$prefix}alert-link-color: var(--#{$prefix}#{$state}-text-emphasis);
}
}
// scss-docs-end alert-modifiers
4 changes: 2 additions & 2 deletions _sass/bootstrap/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Prevent double borders when buttons are next to each other
> :not(.btn-check:first-child) + .btn,
> .btn-group:not(:first-child) {
margin-left: -$btn-border-width;
margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list
}

// Reset rounded corners
Expand Down Expand Up @@ -126,7 +126,7 @@

> .btn:not(:first-child),
> .btn-group:not(:first-child) {
margin-top: -$btn-border-width;
margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list
}

// Reset rounded corners
Expand Down
6 changes: 3 additions & 3 deletions _sass/bootstrap/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@include rfs($btn-font-size, --#{$prefix}btn-font-size);
--#{$prefix}btn-font-weight: #{$btn-font-weight};
--#{$prefix}btn-line-height: #{$btn-line-height};
--#{$prefix}btn-color: #{$body-color};
--#{$prefix}btn-color: #{$btn-color};
--#{$prefix}btn-bg: transparent;
--#{$prefix}btn-border-width: #{$btn-border-width};
--#{$prefix}btn-border-color: transparent;
Expand Down Expand Up @@ -169,8 +169,8 @@
--#{$prefix}btn-active-border-color: transparent;
--#{$prefix}btn-disabled-color: #{$btn-link-disabled-color};
--#{$prefix}btn-disabled-border-color: transparent;
--#{$prefix}btn-box-shadow: none;
--#{$prefix}btn-focus-shadow-rgb: #{to-rgb(mix(color-contrast($primary), $primary, 15%))};
--#{$prefix}btn-box-shadow: 0 0 0 #000; // Can't use `none` as keyword negates all values when used with multiple shadows
--#{$prefix}btn-focus-shadow-rgb: #{to-rgb(mix(color-contrast($link-color), $link-color, 15%))};

text-decoration: $link-decoration;
@if $enable-gradients {
Expand Down
5 changes: 5 additions & 0 deletions _sass/bootstrap/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
--#{$prefix}card-spacer-y: #{$card-spacer-y};
--#{$prefix}card-spacer-x: #{$card-spacer-x};
--#{$prefix}card-title-spacer-y: #{$card-title-spacer-y};
--#{$prefix}card-title-color: #{$card-title-color};
--#{$prefix}card-subtitle-color: #{$card-subtitle-color};
--#{$prefix}card-border-width: #{$card-border-width};
--#{$prefix}card-border-color: #{$card-border-color};
--#{$prefix}card-border-radius: #{$card-border-radius};
Expand All @@ -28,6 +30,7 @@
flex-direction: column;
min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106
height: var(--#{$prefix}card-height);
color: var(--#{$prefix}body-color);
word-wrap: break-word;
background-color: var(--#{$prefix}card-bg);
background-clip: border-box;
Expand Down Expand Up @@ -73,11 +76,13 @@

.card-title {
margin-bottom: var(--#{$prefix}card-title-spacer-y);
color: var(--#{$prefix}card-title-color);
}

.card-subtitle {
margin-top: calc(-.5 * var(--#{$prefix}card-title-spacer-y)); // stylelint-disable-line function-disallowed-list
margin-bottom: 0;
color: var(--#{$prefix}card-subtitle-color);
}

.card-text:last-child {
Expand Down
22 changes: 20 additions & 2 deletions _sass/bootstrap/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
margin-right: $carousel-control-width;
margin-bottom: 1rem;
margin-left: $carousel-control-width;
list-style: none;

[data-bs-target] {
box-sizing: content-box;
Expand Down Expand Up @@ -210,7 +209,7 @@

// Dark mode carousel

.carousel-dark {
@mixin carousel-dark() {
.carousel-control-prev-icon,
.carousel-control-next-icon {
filter: $carousel-dark-control-icon-filter;
Expand All @@ -224,3 +223,22 @@
color: $carousel-dark-caption-color;
}
}

.carousel-dark {
@include carousel-dark();
}

@if $enable-dark-mode {
@include color-mode(dark) {
@if $color-mode-type == "media-query" {
.carousel {
@include carousel-dark();
}
} @else {
.carousel,
&.carousel {
@include carousel-dark();
}
}
}
}
41 changes: 32 additions & 9 deletions _sass/bootstrap/_close.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,60 @@
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile

.btn-close {
// scss-docs-start close-css-vars
--#{$prefix}btn-close-color: #{$btn-close-color};
--#{$prefix}btn-close-bg: #{ escape-svg($btn-close-bg) };
--#{$prefix}btn-close-opacity: #{$btn-close-opacity};
--#{$prefix}btn-close-hover-opacity: #{$btn-close-hover-opacity};
--#{$prefix}btn-close-focus-shadow: #{$btn-close-focus-shadow};
--#{$prefix}btn-close-focus-opacity: #{$btn-close-focus-opacity};
--#{$prefix}btn-close-disabled-opacity: #{$btn-close-disabled-opacity};
--#{$prefix}btn-close-white-filter: #{$btn-close-white-filter};
// scss-docs-end close-css-vars

box-sizing: content-box;
width: $btn-close-width;
height: $btn-close-height;
padding: $btn-close-padding-y $btn-close-padding-x;
color: $btn-close-color;
background: transparent escape-svg($btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements
color: var(--#{$prefix}btn-close-color);
background: transparent var(--#{$prefix}btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements
border: 0; // for button elements
@include border-radius();
opacity: $btn-close-opacity;
opacity: var(--#{$prefix}btn-close-opacity);

// Override <a>'s hover style
&:hover {
color: $btn-close-color;
color: var(--#{$prefix}btn-close-color);
text-decoration: none;
opacity: $btn-close-hover-opacity;
opacity: var(--#{$prefix}btn-close-hover-opacity);
}

&:focus {
outline: 0;
box-shadow: $btn-close-focus-shadow;
opacity: $btn-close-focus-opacity;
box-shadow: var(--#{$prefix}btn-close-focus-shadow);
opacity: var(--#{$prefix}btn-close-focus-opacity);
}

&:disabled,
&.disabled {
pointer-events: none;
user-select: none;
opacity: $btn-close-disabled-opacity;
opacity: var(--#{$prefix}btn-close-disabled-opacity);
}
}

@mixin btn-close-white() {
filter: var(--#{$prefix}btn-close-white-filter);
}

.btn-close-white {
filter: $btn-close-white-filter;
@include btn-close-white();
}

@if $enable-dark-mode {
@include color-mode(dark) {
.btn-close {
@include btn-close-white();
}
}
}
1 change: 1 addition & 0 deletions _sass/bootstrap/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
white-space: nowrap; // prevent links from randomly breaking onto new lines
background-color: transparent; // For `<button>`s
border: 0; // For `<button>`s
@include border-radius(var(--#{$prefix}dropdown-item-border-radius, 0));

&:hover,
&:focus {
Expand Down
2 changes: 1 addition & 1 deletion _sass/bootstrap/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
);

@each $name, $value in $rgb {
$value: if(divide($value, 255) < .03928, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
$value: if(divide($value, 255) < .04045, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
$rgb: map-merge($rgb, ($name: $value));
}

Expand Down
6 changes: 6 additions & 0 deletions _sass/bootstrap/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
//
// Rows contain your columns.

:root {
@each $name, $value in $grid-breakpoints {
--#{$prefix}breakpoint-#{$name}: #{$value};
}
}

@if $enable-grid-classes {
.row {
@include make-row();
Expand Down
2 changes: 2 additions & 0 deletions _sass/bootstrap/_helpers.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import "helpers/clearfix";
@import "helpers/color-bg";
@import "helpers/colored-links";
@import "helpers/focus-ring";
@import "helpers/icon-link";
@import "helpers/ratio";
@import "helpers/position";
@import "helpers/stacks";
Expand Down
19 changes: 12 additions & 7 deletions _sass/bootstrap/_list-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,18 @@
// Add modifier classes to change text and background color on individual items.
// Organizationally, this must come after the `:hover` states.

@each $state, $value in $theme-colors {
$list-group-variant-bg: shift-color($value, $list-group-item-bg-scale);
$list-group-variant-color: shift-color($value, $list-group-item-color-scale);
@if (contrast-ratio($list-group-variant-bg, $list-group-variant-color) < $min-contrast-ratio) {
$list-group-variant-color: mix($value, color-contrast($list-group-variant-bg), abs($list-group-item-color-scale));
@each $state in map-keys($theme-colors) {
.list-group-item-#{$state} {
--#{$prefix}list-group-color: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}list-group-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}list-group-border-color: var(--#{$prefix}#{$state}-border-subtle);
--#{$prefix}list-group-action-hover-color: var(--#{$prefix}emphasis-color);
--#{$prefix}list-group-action-hover-bg: var(--#{$prefix}#{$state}-border-subtle);
--#{$prefix}list-group-action-active-color: var(--#{$prefix}emphasis-color);
--#{$prefix}list-group-action-active-bg: var(--#{$prefix}#{$state}-border-subtle);
--#{$prefix}list-group-active-color: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}list-group-active-bg: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}list-group-active-border-color: var(--#{$prefix}#{$state}-text-emphasis);
}

@include list-group-item-variant($state, $list-group-variant-bg, $list-group-variant-color);
}
// scss-docs-end list-group-modifiers
Loading

0 comments on commit 1d75543

Please sign in to comment.