diff options
author | Mark Otto <markd.otto@gmail.com> | 2021-11-15 14:03:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 14:03:48 +0300 |
commit | 9f099d3e4f6fe5b0c5454d2462cc22d06b6f4a1b (patch) | |
tree | f566d8bd5af6185fc2167931a5c7afb8e93d7001 /scss | |
parent | 96dcc150d5d61d0dddae678c3f28830206c338b4 (diff) |
Move reassigned Sass maps for colors to another stylesheet (#34942)
Diffstat (limited to 'scss')
-rw-r--r-- | scss/_maps.scss | 44 | ||||
-rw-r--r-- | scss/_variables.scss | 41 | ||||
-rw-r--r-- | scss/bootstrap-grid.scss | 1 | ||||
-rw-r--r-- | scss/bootstrap-reboot.scss | 1 | ||||
-rw-r--r-- | scss/bootstrap-utilities.scss | 1 | ||||
-rw-r--r-- | scss/bootstrap.scss | 1 |
6 files changed, 48 insertions, 41 deletions
diff --git a/scss/_maps.scss b/scss/_maps.scss new file mode 100644 index 0000000000..c8b9fa7e53 --- /dev/null +++ b/scss/_maps.scss @@ -0,0 +1,44 @@ +// Re-assigned maps +// +// Placed here so that others can override the default Sass maps and see automatic updates to utilities and more. + +// scss-docs-start theme-colors-rgb +$theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value") !default; +// scss-docs-end theme-colors-rgb + +// Utilities maps +// +// Extends the default `$theme-colors` maps to help create our utilities. + +// Come v6, we'll de-dupe these variables. Until then, for backward compatibility, we keep them to reassign. +// scss-docs-start utilities-colors +$utilities-colors: $theme-colors-rgb !default; +// scss-docs-end utilities-colors + +// scss-docs-start utilities-text-colors +$utilities-text: map-merge( + $utilities-colors, + ( + "black": to-rgb($black), + "white": to-rgb($white), + "body": to-rgb($body-color) + ) +) !default; +$utilities-text-colors: map-loop($utilities-text, rgba-css-var, "$key", "text") !default; +// scss-docs-end utilities-text-colors + +// scss-docs-start utilities-bg-colors +$utilities-bg: map-merge( + $utilities-colors, + ( + "black": to-rgb($black), + "white": to-rgb($white), + "body": to-rgb($body-bg) + ) +) !default; +$utilities-bg-colors: map-loop($utilities-bg, rgba-css-var, "$key", "bg") !default; +// scss-docs-end utilities-bg-colors + +$negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default; + +$gutters: $spacers !default; diff --git a/scss/_variables.scss b/scss/_variables.scss index 244a15c215..f6a37b764c 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -90,10 +90,6 @@ $theme-colors: ( ) !default; // scss-docs-end theme-colors-map -// scss-docs-start theme-colors-rgb -$theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value") !default; -// scss-docs-end theme-colors-rgb - // The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7. // See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast $min-contrast-ratio: 4.5 !default; @@ -382,8 +378,6 @@ $spacers: ( 4: $spacer * 1.5, 5: $spacer * 3, ) !default; - -$negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default; // scss-docs-end spacer-variables-maps // Position @@ -406,39 +400,6 @@ $body-bg: $white !default; $body-color: $gray-900 !default; $body-text-align: null !default; -// Utilities maps -// -// Extends the default `$theme-colors` maps to help create our utilities. - -// Come v6, we'll de-dupe these variables. Until then, for backward compatibility, we keep them to reassign. -// scss-docs-start utilities-colors -$utilities-colors: $theme-colors-rgb !default; -// scss-docs-end utilities-colors - -// scss-docs-start utilities-text-colors -$utilities-text: map-merge( - $utilities-colors, - ( - "black": to-rgb($black), - "white": to-rgb($white), - "body": to-rgb($body-color) - ) -) !default; -$utilities-text-colors: map-loop($utilities-text, rgba-css-var, "$key", "text") !default; -// scss-docs-end utilities-text-colors - -// scss-docs-start utilities-bg-colors -$utilities-bg: map-merge( - $utilities-colors, - ( - "black": to-rgb($black), - "white": to-rgb($white), - "body": to-rgb($body-bg) - ) -) !default; -$utilities-bg-colors: map-loop($utilities-bg, rgba-css-var, "$key", "bg") !default; -// scss-docs-end utilities-bg-colors - // Links // // Style anchor elements. @@ -504,8 +465,6 @@ $grid-columns: 12 !default; $grid-gutter-width: 1.5rem !default; $grid-row-columns: 6 !default; -$gutters: $spacers !default; - // Container padding $container-padding-x: $grid-gutter-width * .5 !default; diff --git a/scss/bootstrap-grid.scss b/scss/bootstrap-grid.scss index d4a37a063e..edca104af8 100644 --- a/scss/bootstrap-grid.scss +++ b/scss/bootstrap-grid.scss @@ -9,6 +9,7 @@ $include-column-box-sizing: true !default; @import "functions"; @import "variables"; +@import "maps"; @import "mixins/lists"; @import "mixins/breakpoints"; diff --git a/scss/bootstrap-reboot.scss b/scss/bootstrap-reboot.scss index 965332a606..726758e928 100644 --- a/scss/bootstrap-reboot.scss +++ b/scss/bootstrap-reboot.scss @@ -8,6 +8,7 @@ @import "functions"; @import "variables"; +@import "maps"; @import "mixins"; @import "root"; @import "reboot"; diff --git a/scss/bootstrap-utilities.scss b/scss/bootstrap-utilities.scss index d4f981d450..6d7968e686 100644 --- a/scss/bootstrap-utilities.scss +++ b/scss/bootstrap-utilities.scss @@ -8,6 +8,7 @@ // Configuration @import "functions"; @import "variables"; +@import "maps"; @import "mixins"; @import "utilities"; diff --git a/scss/bootstrap.scss b/scss/bootstrap.scss index 0819eee3c7..6a5d131667 100644 --- a/scss/bootstrap.scss +++ b/scss/bootstrap.scss @@ -9,6 +9,7 @@ // Configuration @import "functions"; @import "variables"; +@import "maps"; @import "mixins"; @import "utilities"; |