In your terminal, create a new folder called mybulma, navigate to it, then type the following command:
--- title: With node-sass layout: documentation doc-tab: customize doc-subtab: node-sass breadcrumb: - home - documentation - customize - customize-node-sass --- {% capture init %} npm init {% endcapture %} {% capture step_1 %}
In your terminal, create a new folder called mybulma, navigate to it, then type the following command:
This will launch an interactive setup to create package.json. When prompted for an entry point, enter sass/mystyles.scss.
You only need 2 packages to customize Bulma: node-sass and bulma itself.
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.
Let's create an HTML template which uses several Bulma components.
Notice the css/mystyles.css path for your stylesheet. This will be the location of the CSS file we will generate with Sass.
To build a CSS file from a Sass file, we can use node scripts:
css-build takes sass/mystyles.scss as an input, and outputs css/mystyles.css, while omitting the source map
css-watch builds the CSS and watches for changes
start is simply a shortcut for css-watch
To test it out, go in your terminal and run the following command:
{% highlight bash %}{{ npm_build }}{% endhighlight %}If set up correctly, you will see the following message:
To watch for changes, just launch the following command:
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:
package.json file'
content=step_1
%}