Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gmfun/rollup-plugin-sass-variables
rollup plugin for loading sass/scss variables as javascript object
https://github.com/gmfun/rollup-plugin-sass-variables
Last synced: 25 days ago
JSON representation
rollup plugin for loading sass/scss variables as javascript object
- Host: GitHub
- URL: https://github.com/gmfun/rollup-plugin-sass-variables
- Owner: gmfun
- Created: 2018-07-22T16:41:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-18T02:53:04.000Z (over 5 years ago)
- Last Synced: 2024-03-15T08:06:05.677Z (9 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - sass-variables - Import SASS variables as Objects. (Plugins / CSS)
README
# rollup-plugin-sass-variables
### Rollup plugin for loading sass/scss variables as javascript object
## Installation
```bash
npm install rollup-plugin-sass-variables -D
// or
yarn add rollup-plugin-sass-variables --dev
```## Usage
Call the pluglin inside `plugins` array```js
import scssVariable from 'rollup-plugin-sass-variables'export default {
...
plugings: [
...
scssVariable()
]
}
```Import `.scss` or `.sass` file like any of the following
```js
import variables from 'variables!../../styles/colors.scss'import variables from 'sass-variable-loader!../../styles/colors.scss'
import variables from '!!sass-variable-loader!../../styles/colors.scss'
import variables from '!!sass-variable-loader?preserveVariableNames!../../styles/colors.scss'
```