Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# rollup-plugin-sass-variables

### Rollup plugin for loading sass/scss variables as javascript object


Software License


Issues


JavaScript Style Guide


NPM

## 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'
```