diff options
| author | Mark Otto <[email protected]> | 2021-07-18 20:38:30 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2021-08-03 17:06:06 -0700 |
| commit | 4d7911a27bf9591c1f4dee53fe0b1f053646d0fd (patch) | |
| tree | 90f81f56db93bcd7a2857f0d0d3c547a6d71d4ab /scss/_root.scss | |
| parent | e72916e5b741b07b94b12b3707129e868811bdbb (diff) | |
| download | bootstrap-4d7911a27bf9591c1f4dee53fe0b1f053646d0fd.tar.xz bootstrap-4d7911a27bf9591c1f4dee53fe0b1f053646d0fd.zip | |
Add and document additional :root CSS variables
- Adds grayscale colors
- Adds root and body variables
Note that some Sass variables default to `null`, so as we generate and use the CSS variable, we'll be potentially adding some lines of code.
Diffstat (limited to 'scss/_root.scss')
| -rw-r--r-- | scss/_root.scss | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/scss/_root.scss b/scss/_root.scss index 95c773901..189b2b3bb 100644 --- a/scss/_root.scss +++ b/scss/_root.scss @@ -1,9 +1,18 @@ :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}; } @@ -16,9 +25,29 @@ --#{$variable-prefix}black-rgb: #{to-rgb($black)}; --#{$variable-prefix}body-rgb: #{to-rgb($body-color)}; - // Use `inspect` for lists so that quoted items keep the quotes. + // 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 } |
