thoughtbot / bitters

Add a dash of pre-defined style to your Bourbon.
https://thoughtbot.com
MIT License
1.39k stars 142 forks source link

Overwriting $base-accent-color not working #127

Closed renege closed 9 years ago

renege commented 9 years ago

When I try overwriting $base-accent-color: red;. it doesn't work. I put it on top of the sass.

@import "_settings/fonts";

@import "../bower/bourbon/dist/bourbon";
@import "_settings/grid";
@import "../bower/neat/app/assets/stylesheets/neat";
$base-accent-color: red; // not working
@import "../bower/bitters/app/assets/stylesheets/base";
tysongach commented 9 years ago

Bitters defines the $base-accent-color variable out-of-the-box, so if you want to overwrite it, then you need to do it below @import "../bower/bitters/app/assets/stylesheets/base";.

A much better approach would be to change the value for $base-accent-color inside base/_variables.scss, instead of overwriting it. If you go that route, I would not use Bower, because running an update for your packages would then overwrite your changes in Bitters. This is why we do not officially publish Bitters as a Bower package.

renege commented 9 years ago

I prefer bower.

@import "_settings/fonts";
@import "../bower/bourbon/dist/bourbon";
@import "_settings/grid";
@import "../bower/neat/app/assets/stylesheets/neat";
@import "../bower/bitters/app/assets/stylesheets/base";

$base-accent-color: red;

Still not working if I do it as above. Strange, because it works for the other sass-variables.

tysongach commented 9 years ago

Bower makes sense for things like Bourbon and Neat (because you should not change the files in those), but much less for Bitters, because it’s built to be changed by you. Overwriting Bitters variables is overly complex and can cause issues.

Can you define “doesn’t work”? Is Sass throwing an error? If so, what’s the error?

renege commented 9 years ago

I only wanna change colors, so it's fine for me like this. Use it like this in multiple projects. Always used blue, but now I wanna change that color.

The problem is, is that it keeps the default $blue color. I want it changed in another color.

tysongach commented 9 years ago

It’s hard to troubleshoot without seeing more of your codebase. Can you share? Where are you using $base-accent-color where it’s putting blue instead of red?

tysongach commented 9 years ago

@renege In you’re interested, here’s an old PR with a great discussion as to why we recommend not using Bower to install Bitters.