bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Enhancement: Semantic color naming in variables.less

Open hornergraphic opened this issue 14 years ago • 3 comments

When changing color values in variables.less to suit your app design, having the variables named after the hex color value they represent seems illogical. Would this not be better used to describe the color's purpose?

e.g.

@blue: #049CDB; @green: #46a546; @red: #9d261d;

changes to:

@primaryColor: #049CDB; @successColor: #46a546; @warningColor: #9d261d;

hornergraphic avatar Jan 31 '12 12:01 hornergraphic

We've changed some of our variables over to more meaningful names, but we likely won't be able to do it for everything. For instance, what's the semantic value of purple or pink? Hard to discern that kind of stuff universally. Definitely room for improvement though on some more elements—we'll look out for that more.

mdo avatar Jan 31 '12 17:01 mdo

Hmm, yeah I see what you mean! Maybe if the name has no semantic meaning it could at least be 'variable neutral' (i.e. unassociated to it's default value). So @primaryColor, @secondaryColor, @teritaryColor, @accentColorOne, @accentColorTwo, etc? Appreciate this isn't so great for recall when you're referencing the variables in code but when your theming this would make sense.

hornergraphic avatar Feb 01 '12 08:02 hornergraphic

It's a duplicate of this:

https://github.com/twitter/bootstrap/issues/1435

Please don't close these tickets, these are bugs, not enhancements. The colors definitely should not be defined like that.

skorokithakis avatar Feb 01 '12 12:02 skorokithakis