diff --git a/scss/_reboot.scss b/scss/_reboot.scss
index 81ea21617d02..901f4681d981 100644
--- a/scss/_reboot.scss
+++ b/scss/_reboot.scss
@@ -66,11 +66,11 @@ body {
// 1. Reset Firefox's gray color
hr {
- margin: $hr-margin-y 0;
- color: $hr-color; // 1
+ margin: var(--#{$prefix}hr-margin, $hr-margin-y 0);
+ color: var(--#{$prefix}hr-color, $hr-color); // 1
border: 0;
- border-top: $hr-border-width solid $hr-border-color;
- opacity: $hr-opacity;
+ border-top: var(--#{$prefix}hr-width, $hr-border-width) solid var(--#{$prefix}hr-border-color, $hr-border-color);
+ opacity: var(--#{$prefix}hr-opacity, $hr-opacity);
}
diff --git a/scss/_tables.scss b/scss/_tables.scss
index ebfc00a5c652..1b9bd9ab77d0 100644
--- a/scss/_tables.scss
+++ b/scss/_tables.scss
@@ -12,6 +12,7 @@
--#{$prefix}table-color: #{$table-color};
--#{$prefix}table-bg: #{$table-bg};
--#{$prefix}table-border-color: #{$table-border-color};
+ --#{$prefix}table-border-width: #{$table-border-width};
--#{$prefix}table-accent-bg: #{$table-accent-bg};
--#{$prefix}table-striped-color: #{$table-striped-color};
--#{$prefix}table-striped-bg: #{$table-striped-bg};
@@ -19,9 +20,10 @@
--#{$prefix}table-active-bg: #{$table-active-bg};
--#{$prefix}table-hover-color: #{$table-hover-color};
--#{$prefix}table-hover-bg: #{$table-hover-bg};
+ --#{$prefix}table-cell-padding: #{$table-cell-padding-y $table-cell-padding-x};
width: 100%;
- margin-bottom: $spacer;
+ margin-bottom: $table-margin-bottom;
vertical-align: $table-cell-vertical-align;
border-color: var(--#{$prefix}table-border-color);
@@ -31,11 +33,11 @@
// Another advantage is that this generates less code and makes the selector less specific making it easier to override.
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
- padding: $table-cell-padding-y $table-cell-padding-x;
+ padding: var(--#{$prefix}table-cell-padding);
// Following the precept of cascades: https://codepen.io/miriamsuzanne/full/vYNgodb
color: var(--#{$prefix}table-color-state, var(--#{$prefix}table-color-type, var(--#{$prefix}table-color)));
background-color: var(--#{$prefix}table-bg);
- border-bottom-width: $table-border-width;
+ border-bottom-width: var(--#{$prefix}table-border-width);
box-shadow: inset 0 0 0 9999px var(--#{$prefix}table-bg-state, var(--#{$prefix}table-bg-type, var(--#{$prefix}table-accent-bg)));
}
@@ -49,7 +51,7 @@
}
.table-group-divider {
- border-top: calc(#{$table-border-width} * 2) solid $table-group-separator-color; // stylelint-disable-line function-disallowed-list
+ border-top: calc(var(--#{$prefix}table-border-width) * 2) solid $table-group-separator-color; // stylelint-disable-line function-disallowed-list
}
//
@@ -66,10 +68,7 @@
//
.table-sm {
- // stylelint-disable-next-line selector-max-universal
- > :not(caption) > * > * {
- padding: $table-cell-padding-y-sm $table-cell-padding-x-sm;
- }
+ --#{$prefix}table-cell-padding: #{$table-cell-padding-y-sm $table-cell-padding-x-sm};
}
@@ -84,11 +83,11 @@
.table-bordered {
> :not(caption) > * {
- border-width: $table-border-width 0;
+ border-width: var(--#{$prefix}table-border-width) 0;
// stylelint-disable-next-line selector-max-universal
> * {
- border-width: 0 $table-border-width;
+ border-width: 0 var(--#{$prefix}table-border-width);
}
}
}
diff --git a/scss/_variables.scss b/scss/_variables.scss
index 7706c0f6a5e0..cf04680a0b5e 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -737,6 +737,7 @@ $table-cell-vertical-align: top !default;
$table-color: var(--#{$prefix}body-color) !default;
$table-bg: var(--#{$prefix}body-bg) !default;
$table-accent-bg: transparent !default;
+$table-margin-bottom: $spacer !default;
$table-th-font-weight: null !default;
@@ -935,6 +936,7 @@ $form-color-width: 3rem !default;
// scss-docs-start form-check-variables
$form-check-input-width: 1em !default;
+$form-check-input-height: $form-check-input-width !default;
$form-check-min-height: $font-size-base * $line-height-base !default;
$form-check-padding-start: $form-check-input-width + .5em !default;
$form-check-margin-bottom: .125rem !default;
@@ -978,7 +980,9 @@ $form-switch-border-radius: $form-switch-width !default;
$form-switch-transition: background-position .15s ease-in-out !default;
$form-switch-focus-color: $input-focus-border-color !default;
-$form-switch-focus-bg-image: url("data:image/svg+xml,") !default;
+// fusv-disable
+$form-switch-focus-bg-image: url("data:image/svg+xml,") !default; // Deprecated in 5.3.2
+// fusv-enable
$form-switch-checked-color: $component-active-color !default;
$form-switch-checked-bg-image: url("data:image/svg+xml,") !default;
diff --git a/scss/forms/_floating-labels.scss b/scss/forms/_floating-labels.scss
index 2cf04704da72..548d580c55a7 100644
--- a/scss/forms/_floating-labels.scss
+++ b/scss/forms/_floating-labels.scss
@@ -65,7 +65,7 @@
z-index: -1;
height: $form-floating-label-height;
content: "";
- background-color: $input-bg;
+ background-color: var(--#{$prefix}form-floating-input-bg, $input-bg);
@include border-radius($input-border-radius);
}
}
@@ -86,10 +86,7 @@
> :disabled ~ label,
> .form-control:disabled ~ label { // Required for `.form-control`s because of specificity
+ --#{$prefix}form-floating-input-bg: #{$input-disabled-bg};
color: $form-floating-label-disabled-color;
-
- &::after {
- background-color: $input-disabled-bg;
- }
}
}
diff --git a/scss/forms/_form-check.scss b/scss/forms/_form-check.scss
index f8d9b08f8ce7..45922fddd966 100644
--- a/scss/forms/_form-check.scss
+++ b/scss/forms/_form-check.scss
@@ -2,54 +2,30 @@
// Check/radio
//
-.form-check {
- display: block;
- min-height: $form-check-min-height;
- padding-left: $form-check-padding-start;
- margin-bottom: $form-check-margin-bottom;
-
- .form-check-input {
- float: left;
- margin-left: $form-check-padding-start * -1;
- }
-}
-
-.form-check-reverse {
- padding-right: $form-check-padding-start;
- padding-left: 0;
- text-align: right;
-
- .form-check-input {
- float: right;
- margin-right: $form-check-padding-start * -1;
- margin-left: 0;
- }
-}
-
.form-check-input {
- --#{$prefix}form-check-bg: #{$form-check-input-bg};
-
- width: $form-check-input-width;
- height: $form-check-input-width;
- margin-top: ($line-height-base - $form-check-input-width) * .5; // line-height minus check height
+ float: var(--#{$prefix}form-check-float, left);
+ width: var(--#{$prefix}form-check-input-width, $form-check-input-width);
+ height: var(--#{$prefix}form-check-input-height, $form-check-input-height);
+ margin: ($line-height-base - $form-check-input-width) * .5 var(--#{$prefix}form-check-input-margin-right, 0) 0 var(--#{$prefix}form-check-input-margin-left, 0); // line-height minus check height
vertical-align: top;
appearance: none;
- background-color: var(--#{$prefix}form-check-bg);
+ background-color: var(--#{$prefix}form-check-bg, $form-check-input-bg);
background-image: var(--#{$prefix}form-check-bg-image);
background-repeat: no-repeat;
- background-position: center;
+ background-position: var(--#{$prefix}form-check-bg-position, center);
background-size: contain;
border: $form-check-input-border;
print-color-adjust: exact; // Keep themed appearance for print
- @include transition($form-check-transition);
-
- &[type="checkbox"] {
- @include border-radius($form-check-input-border-radius);
- }
+ @include transition(var(--#{$prefix}form-check-transition, $form-check-transition));
+ border-radius: var(--#{$prefix}form-check-border-radius, $form-check-input-border-radius); // stylelint-disable-line property-disallowed-list
&[type="radio"] {
- // stylelint-disable-next-line property-disallowed-list
- border-radius: $form-check-radio-border-radius;
+ @if $enable-gradients {
+ --#{$prefix}form-check-checked-bg-image: #{escape-svg($form-check-radio-checked-bg-image)}, var(--#{$prefix}gradient);
+ } @else {
+ --#{$prefix}form-check-checked-bg-image: #{escape-svg($form-check-radio-checked-bg-image)};
+ }
+ --#{$prefix}form-check-border-radius: #{$form-check-radio-border-radius};
}
&:active {
@@ -59,28 +35,18 @@
&:focus {
border-color: $form-check-input-focus-border;
outline: 0;
- box-shadow: $form-check-input-focus-box-shadow;
+ box-shadow: var(--#{$prefix}form-check-focus-box-shadow, $form-check-input-focus-box-shadow);
}
&:checked {
- background-color: $form-check-input-checked-bg-color;
- border-color: $form-check-input-checked-border-color;
-
- &[type="checkbox"] {
- @if $enable-gradients {
- --#{$prefix}form-check-bg-image: #{escape-svg($form-check-input-checked-bg-image)}, var(--#{$prefix}gradient);
- } @else {
- --#{$prefix}form-check-bg-image: #{escape-svg($form-check-input-checked-bg-image)};
- }
- }
-
- &[type="radio"] {
- @if $enable-gradients {
- --#{$prefix}form-check-bg-image: #{escape-svg($form-check-radio-checked-bg-image)}, var(--#{$prefix}gradient);
- } @else {
- --#{$prefix}form-check-bg-image: #{escape-svg($form-check-radio-checked-bg-image)};
- }
+ background-color: var(--#{$prefix}form-check-checked-bg-color, $form-check-input-checked-bg-color);
+ @if $enable-gradients {
+ background-image: var(--#{$prefix}form-check-checked-bg-image, escape-svg($form-check-input-checked-bg-image), var(--#{$prefix}gradient));
+ } @else {
+ background-image: var(--#{$prefix}form-check-checked-bg-image, escape-svg($form-check-input-checked-bg-image));
}
+ background-position: var(--#{$prefix}form-check-checked-bg-position, center);
+ border-color: $form-check-input-checked-border-color;
}
&[type="checkbox"]:indeterminate {
@@ -111,6 +77,25 @@
}
}
+.form-check {
+ --#{$prefix}form-check-input-margin-left: #{-$form-check-padding-start};
+
+ display: block;
+ min-height: $form-check-min-height;
+ padding-left: $form-check-padding-start;
+ margin-bottom: $form-check-margin-bottom;
+}
+
+.form-check-reverse {
+ --#{$prefix}form-check-float: #{right};
+ --#{$prefix}form-check-input-margin-left: #{0};
+ --#{$prefix}form-check-input-margin-right: #{-$form-check-padding-start};
+
+ padding-right: $form-check-padding-start;
+ padding-left: 0;
+ text-align: right;
+}
+
.form-check-label {
color: $form-check-label-color;
cursor: $form-check-label-cursor;
@@ -121,41 +106,28 @@
//
.form-switch {
- padding-left: $form-switch-padding-start;
-
- .form-check-input {
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image)};
-
- width: $form-switch-width;
- margin-left: $form-switch-padding-start * -1;
- background-image: var(--#{$prefix}form-switch-bg);
- background-position: left center;
- @include border-radius($form-switch-border-radius);
- @include transition($form-switch-transition);
-
- &:focus {
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-focus-bg-image)};
- }
+ @if $enable-gradients {
+ --#{$prefix}form-check-checked-bg-image: #{escape-svg($form-switch-checked-bg-image)}, var(--#{$prefix}gradient);
+ } @else {
+ --#{$prefix}form-check-checked-bg-image: #{escape-svg($form-switch-checked-bg-image)};
+ }
- &:checked {
- background-position: $form-switch-checked-bg-position;
+ --#{$prefix}form-check-input-width: #{$form-switch-width};
+ --#{$prefix}form-check-input-margin-left: #{-$form-switch-padding-start};
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-switch-bg-image)};
+ --#{$prefix}form-check-bg-position: #{left center};
+ --#{$prefix}form-check-checked-bg-position: #{$form-switch-checked-bg-position};
+ --#{$prefix}form-check-transition: #{$form-switch-transition};
+ --#{$prefix}form-check-border-radius: #{$form-switch-border-radius};
- @if $enable-gradients {
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-checked-bg-image)}, var(--#{$prefix}gradient);
- } @else {
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-checked-bg-image)};
- }
- }
- }
+ padding-left: $form-switch-padding-start;
&.form-check-reverse {
+ --#{$prefix}form-check-input-margin-left: #{0};
+ --#{$prefix}form-check-input-margin-right: #{-$form-switch-padding-start};
+
padding-right: $form-switch-padding-start;
padding-left: 0;
-
- .form-check-input {
- margin-right: $form-switch-padding-start * -1;
- margin-left: 0;
- }
}
}
@@ -181,8 +153,8 @@
@if $enable-dark-mode {
@include color-mode(dark) {
- .form-switch .form-check-input:not(:checked):not(:focus) {
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
+ .form-switch .form-check-input:not(:checked) {
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-switch-bg-image-dark)};
}
}
}
diff --git a/scss/forms/_form-control.scss b/scss/forms/_form-control.scss
index 67ae5f4f9038..c80345fac62b 100644
--- a/scss/forms/_form-control.scss
+++ b/scss/forms/_form-control.scss
@@ -3,9 +3,16 @@
//
.form-control {
+ // scss-docs-start form-control-css-vars
+ --#{$prefix}form-control-min-height: #{$input-height};
+ --#{$prefix}form-control-padding-y: #{$input-padding-y};
+ --#{$prefix}form-control-padding-x: #{$input-padding-x};
+ // scss-docs-end form-control-css-vars
+
display: block;
width: 100%;
- padding: $input-padding-y $input-padding-x;
+ min-height: var(--#{$prefix}form-control-min-height);
+ padding: var(--#{$prefix}form-control-padding-y) var(--#{$prefix}form-control-padding-x);
font-family: $input-font-family;
@include font-size($input-font-size);
font-weight: $input-font-weight;
@@ -14,7 +21,7 @@
appearance: none; // Fix appearance for date inputs in Safari
background-color: $input-bg;
background-clip: padding-box;
- border: $input-border-width solid $input-border-color;
+ border: $input-border-width solid var(--#{$prefix}input-border-color, $input-border-color);
// Note: This has no effect on