Closed sboerrigter closed 7 years ago
Maybe we can drop the implementation variables too. For example, just use $green
instead of $primary-color
. It's simpler, you don't have to check which color corresponds to which 'implementation' every time, and you can see which color is used by just reading the styling.
After thinking about this I don't think it is a good idea to drop the color implementation variables like $primary-color
. Variables like $border-color
and $heading-color
help the developer to implement the right colors and makes. This way you don't have to remember things like the grey shade of the headings.
It seems this discussion is also about the code style in @sboerrigter's example (indentation for all variables, see #801).
I would like to keep things consistent, so what's the proposal here? Indent every declaration for all selectors or just indent all declared variables? Or just indent all variables in the variables file? How about lists or maps? Should those be indented?
If we'd apply this code style, I suggest we find some ruleset for this, so things will keep being consistent no matter who works on it. Personally, I wouldn't invest time in such a trivial thing and keep things the way they are.
I agree with @luukdv. When developing, I hardly ever use the implementation variables blindly. A design is often mixed and inconsistent (because things look better that way). Most of the time, I use this workflow:
Part 3 is just overhead in my opinion. It also takes some time, because you cannot blindly use those colors, but you have to wonder: 'if this implementation variable is changed, do I want the color to change in my component as well?'. For me, things become more abstract than necessary for simple implementation.
Refactoring / changing a color isn't easier with implementation variables as well, because you have to check each component anyway.
Okay then. I've kept the code style the way it is and removed the implementation variables. Can you check my PR again?
I prefer to keep all Sass variables in a single file so you won't have to look through different files to find the variable you are looking for. For example:
text-color
could be incolors.scss
or intypography.scss
.This would look like this: https://github.com/sboerrigter/pressless/blob/master/assets/styles/abstracts/variables.scss