What is the most effective way to customize variables?
I have found that following this specific order yields the best results:
@import "bootstrap/_functions.scss";
$primary: red;
@import "bootstrap/_variables.scss";
@import "bootstrap/_mixins.scss";
However, a challenge arises when trying to utilize a variable from Bootstrap itself. For instance:
@import "bootstrap/_functions.scss";
$primary: $red;
@import "bootstrap/_variables.scss";
@import "bootstrap/_mixins.scss";
This particular scenario fails to compile due to the undefined $red variable.
Experimenting with an alternative order:
@import "bootstrap/_functions.scss";
@import "bootstrap/_variables.scss";
@import "bootstrap/_mixins.scss";
$primary: $red;
While this approach works for certain elements, it falls short in others. For instance, within bootstrap/_variables.scss:
$link-color: $primary !default;
The $link-colour variable does not reflect the customization and resorts back to the default value.
Any suggestions or insights on overcoming this challenge?