Reputation: 7646
For some reason when setting Bootstrap variables to a CSS3 variables my Angular 6 app breaks with the following error
This is indeed the first usage of the SCSS variable in the bootstrap file, so it is obviously not happy with how I am setting it. I have made a very simple StackBlitz to replicate the issue. Have a look at the styles.scss.
Essentially this is what produces this error.
styles.scss
:root{
--primary: #0f0;
}
$primary: var(--primary); // Broken
// $primary: #f00; // Working
@import '../bootstrap/scss/bootstrap';
Any ideas on why Bootstrap may not be happy with this?
Upvotes: 0
Views: 289
Reputation: 7646
Found the answer.
It appears you cannot use css variables within SASS functions due to the dynamic nature of css variables together with the fact that sass is a preprocessor.
See this stack for a more detailed explanation.
Upvotes: 1