https://github.com/fl3nkey/stylus-variable-loader
📝 A stylus variables loader for webpack.
https://github.com/fl3nkey/stylus-variable-loader
javascript stylus variable webpack
Last synced: 10 months ago
JSON representation
📝 A stylus variables loader for webpack.
- Host: GitHub
- URL: https://github.com/fl3nkey/stylus-variable-loader
- Owner: FL3NKEY
- License: mit
- Created: 2018-07-02T14:20:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-03T06:35:20.000Z (over 7 years ago)
- Last Synced: 2025-03-28T03:51:09.230Z (10 months ago)
- Topics: javascript, stylus, variable, webpack
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# stylus-variable-loader
This is an experimental thing, be careful.
## Usage
``` stylus
//vars.styl
$size = 12px;
$padding = 10px 12px;
$color = #FFF;
$expr-color = alpha($color, 0.5);
$button = {
$color: white,
$background: black,
$font-size: 1.2em
}
```
``` js
//vars.js
import variables from '!!stylus-variable-loader!./path-to/vars.styl';
console.log(variables);
{
'$size': '12px',
'$padding': '10px 12px',
'$color': '#FFF',
'$expr-color': 'rgba(255, 255, 255, 0.5)',
'$button': {
'$color': 'white',
'$background': 'black',
'$font-size': '1.2em'
}
}
```