Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 649 Bytes

File metadata and controls

46 lines (34 loc) · 649 Bytes

dczajkowski/color-variables-in-files

Requires variables containing colors to be declared in specified files.

Usage

{
  "rules": {
    "dczajkowski/color-variables-in-files": [["src/styles/variables.css"]]
  }
}

For this config the following applies:

/* This is allowed */

/* in src/styles/variables.css */

:root {
  --color-blue: cornflowerblue;
  --spacing-1: 1rem;
}

.a {
  --color-white: white;
}

/* in src/styles/partials/_navbar.css */

.b {
  --spacing-3: 3rem;
}

/* This is not allowed */

/* in src/styles/partials/_navbar.css */

:root {
  --color-blue: cornflowerblue;
}

.a {
  --color-white: white;
}