https://github.com/davidkpiano/sassport-dynamic
Dynamic imports for Node-Sass using Sassport
https://github.com/davidkpiano/sassport-dynamic
Last synced: 2 months ago
JSON representation
Dynamic imports for Node-Sass using Sassport
- Host: GitHub
- URL: https://github.com/davidkpiano/sassport-dynamic
- Owner: davidkpiano
- License: mit
- Created: 2016-01-09T22:03:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-13T18:46:05.000Z (over 9 years ago)
- Last Synced: 2025-02-04T17:21:00.792Z (4 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sassport Dynamic Imports
Import dynamically in Sass using [Sassport](https://github.com/davidkpiano/sassport).## Quick Start
First, install [Sassport](https://github.com/davidkpiano/sassport) and the Sassport-Dynamic module via NPM:```bash
npm install sassport sassport-dynamic --save
```Then, add any global `$variables` that you want to use in your imports to Sassport using `.globals({...})`:
```js
var sassport = require('sassport');
var sassportDynamic = require('sassport-dynamic');sassport([ sassportDynamic ])
.globals({
'$theme': 'material'
})
.render({
file: 'main.scss'
}, function(err, result) {
// output result
});
```Any variables that you defined in `.globals()` will now be interpolated with the `!dynamic` loader:
```scss
// main.scss
@import 'themes/#{$theme} !dynamic';
```This will output the same result as if you had `@import 'themes/material';`.