Skip to content

kingller/pandora-css-variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pandora-css-variables

generate css variables file from file globalVarFile and preserves variables of file varFile.

Install

$ npm install -D pandora-css-variables

Usage

const generateCssVariables = require('pandora-css-variables');

const options = {
  varFile: path.join(__dirname, './src/styles/variables.less'), // include all color variables in `varFile` that you want to change dynamically
  globalVarFile: path.join(__dirname, './src/styles/global-variables.less'), // the less variables in the file will generate css variables. For example, if @primary-1 is defined in the file, --primary-1 will be added to the output.
  outputFilePath: path.join(__dirname, './public/color.less'), // if provided, file will be created with generated less/styles
  options: {}, // (Optional) less options
  themeReplacement: {} // (Optional) the variables that need to replace the variables in `varFile`
}

generateCssVariables(options);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published