From acf6ea74a74328bcaa9f1c354f27e602cfbb8968 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 13 Mar 2022 10:13:09 -0700 Subject: [PATCH] Add additional root variables, rename `$variable-prefix` to `$prefix` (#35981) * Add additional root variables, rename $variable-prefix to $prefix - Adds new root CSS variables for border-radius, border-width, border-color, and border-style - Adds new root CSS variables for heading-color, link-colors, code color, and highlight color - Replaces most instances of Sass variables (for border-radius, border-color, border-style, and border-width) for CSS variables inside _variables.scss - Updates $mark-padding to be an even pixel number - Renames $variable-prefix to $prefix throughout * Bundlewatch --- .bundlewatch.config.json | 8 +- scss/_alert.scss | 28 ++-- scss/_badge.scss | 22 +-- scss/_breadcrumb.scss | 38 +++--- scss/_buttons.scss | 104 +++++++------- scss/_dropdown.scss | 128 +++++++++--------- scss/_functions.scss | 8 +- scss/_grid.scss | 6 +- scss/_navbar.scss | 104 +++++++------- scss/_pagination.scss | 78 +++++------ scss/_popover.scss | 120 ++++++++-------- scss/_reboot.scss | 26 ++-- scss/_root.scss | 67 +++++---- scss/_tables.scss | 44 +++--- scss/_tooltip.scss | 78 +++++------ scss/_utilities.scss | 36 ++--- scss/_variables.scss | 98 +++++++------- scss/forms/_form-check.scss | 8 +- scss/helpers/_ratio.scss | 4 +- scss/mixins/_alert.scss | 8 +- scss/mixins/_buttons.scss | 62 ++++----- scss/mixins/_container.scss | 8 +- scss/mixins/_gradients.scss | 2 +- scss/mixins/_grid.scss | 20 +-- scss/mixins/_pagination.scss | 8 +- scss/mixins/_table-variants.scss | 22 +-- scss/mixins/_utilities.scss | 6 +- site/assets/scss/_component-examples.scss | 4 +- .../docs/5.1/customize/css-variables.md | 2 +- 29 files changed, 581 insertions(+), 566 deletions(-) diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json index c408f65811..eff437cee5 100644 --- a/.bundlewatch.config.json +++ b/.bundlewatch.config.json @@ -6,11 +6,11 @@ }, { "path": "./dist/css/bootstrap-grid.min.css", - "maxSize": "6.5 kB" + "maxSize": "6.55 kB" }, { "path": "./dist/css/bootstrap-reboot.css", - "maxSize": "2.5 kB" + "maxSize": "2.55 kB" }, { "path": "./dist/css/bootstrap-reboot.min.css", @@ -26,11 +26,11 @@ }, { "path": "./dist/css/bootstrap.css", - "maxSize": "26.4 kB" + "maxSize": "26.6 kB" }, { "path": "./dist/css/bootstrap.min.css", - "maxSize": "24.5 kB" + "maxSize": "24.65 kB" }, { "path": "./dist/js/bootstrap.bundle.js", diff --git a/scss/_alert.scss b/scss/_alert.scss index 316f3c5ad0..0e7dbe60d1 100644 --- a/scss/_alert.scss +++ b/scss/_alert.scss @@ -4,23 +4,23 @@ .alert { // scss-docs-start alert-css-vars - --#{$variable-prefix}alert-bg: transparent; - --#{$variable-prefix}alert-padding-x: #{$alert-padding-x}; - --#{$variable-prefix}alert-padding-y: #{$alert-padding-y}; - --#{$variable-prefix}alert-margin-bottom: #{$alert-margin-bottom}; - --#{$variable-prefix}alert-color: inherit; - --#{$variable-prefix}alert-border-color: transparent; - --#{$variable-prefix}alert-border: #{$alert-border-width} solid var(--#{$variable-prefix}alert-border-color); - --#{$variable-prefix}alert-border-radius: #{$alert-border-radius}; + --#{$prefix}alert-bg: transparent; + --#{$prefix}alert-padding-x: #{$alert-padding-x}; + --#{$prefix}alert-padding-y: #{$alert-padding-y}; + --#{$prefix}alert-margin-bottom: #{$alert-margin-bottom}; + --#{$prefix}alert-color: inherit; + --#{$prefix}alert-border-color: transparent; + --#{$prefix}alert-border: #{$alert-border-width} solid var(--#{$prefix}alert-border-color); + --#{$prefix}alert-border-radius: #{$alert-border-radius}; // scss-docs-end alert-css-vars position: relative; - padding: var(--#{$variable-prefix}alert-padding-y) var(--#{$variable-prefix}alert-padding-x); - margin-bottom: var(--#{$variable-prefix}alert-margin-bottom); - color: var(--#{$variable-prefix}alert-color); - background-color: var(--#{$variable-prefix}alert-bg); - border: var(--#{$variable-prefix}alert-border); - border-radius: var(--#{$variable-prefix}alert-border-radius, 0); // stylelint-disable-line property-disallowed-list + padding: var(--#{$prefix}alert-padding-y) var(--#{$prefix}alert-padding-x); + margin-bottom: var(--#{$prefix}alert-margin-bottom); + color: var(--#{$prefix}alert-color); + background-color: var(--#{$prefix}alert-bg); + border: var(--#{$prefix}alert-border); + border-radius: var(--#{$prefix}alert-border-radius, 0); // stylelint-disable-line property-disallowed-list } // Headings for larger alerts diff --git a/scss/_badge.scss b/scss/_badge.scss index 3e9fef14c7..33cfd99862 100644 --- a/scss/_badge.scss +++ b/scss/_badge.scss @@ -7,24 +7,24 @@ .badge { // scss-docs-start badge-css-vars - --#{$variable-prefix}badge-padding-x: #{$badge-padding-x}; - --#{$variable-prefix}badge-padding-y: #{$badge-padding-y}; - @include rfs($badge-font-size, --#{$variable-prefix}badge-font-size); - --#{$variable-prefix}badge-font-weight: #{$badge-font-weight}; - --#{$variable-prefix}badge-color: #{$badge-color}; - --#{$variable-prefix}badge-border-radius: #{$badge-border-radius}; + --#{$prefix}badge-padding-x: #{$badge-padding-x}; + --#{$prefix}badge-padding-y: #{$badge-padding-y}; + @include rfs($badge-font-size, --#{$prefix}badge-font-size); + --#{$prefix}badge-font-weight: #{$badge-font-weight}; + --#{$prefix}badge-color: #{$badge-color}; + --#{$prefix}badge-border-radius: #{$badge-border-radius}; // scss-docs-end badge-css-vars display: inline-block; - padding: var(--#{$variable-prefix}badge-padding-y) var(--#{$variable-prefix}badge-padding-x); - font-size: var(--#{$variable-prefix}badge-font-size); - font-weight: var(--#{$variable-prefix}badge-font-weight); + padding: var(--#{$prefix}badge-padding-y) var(--#{$prefix}badge-padding-x); + font-size: var(--#{$prefix}badge-font-size); + font-weight: var(--#{$prefix}badge-font-weight); line-height: 1; - color: var(--#{$variable-prefix}badge-color); + color: var(--#{$prefix}badge-color); text-align: center; white-space: nowrap; vertical-align: baseline; - border-radius: var(--#{$variable-prefix}badge-border-radius, 0); // stylelint-disable-line property-disallowed-list + border-radius: var(--#{$prefix}badge-border-radius, 0); // stylelint-disable-line property-disallowed-list @include gradient-bg(); // Empty badges collapse automatically diff --git a/scss/_breadcrumb.scss b/scss/_breadcrumb.scss index 86890dc61a..7168fdb565 100644 --- a/scss/_breadcrumb.scss +++ b/scss/_breadcrumb.scss @@ -2,42 +2,42 @@ .breadcrumb { // scss-docs-start breadcrumb-css-vars - --#{$variable-prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x}; - --#{$variable-prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y}; - --#{$variable-prefix}breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom}; - @include rfs($breadcrumb-font-size, --#{$variable-prefix}breadcrumb-font-size); - --#{$variable-prefix}breadcrumb-bg: #{$breadcrumb-bg}; - --#{$variable-prefix}breadcrumb-border-radius: #{$breadcrumb-border-radius}; - --#{$variable-prefix}breadcrumb-divider-color: #{$breadcrumb-divider-color}; - --#{$variable-prefix}breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x}; - --#{$variable-prefix}breadcrumb-item-active-color: #{$breadcrumb-active-color}; + --#{$prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x}; + --#{$prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y}; + --#{$prefix}breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom}; + @include rfs($breadcrumb-font-size, --#{$prefix}breadcrumb-font-size); + --#{$prefix}breadcrumb-bg: #{$breadcrumb-bg}; + --#{$prefix}breadcrumb-border-radius: #{$breadcrumb-border-radius}; + --#{$prefix}breadcrumb-divider-color: #{$breadcrumb-divider-color}; + --#{$prefix}breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x}; + --#{$prefix}breadcrumb-item-active-color: #{$breadcrumb-active-color}; // scss-docs-end breadcrumb-css-vars display: flex; flex-wrap: wrap; - padding: var(--#{$variable-prefix}breadcrumb-padding-y) var(--#{$variable-prefix}breadcrumb-padding-x); - margin-bottom: var(--#{$variable-prefix}breadcrumb-margin-bottom); + padding: var(--#{$prefix}breadcrumb-padding-y) var(--#{$prefix}breadcrumb-padding-x); + margin-bottom: var(--#{$prefix}breadcrumb-margin-bottom); @include font-size($breadcrumb-font-size); - font-size: var(--#{$variable-prefix}breadcrumb-font-size); + font-size: var(--#{$prefix}breadcrumb-font-size); list-style: none; - background-color: var(--#{$variable-prefix}breadcrumb-bg); - @include border-radius(var(--#{$variable-prefix}breadcrumb-border-radius)); + background-color: var(--#{$prefix}breadcrumb-bg); + @include border-radius(var(--#{$prefix}breadcrumb-border-radius)); } .breadcrumb-item { // The separator between breadcrumbs (by default, a forward-slash: "/") + .breadcrumb-item { - padding-left: var(--#{$variable-prefix}breadcrumb-item-padding-x); + padding-left: var(--#{$prefix}breadcrumb-item-padding-x); &::before { float: left; // Suppress inline spacings and underlining of the separator - padding-right: var(--#{$variable-prefix}breadcrumb-item-padding-x); - color: var(--#{$variable-prefix}breadcrumb-divider-color); - content: var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"}; + padding-right: $breadcrumb-item-padding-x; + color: $breadcrumb-divider-color; + content: var(--#{$prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"}; } } &.active { - color: var(--#{$variable-prefix}breadcrumb-item-active-color); + color: var(--#{$prefix}breadcrumb-item-active-color); } } diff --git a/scss/_buttons.scss b/scss/_buttons.scss index 56c5b9f876..2caa36d5b3 100644 --- a/scss/_buttons.scss +++ b/scss/_buttons.scss @@ -6,59 +6,59 @@ .btn { // scss-docs-start btn-css-vars - --#{$variable-prefix}btn-padding-x: #{$btn-padding-x}; - --#{$variable-prefix}btn-padding-y: #{$btn-padding-y}; - --#{$variable-prefix}btn-font-family: #{$btn-font-family}; - @include rfs($btn-font-size, --#{$variable-prefix}btn-font-size); - --#{$variable-prefix}btn-font-weight: #{$btn-font-weight}; - --#{$variable-prefix}btn-line-height: #{$btn-line-height}; - --#{$variable-prefix}btn-color: #{$body-color}; - --#{$variable-prefix}btn-bg: transparent; - --#{$variable-prefix}btn-border-width: #{$btn-border-width}; - --#{$variable-prefix}btn-border-color: transparent; - --#{$variable-prefix}btn-border-radius: #{$btn-border-radius}; - --#{$variable-prefix}btn-box-shadow: #{$btn-box-shadow}; - --#{$variable-prefix}btn-disabled-opacity: #{$btn-disabled-opacity}; - --#{$variable-prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--#{$variable-prefix}btn-focus-shadow-rgb), .5); + --#{$prefix}btn-padding-x: #{$btn-padding-x}; + --#{$prefix}btn-padding-y: #{$btn-padding-y}; + --#{$prefix}btn-font-family: #{$btn-font-family}; + @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-bg: transparent; + --#{$prefix}btn-border-width: #{$btn-border-width}; + --#{$prefix}btn-border-color: transparent; + --#{$prefix}btn-border-radius: #{$btn-border-radius}; + --#{$prefix}btn-box-shadow: #{$btn-box-shadow}; + --#{$prefix}btn-disabled-opacity: #{$btn-disabled-opacity}; + --#{$prefix}btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(var(--#{$prefix}btn-focus-shadow-rgb), .5); // scss-docs-end btn-css-vars display: inline-block; - padding: var(--#{$variable-prefix}btn-padding-y) var(--#{$variable-prefix}btn-padding-x); - font-family: var(--#{$variable-prefix}btn-font-family); - font-size: var(--#{$variable-prefix}btn-font-size); - font-weight: var(--#{$variable-prefix}btn-font-weight); - line-height: var(--#{$variable-prefix}btn-line-height); - color: var(--#{$variable-prefix}btn-color); + padding: var(--#{$prefix}btn-padding-y) var(--#{$prefix}btn-padding-x); + font-family: var(--#{$prefix}btn-font-family); + font-size: var(--#{$prefix}btn-font-size); + font-weight: var(--#{$prefix}btn-font-weight); + line-height: var(--#{$prefix}btn-line-height); + color: var(--#{$prefix}btn-color); text-align: center; text-decoration: if($link-decoration == none, null, none); white-space: $btn-white-space; vertical-align: middle; cursor: if($enable-button-pointers, pointer, null); user-select: none; - border: var(--#{$variable-prefix}btn-border-width) solid var(--#{$variable-prefix}btn-border-color); - @include border-radius(var(--#{$variable-prefix}btn-border-radius)); - @include gradient-bg(var(--#{$variable-prefix}btn-bg)); - @include box-shadow(var(--#{$variable-prefix}btn-box-shadow)); + border: var(--#{$prefix}btn-border-width) solid var(--#{$prefix}btn-border-color); + @include border-radius(var(--#{$prefix}btn-border-radius)); + @include gradient-bg(var(--#{$prefix}btn-bg)); + @include box-shadow(var(--#{$prefix}btn-box-shadow)); @include transition($btn-transition); &:hover { - color: var(--#{$variable-prefix}btn-hover-color); + color: var(--#{$prefix}btn-hover-color); text-decoration: if($link-hover-decoration == underline, none, null); - background-color: var(--#{$variable-prefix}btn-hover-bg); - border-color: var(--#{$variable-prefix}btn-hover-border-color); + background-color: var(--#{$prefix}btn-hover-bg); + border-color: var(--#{$prefix}btn-hover-border-color); } .btn-check:focus + &, &:focus { - color: var(--#{$variable-prefix}btn-hover-color); - @include gradient-bg(var(--#{$variable-prefix}btn-hover-bg)); - border-color: var(--#{$variable-prefix}btn-hover-border-color); + color: var(--#{$prefix}btn-hover-color); + @include gradient-bg(var(--#{$prefix}btn-hover-bg)); + border-color: var(--#{$prefix}btn-hover-border-color); outline: 0; // Avoid using mixin so we can pass custom focus shadow properly @if $enable-shadows { - box-shadow: var(--#{$variable-prefix}btn-box-shadow), var(--#{$variable-prefix}btn-focus-box-shadow); + box-shadow: var(--#{$prefix}btn-box-shadow), var(--#{$prefix}btn-focus-box-shadow); } @else { - box-shadow: var(--#{$variable-prefix}btn-focus-box-shadow); + box-shadow: var(--#{$prefix}btn-focus-box-shadow); } } @@ -67,19 +67,19 @@ &:active, &.active, &.show { - color: var(--#{$variable-prefix}btn-active-color); - background-color: var(--#{$variable-prefix}btn-active-bg); + color: var(--#{$prefix}btn-active-color); + background-color: var(--#{$prefix}btn-active-bg); // Remove CSS gradients if they're enabled background-image: if($enable-gradients, none, null); - border-color: var(--#{$variable-prefix}btn-active-border-color); - @include box-shadow(var(--#{$variable-prefix}btn-active-shadow)); + border-color: var(--#{$prefix}btn-active-border-color); + @include box-shadow(var(--#{$prefix}btn-active-shadow)); &:focus { // Avoid using mixin so we can pass custom focus shadow properly @if $enable-shadows { - box-shadow: var(--#{$variable-prefix}btn-active-shadow), var(--#{$variable-prefix}btn-focus-box-shadow); + box-shadow: var(--#{$prefix}btn-active-shadow), var(--#{$prefix}btn-focus-box-shadow); } @else { - box-shadow: var(--#{$variable-prefix}btn-focus-box-shadow); + box-shadow: var(--#{$prefix}btn-focus-box-shadow); } } } @@ -87,12 +87,12 @@ &:disabled, &.disabled, fieldset:disabled & { - color: var(--#{$variable-prefix}btn-disabled-color); + color: var(--#{$prefix}btn-disabled-color); pointer-events: none; - background-color: var(--#{$variable-prefix}btn-disabled-bg); + background-color: var(--#{$prefix}btn-disabled-bg); background-image: if($enable-gradients, none, null); - border-color: var(--#{$variable-prefix}btn-disabled-border-color); - opacity: var(--#{$variable-prefix}btn-disabled-opacity); + border-color: var(--#{$prefix}btn-disabled-border-color); + opacity: var(--#{$prefix}btn-disabled-opacity); @include box-shadow(none); } } @@ -123,16 +123,16 @@ // Make a button look and behave like a link .btn-link { - --#{$variable-prefix}btn-font-weight: #{$font-weight-normal}; - --#{$variable-prefix}btn-color: #{$btn-link-color}; - --#{$variable-prefix}btn-bg: transparent; - --#{$variable-prefix}btn-border-color: transparent; - --#{$variable-prefix}btn-hover-color: #{$btn-link-hover-color}; - --#{$variable-prefix}btn-hover-border-color: transparent; - --#{$variable-prefix}btn-active-border-color: transparent; - --#{$variable-prefix}btn-disabled-color: #{$btn-link-disabled-color}; - --#{$variable-prefix}btn-disabled-border-color: transparent; - --#{$variable-prefix}btn-box-shadow: none; + --#{$prefix}btn-font-weight: #{$font-weight-normal}; + --#{$prefix}btn-color: #{$btn-link-color}; + --#{$prefix}btn-bg: transparent; + --#{$prefix}btn-border-color: transparent; + --#{$prefix}btn-hover-color: #{$btn-link-hover-color}; + --#{$prefix}btn-hover-border-color: transparent; + --#{$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; text-decoration: $link-decoration; diff --git a/scss/_dropdown.scss b/scss/_dropdown.scss index cbbe78cb34..1b25a22001 100644 --- a/scss/_dropdown.scss +++ b/scss/_dropdown.scss @@ -18,53 +18,53 @@ // The dropdown menu .dropdown-menu { // scss-docs-start dropdown-css-vars - --#{$variable-prefix}dropdown-min-width: #{$dropdown-min-width}; - --#{$variable-prefix}dropdown-padding-x: #{$dropdown-padding-x}; - --#{$variable-prefix}dropdown-padding-y: #{$dropdown-padding-y}; - --#{$variable-prefix}dropdown-spacer: #{$dropdown-spacer}; - @include rfs($dropdown-font-size, --#{$variable-prefix}dropdown-font-size); - --#{$variable-prefix}dropdown-color: #{$dropdown-color}; // stylelint-disable-line custom-property-empty-line-before - --#{$variable-prefix}dropdown-bg: #{$dropdown-bg}; - --#{$variable-prefix}dropdown-border-color: #{$dropdown-border-color}; - --#{$variable-prefix}dropdown-border-radius: #{$dropdown-border-radius}; - --#{$variable-prefix}dropdown-border-width: #{$dropdown-border-width}; - --#{$variable-prefix}dropdown-inner-border-radius: #{$dropdown-inner-border-radius}; - --#{$variable-prefix}dropdown-divider-bg: #{$dropdown-divider-bg}; - --#{$variable-prefix}dropdown-divider-margin-y: #{$dropdown-divider-margin-y}; - --#{$variable-prefix}dropdown-box-shadow: #{$dropdown-box-shadow}; - --#{$variable-prefix}dropdown-link-color: #{$dropdown-link-color}; - --#{$variable-prefix}dropdown-link-hover-color: #{$dropdown-link-hover-color}; - --#{$variable-prefix}dropdown-link-hover-bg: #{$dropdown-link-hover-bg}; - --#{$variable-prefix}dropdown-link-active-color: #{$dropdown-link-active-color}; - --#{$variable-prefix}dropdown-link-active-bg: #{$dropdown-link-active-bg}; - --#{$variable-prefix}dropdown-link-disabled-color: #{$dropdown-link-disabled-color}; - --#{$variable-prefix}dropdown-item-padding-x: #{$dropdown-item-padding-x}; - --#{$variable-prefix}dropdown-item-padding-y: #{$dropdown-item-padding-y}; - --#{$variable-prefix}dropdown-header-color: #{$dropdown-header-color}; - --#{$variable-prefix}dropdown-header-padding-x: #{$dropdown-header-padding-x}; - --#{$variable-prefix}dropdown-header-padding-y: #{$dropdown-header-padding-y}; + --#{$prefix}dropdown-min-width: #{$dropdown-min-width}; + --#{$prefix}dropdown-padding-x: #{$dropdown-padding-x}; + --#{$prefix}dropdown-padding-y: #{$dropdown-padding-y}; + --#{$prefix}dropdown-spacer: #{$dropdown-spacer}; + @include rfs($dropdown-font-size, --#{$prefix}dropdown-font-size); + --#{$prefix}dropdown-color: #{$dropdown-color}; // stylelint-disable-line custom-property-empty-line-before + --#{$prefix}dropdown-bg: #{$dropdown-bg}; + --#{$prefix}dropdown-border-color: #{$dropdown-border-color}; + --#{$prefix}dropdown-border-radius: #{$dropdown-border-radius}; + --#{$prefix}dropdown-border-width: #{$dropdown-border-width}; + --#{$prefix}dropdown-inner-border-radius: #{$dropdown-inner-border-radius}; + --#{$prefix}dropdown-divider-bg: #{$dropdown-divider-bg}; + --#{$prefix}dropdown-divider-margin-y: #{$dropdown-divider-margin-y}; + --#{$prefix}dropdown-box-shadow: #{$dropdown-box-shadow}; + --#{$prefix}dropdown-link-color: #{$dropdown-link-color}; + --#{$prefix}dropdown-link-hover-color: #{$dropdown-link-hover-color}; + --#{$prefix}dropdown-link-hover-bg: #{$dropdown-link-hover-bg}; + --#{$prefix}dropdown-link-active-color: #{$dropdown-link-active-color}; + --#{$prefix}dropdown-link-active-bg: #{$dropdown-link-active-bg}; + --#{$prefix}dropdown-link-disabled-color: #{$dropdown-link-disabled-color}; + --#{$prefix}dropdown-item-padding-x: #{$dropdown-item-padding-x}; + --#{$prefix}dropdown-item-padding-y: #{$dropdown-item-padding-y}; + --#{$prefix}dropdown-header-color: #{$dropdown-header-color}; + --#{$prefix}dropdown-header-padding-x: #{$dropdown-header-padding-x}; + --#{$prefix}dropdown-header-padding-y: #{$dropdown-header-padding-y}; // scss-docs-end dropdown-css-vars position: absolute; z-index: $zindex-dropdown; display: none; // none by default, but block on "open" of the menu - min-width: var(--#{$variable-prefix}dropdown-min-width); - padding: var(--#{$variable-prefix}dropdown-padding-y) var(--#{$variable-prefix}dropdown-padding-x); + min-width: var(--#{$prefix}dropdown-min-width); + padding: var(--#{$prefix}dropdown-padding-y) var(--#{$prefix}dropdown-padding-x); margin: 0; // Override default margin of ul - @include font-size(var(--#{$variable-prefix}dropdown-font-size)); - color: var(--#{$variable-prefix}dropdown-color); + @include font-size(var(--#{$prefix}dropdown-font-size)); + color: var(--#{$prefix}dropdown-color); text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) list-style: none; - background-color: var(--#{$variable-prefix}dropdown-bg); + background-color: var(--#{$prefix}dropdown-bg); background-clip: padding-box; - border: var(--#{$variable-prefix}dropdown-border-width) solid var(--#{$variable-prefix}dropdown-border-color); - @include border-radius(var(--#{$variable-prefix}dropdown-border-radius)); - @include box-shadow(var(--#{$variable-prefix}dropdown-box-shadow)); + border: var(--#{$prefix}dropdown-border-width) solid var(--#{$prefix}dropdown-border-color); + @include border-radius(var(--#{$prefix}dropdown-border-radius)); + @include box-shadow(var(--#{$prefix}dropdown-box-shadow)); &[data-bs-popper] { top: 100%; left: 0; - margin-top: var(--#{$variable-prefix}dropdown-spacer); + margin-top: var(--#{$prefix}dropdown-spacer); } } @@ -104,7 +104,7 @@ top: auto; bottom: 100%; margin-top: 0; - margin-bottom: var(--#{$variable-prefix}dropdown-spacer); + margin-bottom: var(--#{$prefix}dropdown-spacer); } .dropdown-toggle { @@ -118,7 +118,7 @@ right: auto; left: 100%; margin-top: 0; - margin-left: var(--#{$variable-prefix}dropdown-spacer); + margin-left: var(--#{$prefix}dropdown-spacer); } .dropdown-toggle { @@ -135,7 +135,7 @@ right: 100%; left: auto; margin-top: 0; - margin-right: var(--#{$variable-prefix}dropdown-spacer); + margin-right: var(--#{$prefix}dropdown-spacer); } .dropdown-toggle { @@ -150,9 +150,9 @@ // Dividers (basically an `
`) within the dropdown .dropdown-divider { height: 0; - margin: var(--#{$variable-prefix}dropdown-divider-margin-y) 0; + margin: var(--#{$prefix}dropdown-divider-margin-y) 0; overflow: hidden; - border-top: 1px solid var(--#{$variable-prefix}dropdown-divider-bg); + border-top: 1px solid var(--#{$prefix}dropdown-divider-bg); opacity: 1; // Revisit in v6 to de-dupe styles that conflict with
element } @@ -162,10 +162,10 @@ .dropdown-item { display: block; width: 100%; // For `