bulma-variables-export
Library exporting Bulma sass variables which can be used in Webpack project. Bulma variables can be imported into any Javascript/Typescript project.
Quick install
NPM
npm install bulma-variables-export
Webpack Setup
When working with Javascript/Typescript and Sass, sometimes you want to be able to share variables defined in stylesheets with your code. This is actually pretty simple with Webpack.
First make sure webpack is set up to import scss:
// webpack.config.jsmoduleexports = ... module: rules: test: /\.scss$/ use: loader: "style-loader" // creates style nodes from JS strings loader: "css-loader" // translates CSS into CommonJS loader: "sass-loader" // compiles Sass to CSS ;
import
Now you can import any Bulma variables in your project.
You can import every variables using:
You can also import specific set of variables using:
Usage
Usage in your code is very simple. The variables name are exactly defined as Bulma but in camelCase.
// *OR*// variables = require('bulma-variables-export'); consoleconsoleconsole