Skip to content

Commit

Permalink
[TASK] Upgrade bootstrap to 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Aug 9, 2021
1 parent 34fb30a commit 2ff1b43
Show file tree
Hide file tree
Showing 32 changed files with 1,722 additions and 521 deletions.
6 changes: 3 additions & 3 deletions Build/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"devDependencies": {
"bootstrap4": "npm:bootstrap@^4.6.0",
"bootstrap5": "npm:bootstrap@^5.0.2",
"bootstrap5": "npm:bootstrap@^5.1.0",
"chalk": "^4.1.2",
"cookieconsent": "^3.1.1",
"fantasticon": "^1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions Resources/Public/Contrib/bootstrap5/js/bootstrap.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Resources/Public/Contrib/bootstrap5/scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
background-clip: border-box;
border: $card-border-width solid $card-border-color;
@include border-radius($card-border-radius);
@include box-shadow($card-box-shadow);

> hr {
margin-right: 0;
Expand Down Expand Up @@ -65,7 +66,7 @@

.card-link {
&:hover {
text-decoration: none;
text-decoration: if($link-hover-decoration == underline, none, null);
}

+ .card-link {
Expand Down
57 changes: 45 additions & 12 deletions Resources/Public/Contrib/bootstrap5/scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,41 @@
}
}

// Colors
@function to-rgb($value) {
@return red($value), green($value), blue($value);
}

@function rgba-css-var($identifier, $target) {
@return rgba(var(--#{$variable-prefix}#{$identifier}-rgb), var(--#{$variable-prefix}#{$target}-opacity));
}

// stylelint-disable scss/dollar-variable-pattern
@function map-loop($map, $func, $args...) {
$_map: ();

@each $key, $value in $map {
// allow to pass the $key and $value of the map as an function argument
$_args: ();
@each $arg in $args {
$_args: append($_args, if($arg == "$key", $key, if($arg == "$value", $value, $arg)));
}

$_map: map-merge($_map, ($key: call(get-function($func), $_args...)));
}

@return $_map;
}
// stylelint-enable scss/dollar-variable-pattern

@function varify($list) {
$result: null;
@each $entry in $list {
$result: append($result, var(--#{$variable-prefix}#{$entry}), space);
}
@return $result;
}

// Internal Bootstrap function to turn maps into its negative variant.
// It prefixes the keys with `n` and makes the value negative.
@function negativify-map($map) {
Expand All @@ -55,6 +90,16 @@
@return $result;
}

// Merge multiple maps
@function map-merge-multiple($maps...) {
$merged-maps: ();

@each $map in $maps {
$merged-maps: map-merge($merged-maps, $map);
}
@return $merged-maps;
}

// Replace `$search` with `$replace` in `$string`
// Used on our SVG icon backgrounds for custom forms.
//
Expand Down Expand Up @@ -181,14 +226,6 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
@return $value1 + $value2;
}

@if type-of($value1) != number {
$value1: unquote("(") + $value1 + unquote(")");
}

@if type-of($value2) != number {
$value2: unquote("(") + $value2 + unquote(")");
}

@return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
}

Expand All @@ -209,10 +246,6 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
@return $value1 - $value2;
}

@if type-of($value1) != number {
$value1: unquote("(") + $value1 + unquote(")");
}

@if type-of($value2) != number {
$value2: unquote("(") + $value2 + unquote(")");
}
Expand Down
11 changes: 11 additions & 0 deletions Resources/Public/Contrib/bootstrap5/scss/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
}
}

@if $enable-cssgrid {
.grid {
display: grid;
grid-template-rows: repeat(var(--#{$variable-prefix}rows, 1), 1fr);
grid-template-columns: repeat(var(--#{$variable-prefix}columns, #{$grid-columns}), 1fr);
gap: var(--#{$variable-prefix}gap, #{$grid-gutter-width});

@include make-cssgrid();
}
}


// Columns
//
Expand Down
2 changes: 2 additions & 0 deletions Resources/Public/Contrib/bootstrap5/scss/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@import "helpers/colored-links";
@import "helpers/ratio";
@import "helpers/position";
@import "helpers/stacks";
@import "helpers/visually-hidden";
@import "helpers/stretched-link";
@import "helpers/text-truncation";
@import "helpers/vr";
1 change: 1 addition & 0 deletions Resources/Public/Contrib/bootstrap5/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

// Components
@import "mixins/alert";
@import "mixins/backdrop";
@import "mixins/buttons";
@import "mixins/caret";
@import "mixins/pagination";
Expand Down
12 changes: 1 addition & 11 deletions Resources/Public/Contrib/bootstrap5/scss/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,7 @@

// Modal background
.modal-backdrop {
position: fixed;
top: 0;
left: 0;
z-index: $zindex-modal-backdrop;
width: 100vw;
height: 100vh;
background-color: $modal-backdrop-bg;

// Fade for backdrop
&.fade { opacity: 0; }
&.show { opacity: $modal-backdrop-opacity; }
@include overlay-backdrop($zindex-modal-backdrop, $modal-backdrop-bg, $modal-backdrop-opacity);
}

// Modal header
Expand Down
31 changes: 30 additions & 1 deletion Resources/Public/Contrib/bootstrap5/scss/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,42 @@
.navbar-toggler {
display: none;
}

.offcanvas-header {
display: none;
}

.offcanvas {
position: inherit;
bottom: 0;
z-index: 1000;
flex-grow: 1;
visibility: visible !important; // stylelint-disable-line declaration-no-important
background-color: transparent;
border-right: 0;
border-left: 0;
@include transition(none);
transform: none;
}
.offcanvas-top,
.offcanvas-bottom {
height: auto;
border-top: 0;
border-bottom: 0;
}

.offcanvas-body {
display: flex;
flex-grow: 0;
padding: 0;
overflow-y: visible;
}
}
}
}
}
// scss-docs-end navbar-expand-loop


// Navbar themes
//
// Styles for switching between navbars with light or dark background.
Expand Down
4 changes: 4 additions & 0 deletions Resources/Public/Contrib/bootstrap5/scss/_offcanvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
@include transition(transform $offcanvas-transition-duration ease-in-out);
}

.offcanvas-backdrop {
@include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity);
}

