question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

I just tried the new Bootstrap 5.0.0-alpha1 and when I wanted to add a new color to $theme-colors it override all the theme.

I compared the code with the v 4.5.0 and I found that in the file variables.scss the map-merge is missing.

In v4.5.0

$theme-colors: () !default;

$theme-colors: map-merge(
  (
    "primary":    $primary,
    "secondary":  $secondary,
    "success":    $success,
    "info":       $info,
    "warning":    $warning,
    "danger":     $danger,
    "light":      $light,
    "dark":       $dark
  ),
  $theme-colors
);

In V5

$theme-colors: (
  "primary":    $primary,
  "secondary":  $secondary,
  "success":    $success,
  "info":       $info,
  "warning":    $warning,
  "danger":     $danger,
  "light":      $light,
  "dark":       $dark
) !default;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
greg-hoaraucommented, Aug 5, 2020

Plop, I managed to make it work like this :

// Variables (no theme-colors)
@import "base/variables";

// Bootstrap variables
@import "node_modules/bootstrap/scss/_functions";
@import "node_modules/bootstrap/scss/_variables";

// Variables maps (use map-merge in this file)
@import "base/maps";

// Bootstrap
@import "node_modules/bootstrap/scss/bootstrap";
6reactions
NatachaHcommented, Sep 10, 2021

@MostlyDead This is how i do in my bootstrap.scss file:

@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";

// Custom the bootstrap theme color (ex: alert-custom-color)
$custom-theme-colors: (
"custom-color": #333
);

// Custom the bootstrap utilities color (ex: text-custom-color or bg-custom-color)
$custom-utilities-colors: $custom-theme-colors;

// Custom the bootstrap table color (ex: table-custom-color)
$custom-table-colors: $custom-theme-colors;

// Merge the custom colors to the bootstrap default
$theme-colors: map-merge($theme-colors, $custom-theme-colors);
$utilities-text-colors: map-merge($utilities-text-colors, $custom-utilities-colors );
$utilities-bg-colors: map-merge($utilities-bg-colors, $custom-utilities-colors);
$table-variants: map-merge($table-variants, $custom-table-colors);

@import "~bootstrap/scss/mixins";
@import "~bootstrap/scss/utilities";

... And the other import

Read more comments on GitHub >

github_iconTop Results From Across the Web

Color · Bootstrap v5.0
Theme colors ​​ All these colors are available as a Sass map, $theme-colors . $theme-colors: ( "primary": $primary, "secondary": $secondary, "success": $success, ...
Read more >
Palette - Material UI - MUI
The palette enables you to modify the color of the components to suit your brand. Palette colors. The theme exposes the following palette...
Read more >
Customizing the Material-UI Theme Color Palette (MUI v5)
This demo shows how to override palette colors, add new categories to the palette, and create a component that uses the custom colors....
Read more >
Material UI v5 Different Primary Color Based on Mode (Light ...
On light mode: the primary.main color is #1976d2. On dark mode: the primary.main color is #1976d2. Now, I'm wondering ...
Read more >
MUI Themes Fully-Featured with MUI v5 - NetworkSynapse
You may have noticed that some palette colors in our theme only have the main color property set. One great feature with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found