postcss-forced-variables

1.0.2 • Public • Published

Build Status

PostCSS Forced Variables

Description

The plugins purpose is to help enforce more consistent SASS-like variable usage in stylesheets.

Features

Provides warnings when a variable from your variables file could've been used. Throws errors when specified rules do not have variables used.

E.g 1) The following will generate a warning stating that a variable could be used here.

ruleset : ['color'], variables : {$white : #fff'} used to process the css:

body {

color: #fff;

}

E.g. 2) The following will throw an error stating that a variable should be used here.

ruleset : ['color'], variables : {$white : #fff'} used to process the css:

body{

color : red; }

Setup:

npm install postcss-forced-variables

- In your processors call forcedVariables with the following object: { ruleset : ['rules go here'],

variables : { '$variableName' : 'variableValue}

}

Setup is complete. Further details can be seen in gulp test examples.

Feel free to e-mail me at alekhrycaiko@gmail.com with any suggestions or questions!

Package Sidebar

Install

npm i postcss-forced-variables

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • alekhrycaiko