Here is a what I realized. You can override sass variables after they have been imported. But the modification will be reflected only in the usage after overriding. Since navbar
got styles before you overrode the $navbarBackground
, just overriding the variable won’t change styling. See below example.
@import "bootstrap";
@navbarBackground: $red;
// This doesn't work. Navbar will still be same color.
// But if you do write styles for navbar again
.navbar-inner { background: $navbarBackground; }
// Now, Navbar will have a red background
@import "bootstrap";
$blue: $white;
// After this line, whenever your reference $blue, it'll generate white color.