Rule idea: color-no-non-variables
See original GitHub issueSomeone may want to enforce that any color values are named and reused as variables.
This can make the code more legible and DRY.
// bad
.foo { color: pink; background: #fff; }
// good
$some-color: pink;
$some-background: #fff;
.foo { color: $some-color; background: $some-backgorund; }
Issue Analytics
- State:
- Created 8 years ago
- Reactions:51
- Comments:15
Top Results From Across the Web
What do you name color variables? | CSS-Tricks
I first give a name to all the colors I use using that tool, for example “$color-cornflower-blue: #6195ED;” and then I create variables...
Read more >Managing color variables in front-end project - Akshay Jain
Managing color variables in front-end project · gray colors (gray, black and white) · non-gray colors (rest other colors).
Read more >Variables, Common CSS Rules and Intro to SASS | Hitchhikers
There are some pre-built color options that you can specify for any property that has a color (ex. background-color, color, border, etc). For...
Read more >How to Choose Colors for Data Visualizations - Chartio
Qualitative colors are used to identify election candidates in this line chart of support over time. A qualitative palette is used when the...
Read more >Colors and fonts | IntelliJ IDEA Documentation - JetBrains
By default, the color scheme defines syntax highlighting for reserved words and other symbols in your source code: operators, keywords, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@davidtheclark If you have variables in a
variables.scss
or similar file, you could setso you can’t have either
color: #fff
orcolor: white
, and just disable linting for those values where they are set.These are some links: no-color-hex no-color-keywords no-color-literals
variable-for-property