]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
move theme-colors (vars+map) after color tints definitions
authormaks <pine3ree@gmail.com>
Thu, 23 Dec 2021 12:58:25 +0000 (13:58 +0100)
committerMark Otto <otto@github.com>
Fri, 25 Feb 2022 22:59:15 +0000 (14:59 -0800)
In this way we can use color tints other than grays in our custom theme, w/o having to extend it later (e.g `$primary: $indigo-600;` ). This could be done in the project variables file, but i believe most developers just include a full local copy of  `scss/_variables.scss` before the the original `default` file and change the values the need (maybe also removing the !default flag) so that it's easier to track changes and custom values during upgrades.

scss/_variables.scss

index 5dd78ae2a8223afcfdc9f39eb1edbe22dc2e3ec7..ccc925837ae6dfbca867a54b20c55062963c6eaf 100644 (file)
@@ -66,30 +66,6 @@ $colors: (
 ) !default;
 // scss-docs-end colors-map
 
-// scss-docs-start theme-color-variables
-$primary:       $blue !default;
-$secondary:     $gray-600 !default;
-$success:       $green !default;
-$info:          $cyan !default;
-$warning:       $yellow !default;
-$danger:        $red !default;
-$light:         $gray-100 !default;
-$dark:          $gray-900 !default;
-// scss-docs-end theme-color-variables
-
-// scss-docs-start theme-colors-map
-$theme-colors: (
-  "primary":    $primary,
-  "secondary":  $secondary,
-  "success":    $success,
-  "info":       $info,
-  "warning":    $warning,
-  "danger":     $danger,
-  "light":      $light,
-  "dark":       $dark
-) !default;
-// scss-docs-end theme-colors-map
-
 // 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;
@@ -320,6 +296,30 @@ $cyans: (
 ) !default;
 // fusv-enable
 
+// scss-docs-start theme-color-variables
+$primary:       $blue !default;
+$secondary:     $gray-600 !default;
+$success:       $green !default;
+$info:          $cyan !default;
+$warning:       $yellow !default;
+$danger:        $red !default;
+$light:         $gray-100 !default;
+$dark:          $gray-900 !default;
+// scss-docs-end theme-color-variables
+
+// scss-docs-start theme-colors-map
+$theme-colors: (
+  "primary":    $primary,
+  "secondary":  $secondary,
+  "success":    $success,
+  "info":       $info,
+  "warning":    $warning,
+  "danger":     $danger,
+  "light":      $light,
+  "dark":       $dark
+) !default;
+// scss-docs-end theme-colors-map
+
 // Characters which are escaped by the escape-svg function
 $escaped-characters: (
   ("<", "%3c"),