diff options
| author | Mark Otto <[email protected]> | 2021-09-09 12:23:04 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2021-09-09 12:23:04 -0700 |
| commit | 362669b8ac2b70d46b81441204ae77f2383c9cb3 (patch) | |
| tree | c50e00aa9a35eb4b9ea94d9c94762b5e30adce87 | |
| parent | 24daa47131c543933bc43949d9dbe01911475a08 (diff) | |
| download | bootstrap-362669b8ac2b70d46b81441204ae77f2383c9cb3.tar.xz bootstrap-362669b8ac2b70d46b81441204ae77f2383c9cb3.zip | |
Move reassigned Sass maps for colors to another stylesheet
| -rw-r--r-- | scss/_maps.scss | 40 | ||||
| -rw-r--r-- | scss/_variables.scss | 37 | ||||
| -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, 44 insertions, 37 deletions
diff --git a/scss/_maps.scss b/scss/_maps.scss new file mode 100644 index 000000000..aa7736f2d --- /dev/null +++ b/scss/_maps.scss @@ -0,0 +1,40 @@ +// 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 diff --git a/scss/_variables.scss b/scss/_variables.scss index 3994f1897..f54fb7c34 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; @@ -405,39 +401,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. diff --git a/scss/bootstrap-grid.scss b/scss/bootstrap-grid.scss index bef4ecaec..193a3fe21 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 f31cbafaf..e153e5041 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 6d80d3f3f..42d595288 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 c9c9af234..31ce178cd 100644 --- a/scss/bootstrap.scss +++ b/scss/bootstrap.scss @@ -9,6 +9,7 @@ // Configuration @import "functions"; @import "variables"; +@import "maps"; @import "mixins"; @import "utilities"; |
