What is the best way to override variables?
I found the following order works:
@import "bootstrap/_functions.scss";
$primary: red;
@import "bootstrap/_variables.scss";
@import "bootstrap/_mixins.scss";
But what if I want to use a variable from Bootstrap? For example:
@import "bootstrap/_functions.scss";
$primary: $red;
@import "bootstrap/_variables.scss";
@import "bootstrap/_mixins.scss";
This doesn't compile because the $red variable isn't defined.
I've tried this order:
@import "bootstrap/_functions.scss";
@import "bootstrap/_variables.scss";
@import "bootstrap/_mixins.scss";
$primary: $red;
Which works but only for some elements. For example bootstap/_variables.scss includes:
$link-color: $primary !default;
The $link-colour variable doesn't use the override and instead uses the default value.
Any ideas?