SASS/SCSS FFI
Require JS values from SASS/SCSS
Features
ffi-require($module-path, $property-path: null)
.js
file
Import all values from a // themes.js moduleexports = light: color: 'white' background: 'black' dark: color: 'black' background: 'white' ;
// themes.scss ; ;; body.theme-light body.theme-dark
.js
file
Import a single property from a // config.js moduleexports = env: processenv;
// hack.scss
Install
yarn add sass-ffi
Usage with Webpack
Simply replace sass-loader
with sass-ffi/webpack-loader
.
node-sass
Usage with const sass = ;const withSassFfiOptions = ; sass;