Skip to content

xtephan/lesshint-color-variable-linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Lesshint Color Variable Linter

npm

Example

invalid

.foo {
    color: red;
    background-color: #000000;
    border-color: rgb(0,0,0);
    text-decoration-color: rgba(0,0,0,1);
}

valid

.foo {
    color: @foo-color;
    background-color: @foo-background-color;
    border-color: @foo-border-color;
    text-decoration-color: @foo-decoration-color;
}

Install

$ npm install lesshint-color-variable-linter

Usage

In your lesshint.json configuration add the following:

    "colorAsVariable" : {
        "enabled" : true,
        "severity" : "warning"
    }

When running lesshint:

lesshint src/less/ lib/style.less --linters lesshint-color-variable-linter

Options

  • enabled: Turn on/off the linter rule. Values true or false.
  • severity: Severity levels of the linter. Values error or warning. Default is set to warning.

About

Linter for lesshint that enforces colors to be declared as variables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published