Bulma is built using Sass. It uses Sass variables to define colors, sizes, spacing, and other aspects of the framework.
Install the dependencies
#
To customize Bulma with Sass, you first need to install Sass. The recommended approach is to use the sass
npm package.
In your package.json
, add one script to build Bulma, one to build and watch for changes:
Your whole package.json
should look like this:
Create your Sass file
#
Next to your package.json
, create a my-bulma-project.scss
file.
To overwrite Bulma’s Sass variables with your own value, write @use
and the with
keyword, which takes a Sass map:
Test out your setup by running the following command:
You should see 2 files appearing next to the other ones:
my-bulma-project.css
, your CSS output file
my-bulma-project.css.map
, an optional source map
Add an HTML page
#
To view your Bulma project come to life, create an index.html
page with the following content:
Final result
#
Your project folder should look like this:
|
index.html |
|
my-bulma-project.css |
|
my-bulma-project.css.map |
|
my-bulma-project.scss |
|
package.json |
And your final page will look like this: