https://github.com/indexzero/postcss-global-scss-vars
Inject global variables into your scss using postcss
https://github.com/indexzero/postcss-global-scss-vars
Last synced: 9 months ago
JSON representation
Inject global variables into your scss using postcss
- Host: GitHub
- URL: https://github.com/indexzero/postcss-global-scss-vars
- Owner: indexzero
- License: mit
- Created: 2016-04-04T15:11:05.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-04T15:44:25.000Z (about 10 years ago)
- Last Synced: 2024-10-18T21:05:30.347Z (over 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-global-scss-vars
Inject global variables into your scss using postcss. This is a `postcss` plugin for the `postcss-scss` syntax which prepends variables into any `scss` file. e.g.
``` scss
/* Any scss content */
```
becomes
``` scss
$anyVariable: #000;
$otherVariable: #FFF;
$heyAVariable: #333;
/* Any scss content */
```
## Usage
Simple usage can be inferred from the tests:
``` js
var postcss = require('postcss');
var syntax = require('postcss-scss');
var globalVars = require('postcss-global-scss-vars');
var injectVars = globalVars({
variables: {
anyVariable: '#000',
otherVariable: '#FFF',
heyAVariable: '#333'
}
});
var processor = postcss([injectVars]);
var output = processor.process('/* Any scss content */', { syntax: syntax });
console.log(output.css);
```
##### LICENSE: MIT
##### AUTHOR: [Charlie Robbins](https://github.com/indexzero)