1

I'm using bootstrap-vue and would like to be able to override the theme colors dynamically at runtime (after compiling the scss). To do this I'm following this guide: https://bootstrap-vue.org/docs/reference/theming to set the bootstrap theme colors to a css variable:

$theme-colors: (
  "info": var(--info)
);

@import "node_modules/bootstrap/scss/bootstrap";

However, when I compile the scss I get the following error:

SassError: argument `$color-2` of `mix($color-1, $color-2, $weight: 50%)` must be a color
on line 106 of node_modules/bootstrap/scss/_functions.scss, in function `mix`

Is it possible to inject css variables like I want? If so how?

1 Answer 1

1

It looks like I've run into a known limitation to bootstrap's scss. This blog outlines a workaround by overriding bootstraps functions: Changing Bootstrap Theme at Runtime with CSS Variables

However it reportedly doesn't work with IE 11.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.