.offcanvas-header {
display: flex;
align-items: center;
Expand Down
51 changes: 51 additions & 0 deletions Resources/Public/Contrib/bootstrap5/scss/_placeholders.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.placeholder {
display: inline-block;
min-height: 1em;
vertical-align: middle;
cursor: wait;
background-color: currentColor;
opacity: $placeholder-opacity-max;

&.btn::before {
display: inline-block;
content: "";
}
}

// Sizing
.placeholder-xs {
min-height: .6em;
}

.placeholder-sm {
min-height: .8em;
}

.placeholder-lg {
min-height: 1.2em;
}

// Animation
.placeholder-glow {
.placeholder {
animation: placeholder-glow 2s ease-in-out infinite;
}
}

@keyframes placeholder-glow {
50% {
opacity: $placeholder-opacity-min;
}
}

.placeholder-wave {
mask-image: linear-gradient(130deg, $black 55%, rgba(0, 0, 0, (1 - $placeholder-opacity-min)) 75%, $black 95%);
mask-size: 200% 100%;
animation: placeholder-wave 2s linear infinite;
}

@keyframes placeholder-wave {
100% {
mask-position: -200% 0%;
}
}
20 changes: 12 additions & 8 deletions Resources/Public/Contrib/bootstrap5/scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
// null by default, thus nothing is generated.

:root {
font-size: $font-size-root;
@if $font-size-root != null {
font-size: var(--#{$variable-prefix}-root-font-size);
}

@if $enable-smooth-scroll {
@media (prefers-reduced-motion: no-preference) {
Expand All @@ -43,18 +45,20 @@
// 3. Prevent adjustments of font size after orientation changes in iOS.
// 4. Change the default tap highlight to be completely transparent in iOS.

// scss-docs-start reboot-body-rules
body {
margin: 0; // 1
font-family: $font-family-base;
@include font-size($font-size-base);
font-weight: $font-weight-base;
line-height: $line-height-base;
color: $body-color;
text-align: $body-text-align;
background-color: $body-bg; // 2
font-family: var(--#{$variable-prefix}body-font-family);
@include font-size(var(--#{$variable-prefix}body-font-size));
font-weight: var(--#{$variable-prefix}body-font-weight);
line-height: var(--#{$variable-prefix}body-line-height);
color: var(--#{$variable-prefix}body-color);
text-align: var(--#{$variable-prefix}body-text-align);
background-color: var(--#{$variable-prefix}body-bg); // 2
-webkit-text-size-adjust: 100%; // 3
-webkit-tap-highlight-color: rgba($black, 0); // 4
}
// scss-docs-end reboot-body-rules


// Content grouping
Expand Down
41 changes: 39 additions & 2 deletions Resources/Public/Contrib/bootstrap5/scss/_root.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
:root {
// Custom variable values only support SassScript inside `#{}`.
// Note: Custom variable values only support SassScript inside `#{}`.

// Colors
//
// Generate palettes for full colors, grays, and theme colors.

@each $color, $value in $colors {
--#{$variable-prefix}#{$color}: #{$value};
}

@each $color, $value in $grays {
--#{$variable-prefix}gray-#{$color}: #{$value};
}

@each $color, $value in $theme-colors {
--#{$variable-prefix}#{$color}: #{$value};
}

// Use `inspect` for lists so that quoted items keep the quotes.
@each $color, $value in $theme-colors-rgb {
--#{$variable-prefix}#{$color}-rgb: #{$value};
}

--#{$variable-prefix}white-rgb: #{to-rgb($white)};
--#{$variable-prefix}black-rgb: #{to-rgb($black)};
--#{$variable-prefix}body-rgb: #{to-rgb($body-color)};

// Fonts

// Note: Use `inspect` for lists so that quoted items keep the quotes.
// See https://github.com/sass/sass/issues/2383#issuecomment-336349172
--#{$variable-prefix}font-sans-serif: #{inspect($font-family-sans-serif)};
--#{$variable-prefix}font-monospace: #{inspect($font-family-monospace)};
--#{$variable-prefix}gradient: #{$gradient};

// Root and body
// stylelint-disable custom-property-empty-line-before
// scss-docs-start root-body-variables
@if $font-size-root != null {
--#{$variable-prefix}root-font-size: #{$font-size-root};
}
--#{$variable-prefix}body-font-family: #{$font-family-base};
--#{$variable-prefix}body-font-size: #{$font-size-base};
--#{$variable-prefix}body-font-weight: #{$font-weight-base};
--#{$variable-prefix}body-line-height: #{$line-height-base};
--#{$variable-prefix}body-color: #{$body-color};
@if $body-text-align != null {
--#{$variable-prefix}body-text-align: #{$body-text-align};
}
--#{$variable-prefix}body-bg: #{$body-bg};
// scss-docs-end root-body-variables
// stylelint-enable custom-property-empty-line-before
}
4 changes: 2 additions & 2 deletions Resources/Public/Contrib/bootstrap5/scss/_toasts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
box-shadow: $toast-box-shadow;
@include border-radius($toast-border-radius);

&:not(.showing):not(.show) {
&.showing {
opacity: 0;
}

&.hide {
&:not(.show) {
display: none;
}
}
Expand Down
Loading

0 comments on commit 2ff1b43

Please sign in to comment.