File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -262,9 +262,19 @@ def _prepare_color_vars(
262262 palette_defaults_dict : dict [str , str | float | int | bool | None ] = {}
263263 palette_css_vars : list [str ] = []
264264
265- # Map values in colors to their Sass variable counterparts
266265 for thm_name , thm_color in brand .color .to_dict (include = "theme" ).items ():
267- defaults_dict [f"brand_color_{ thm_name } " ] = thm_color
266+ # Create brand Sass variables and set related Bootstrap Sass vars
267+ # brand.color.primary = "#007bff"
268+ # ==> $brand_color_primary: #007bff !default;
269+ # ==> $primary: $brand_color_primary !default;
270+
271+ brand_color_var = f"brand_color_{ thm_name } "
272+ defaults_dict [brand_color_var ] = thm_color
273+ # Currently, brand.color fields are directly named after Bootstrap vars. If
274+ # that changes, we'd need to use a map here. These values can't be set to
275+ # `null !default` because they're used by maps in the Bootstrap mixins layer
276+ # and cause errors if a color is `null` rather than non-existent.
277+ defaults_dict [thm_name ] = f"${ brand_color_var } "
268278
269279 brand_color_palette = brand .color .to_dict (include = "palette" )
270280
Original file line number Diff line number Diff line change @@ -72,18 +72,10 @@ $body-color: $brand_color_foreground !default;
7272$body-bg-dark : $brand_color_foreground !default ;
7373$body-bg : $brand_color_background !default ;
7474$body-color-dark : $brand_color_background !default ;
75- $primary : $brand_color_primary !default ;
76- $secondary : $brand_color_secondary !default ;
7775$body-secondary-color : $brand_color_secondary !default ;
7876$body-secondary : $brand_color_secondary !default ;
7977$body-tertiary-color : $brand_color_tertiary !default ;
8078$body-tertiary : $brand_color_tertiary !default ;
81- $success : $brand_color_success !default ;
82- $info : $brand_color_info !default ;
83- $warning : $brand_color_warning !default ;
84- $danger : $brand_color_danger !default ;
85- $light : $brand_color_light !default ;
86- $dark : $brand_color_dark !default ;
8779
8880// *-- brand.typography --*//
8981// brand.typography.base
You can’t perform that action at this time.
0 commit comments