1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 00:29:52 +02:00

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
This commit is contained in:
Mark Otto
2022-03-13 10:13:09 -07:00
committed by GitHub
parent 7c966f5848
commit acf6ea74a7
29 changed files with 581 additions and 566 deletions

View File

@@ -5,26 +5,26 @@
.navbar {
// scss-docs-start navbar-css-vars
--#{$variable-prefix}navbar-padding-x: #{if($navbar-padding-x == null, 0, $navbar-padding-x)};
--#{$variable-prefix}navbar-padding-y: #{$navbar-padding-y};
--#{$variable-prefix}navbar-color: #{$navbar-light-color};
--#{$variable-prefix}navbar-hover-color: #{$navbar-light-hover-color};
--#{$variable-prefix}navbar-disabled-color: #{$navbar-light-disabled-color};
--#{$variable-prefix}navbar-active-color: #{$navbar-light-active-color};
--#{$variable-prefix}navbar-brand-padding-y: #{$navbar-brand-padding-y};
--#{$variable-prefix}navbar-brand-margin-end: #{$navbar-brand-margin-end};
--#{$variable-prefix}navbar-brand-font-size: #{$navbar-brand-font-size};
--#{$variable-prefix}navbar-brand-color: #{$navbar-light-brand-color};
--#{$variable-prefix}navbar-brand-hover-color: #{$navbar-light-brand-hover-color};
--#{$variable-prefix}navbar-nav-link-padding-x: #{$navbar-nav-link-padding-x};
--#{$variable-prefix}navbar-toggler-padding-y: #{$navbar-toggler-padding-y};
--#{$variable-prefix}navbar-toggler-padding-x: #{$navbar-toggler-padding-x};
--#{$variable-prefix}navbar-toggler-font-size: #{$navbar-toggler-font-size};
--#{$variable-prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-light-toggler-icon-bg)};
--#{$variable-prefix}navbar-toggler-border-color: #{$navbar-light-toggler-border-color};
--#{$variable-prefix}navbar-toggler-border-radius: #{$navbar-toggler-border-radius};
--#{$variable-prefix}navbar-toggler-focus-width: #{$navbar-toggler-focus-width};
--#{$variable-prefix}navbar-toggler-transition: #{$navbar-toggler-transition};
--#{$prefix}navbar-padding-x: #{if($navbar-padding-x == null, 0, $navbar-padding-x)};
--#{$prefix}navbar-padding-y: #{$navbar-padding-y};
--#{$prefix}navbar-color: #{$navbar-light-color};
--#{$prefix}navbar-hover-color: #{$navbar-light-hover-color};
--#{$prefix}navbar-disabled-color: #{$navbar-light-disabled-color};
--#{$prefix}navbar-active-color: #{$navbar-light-active-color};
--#{$prefix}navbar-brand-padding-y: #{$navbar-brand-padding-y};
--#{$prefix}navbar-brand-margin-end: #{$navbar-brand-margin-end};
--#{$prefix}navbar-brand-font-size: #{$navbar-brand-font-size};
--#{$prefix}navbar-brand-color: #{$navbar-light-brand-color};
--#{$prefix}navbar-brand-hover-color: #{$navbar-light-brand-hover-color};
--#{$prefix}navbar-nav-link-padding-x: #{$navbar-nav-link-padding-x};
--#{$prefix}navbar-toggler-padding-y: #{$navbar-toggler-padding-y};
--#{$prefix}navbar-toggler-padding-x: #{$navbar-toggler-padding-x};
--#{$prefix}navbar-toggler-font-size: #{$navbar-toggler-font-size};
--#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-light-toggler-icon-bg)};
--#{$prefix}navbar-toggler-border-color: #{$navbar-light-toggler-border-color};
--#{$prefix}navbar-toggler-border-radius: #{$navbar-toggler-border-radius};
--#{$prefix}navbar-toggler-focus-width: #{$navbar-toggler-focus-width};
--#{$prefix}navbar-toggler-transition: #{$navbar-toggler-transition};
// scss-docs-end navbar-css-vars
position: relative;
@@ -32,7 +32,7 @@
flex-wrap: wrap; // allow us to do the line break for collapsing content
align-items: center;
justify-content: space-between; // space out brand from logo
padding: var(--#{$variable-prefix}navbar-padding-y) var(--#{$variable-prefix}navbar-padding-x);
padding: var(--#{$prefix}navbar-padding-y) var(--#{$prefix}navbar-padding-x);
@include gradient-bg();
// Because flex properties aren't inherited, we need to redeclare these first
@@ -63,17 +63,17 @@
// Used for brand, project, or site names.
.navbar-brand {
padding-top: var(--#{$variable-prefix}navbar-brand-padding-y);
padding-bottom: var(--#{$variable-prefix}navbar-brand-padding-y);
margin-right: var(--#{$variable-prefix}navbar-brand-margin-end);
@include font-size(var(--#{$variable-prefix}navbar-brand-font-size));
color: var(--#{$variable-prefix}navbar-brand-color);
padding-top: var(--#{$prefix}navbar-brand-padding-y);
padding-bottom: var(--#{$prefix}navbar-brand-padding-y);
margin-right: var(--#{$prefix}navbar-brand-margin-end);
@include font-size(var(--#{$prefix}navbar-brand-font-size));
color: var(--#{$prefix}navbar-brand-color);
text-decoration: if($link-decoration == none, null, none);
white-space: nowrap;
&:hover,
&:focus {
color: var(--#{$variable-prefix}navbar-brand-hover-color);
color: var(--#{$prefix}navbar-brand-hover-color);
text-decoration: if($link-hover-decoration == underline, none, null);
}
}
@@ -93,21 +93,21 @@
.nav-link {
padding-right: 0;
padding-left: 0;
color: var(--#{$variable-prefix}navbar-color);
color: var(--#{$prefix}navbar-color);
&:hover,
&:focus {
color: var(--#{$variable-prefix}navbar-hover-color);
color: var(--#{$prefix}navbar-hover-color);
}
&.disabled {
color: var(--#{$variable-prefix}navbar-disabled-color);
color: var(--#{$prefix}navbar-disabled-color);
}
}
.show > .nav-link,
.nav-link.active {
color: var(--#{$variable-prefix}navbar-active-color);
color: var(--#{$prefix}navbar-active-color);
}
.dropdown-menu {
@@ -123,12 +123,12 @@
.navbar-text {
padding-top: $nav-link-padding-y;
padding-bottom: $nav-link-padding-y;
color: var(--#{$variable-prefix}navbar-color);
color: var(--#{$prefix}navbar-color);
a,
a:hover,
a:focus {
color: var(--#{$variable-prefix}navbar-active-color);
color: var(--#{$prefix}navbar-active-color);
}
}
@@ -151,14 +151,14 @@
// Button for toggling the navbar when in its collapsed state
.navbar-toggler {
padding: var(--#{$variable-prefix}navbar-toggler-padding-y) var(--#{$variable-prefix}navbar-toggler-padding-x);
@include font-size(var(--#{$variable-prefix}navbar-toggler-font-size));
padding: var(--#{$prefix}navbar-toggler-padding-y) var(--#{$prefix}navbar-toggler-padding-x);
@include font-size(var(--#{$prefix}navbar-toggler-font-size));
line-height: 1;
color: var(--#{$variable-prefix}navbar-color);
color: var(--#{$prefix}navbar-color);
background-color: transparent; // remove default button style
border: var(--#{$variable-prefix}border-width) solid var(--#{$variable-prefix}navbar-toggler-border-color); // remove default button style
@include border-radius(var(--#{$variable-prefix}navbar-toggler-border-radius));
@include transition(var(--#{$variable-prefix}navbar-toggler-transition));
border: var(--#{$prefix}border-width) solid var(--#{$prefix}navbar-toggler-border-color); // remove default button style
@include border-radius(var(--#{$prefix}navbar-toggler-border-radius));
@include transition(var(--#{$prefix}navbar-toggler-transition));
&:hover {
text-decoration: none;
@@ -167,7 +167,7 @@
&:focus {
text-decoration: none;
outline: 0;
box-shadow: 0 0 0 var(--#{$variable-prefix}navbar-toggler-focus-width);
box-shadow: 0 0 0 var(--#{$prefix}navbar-toggler-focus-width);
}
}
@@ -178,14 +178,14 @@
width: 1.5em;
height: 1.5em;
vertical-align: middle;
background-image: var(--#{$variable-prefix}navbar-toggler-icon-bg);
background-image: var(--#{$prefix}navbar-toggler-icon-bg);
background-repeat: no-repeat;
background-position: center;
background-size: 100%;
}
.navbar-nav-scroll {
max-height: var(--#{$variable-prefix}scroll-height, 75vh);
max-height: var(--#{$prefix}scroll-height, 75vh);
overflow-y: auto;
}
@@ -211,8 +211,8 @@
}
.nav-link {
padding-right: var(--#{$variable-prefix}navbar-nav-link-padding-x);
padding-left: var(--#{$variable-prefix}navbar-nav-link-padding-x);
padding-right: var(--#{$prefix}navbar-nav-link-padding-x);
padding-left: var(--#{$prefix}navbar-nav-link-padding-x);
}
}
@@ -280,12 +280,12 @@
}
.navbar-dark {
--#{$variable-prefix}navbar-color: #{$navbar-dark-color};
--#{$variable-prefix}navbar-hover-color: #{$navbar-dark-hover-color};
--#{$variable-prefix}navbar-disabled-color: #{$navbar-dark-disabled-color};
--#{$variable-prefix}navbar-active-color: #{$navbar-dark-active-color};
--#{$variable-prefix}navbar-brand-color: #{$navbar-dark-brand-color};
--#{$variable-prefix}navbar-brand-hover-color: #{$navbar-dark-brand-hover-color};
--#{$variable-prefix}navbar-toggler-border-color: #{$navbar-dark-toggler-border-color};
--#{$variable-prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
--#{$prefix}navbar-color: #{$navbar-dark-color};
--#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color};
--#{$prefix}navbar-disabled-color: #{$navbar-dark-disabled-color};
--#{$prefix}navbar-active-color: #{$navbar-dark-active-color};
--#{$prefix}navbar-brand-color: #{$navbar-dark-brand-color};
--#{$prefix}navbar-brand-hover-color: #{$navbar-dark-brand-hover-color};
--#{$prefix}navbar-toggler-border-color: #{$navbar-dark-toggler-border-color};
--#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
}