In your terminal, create a new folder called mybulma
, navigate to it, then type the following command:
With node-sass
Use npm/yarn and node-sass
1. Create a package.json
file
#
This will launch an interactive setup to create package.json
. When prompted for an entry point, enter sass/mystyles.scss
.
2. Install the dev dependencies #
You only need 2 packages to customize Bulma: node-sass
and bulma
itself.
Your package.json
should look like this at this point.
3. Create a Sass file #
Create a sass
folder in which you add a file called mystyles.scss
:
Make sure to write the correct path to the bulma.sass
file.
4. Create an HTML page #
Create an HTML template which uses several Bulma components.
Save this file as mypage.html
.
Notice the css/mystyles.css
path for your stylesheet. This will be the location of the CSS file we will generate with Sass.
Open the page in your browser:
5. Add node scripts to build your CSS #
To build a CSS file from a Sass file, we can use node scripts. In package.json
, add the following:
-
css-build
takessass/mystyles.scss
as an input, and outputscss/mystyles.css
, while omitting the source map -
css-watch
builds the CSS and watches for changes -
start
is simply a shortcut forcss-watch
To test it out, go in your terminal and run the following command:
If set up correctly, you will see the following message:
Reload the page and it should be styled like this:
To watch for changes, just launch the following command:
6. Add your own Bulma styles #
Replace the content of the mystyles.scss
file with the following:
Since you are watching for changes, simply save the file to see the result:
And voilà! You've managed to install and customize Bulma.
This page is open source.
Noticed a typo? Or something unclear?
Improve this page on GitHub