scaled-vars
A Javascript library for mapping and applying CSS custom properties from a numerical range.
Getting Started
Installing
To install scaled-vars
, run the following command in your terminal:
npm install --save scaled-vars
Sample Usage
// Import statement - ES5 Syntax.var ScaledVars = ; // Import statement - ES6 Syntax.; // Initialize library with list of variable options.var variables = name: 'my-var' scale: ScaledVarsScales name: 'my-other-var' scale: ScaledVarsScales x + 2 unit: 'px' element: document ; // Update variables and set them as CSS Custom Properties on the DOMvariables;// 'my-var' => '3' (applied to Document's ":root" element)// 'my-other-var' => '5px' (applied to specified element)
Scripts
Cutting a build
To cut a build, run:
npm run build
Development
To start the dev server, run:
npm run dev
Tests
To run unit tests, run:
npm test
API
Coming soon.