create account

How I created a basic Gatsby + Bulma starter template by the-dragon

View this thread on: hive.blogpeakd.comecency.com
· @the-dragon · (edited)
$24.83
How I created a basic Gatsby + Bulma starter template
<center>
![gatsby.png](https://cdn.steemitimages.com/DQmYz25V8Dcm9LjRectfMQb8525tRuoTcKiUJmntzPaENHk/gatsby.png)
</center>


## Repository

https://github.com/aviaryan/gatsby-bulma-default


## Introduction

I recently created a project called "Gatsby Bulma Default" which is a basic Gatsby starter template that includes a fully configurable Bulma out-of-the-box. I created it because Bulma and Gatsby are being used for UI development and static website development heavily these days and so I thought it would be a good idea to mix them together. 

In this post, I will go step by step on how I did it so that you don't think of this template as a black-box and can potentially create your own template if needed.  


## The Steps

To implement this project, I first cloned the [default gatsby starter pack](https://github.com/gatsbyjs/gatsby-starter-default). It is a very basic project that shows how to use Gatsby and comes with absolutely no batteries included. In fact, if you see its dependencies list, you will see that it includes almost nothing extra. 

<center>
![Screen Shot 2018-06-09 at 2.18.50 PM.png](https://cdn.steemitimages.com/DQmcviMTwwXy8Uk7QCGwiomBbs7XheqJW54j7WYdkdV6ubQ/Screen%20Shot%202018-06-09%20at%202.18.50%20PM.png)
[gatsby-starter-default on npm](https://www.npmjs.com/package/gatsby-starter-default)
</center>

I chose this starter template as the base because I wanted the user to have as much as flexibility as possible. Now, after that, I made changes to the project so that it is converted into a Bulma starter pack. 

For that, first I had to add the `bulma` package.

`> yarn add bulma`

But adding Bulma was not enough as we also want to make the Bulma installation configurable. In other words, we need SASS/SCSS support for the project.

Luckily, this is quite easy to do in Gatsby. We just need to add and enable the [SASS plugin](https://www.npmjs.com/package/gatsby-plugin-sass) and then it will work. So to install the plugin, I did -

`> yarn add gatsby-plugin-sass`

After that, we need to enable the plugin in [gatsby-config.js](https://github.com/aviaryan/gatsby-bulma-default/blob/master/gatsby-config.js). 

![carbon (1).png](https://cdn.steemitimages.com/DQmTgND1Mcj8X64wzwPSSVqKLzCLTWtqwYHwnkDWSa5Qnc5/carbon%20(1).png)

That's pretty much it. Now we can include SCSS files instead of CSS files. 
For example, this is the [index.scss](https://github.com/aviaryan/gatsby-bulma-default/blob/master/src/layouts/index.scss) that contains all the styles now and it is inspired from the official [Customize Bulma guide](https://bulma.io/documentation/overview/customize/). 

We include the SCSS file the same way we do with CSS files (with `import` statement). 

![carbon (4).png](https://cdn.steemitimages.com/DQmWTVf5mpGwoVFUW3YfCCJDNndHiPBwBHcHqkmCbajuGJv/carbon%20(4).png)

Once this was done, I had to change the default site pages so that they can better reflect the features that Bulma has. For example, I changed the [index page](https://github.com/aviaryan/gatsby-bulma-default/blob/master/src/pages/index.js) to use Bulma's `title` and `subtitle` classes. 

![carbon (2).png](https://cdn.steemitimages.com/DQmXEFHTuGCW5N2CK9DuqQZkDooSK1kaB3WCP5WK5KmhEcE/carbon%20(2).png)

I changed all the pages so that they use proper Bulma classes and then it was done. The final result can be browsed at https://aviaryan.in/gatsby-bulma-default/.


## How to use this starter pack for your own project

I have already published it on [npm](https://www.npmjs.com/package/gatsby-bulma-default) and have hosted it on [GitHub](https://github.com/aviaryan/gatsby-bulma-default) so it's quite easy if you want to start a Gatsby project with this template. Just do -

`> gatsby new my-site-name https://github.com/aviaryan/gatsby-bulma-default`

And then `cd` to the project folder and run it.

`> gatsby develop`


## Concluding Words

There are some Gatsby templates that already have Bulma preinstalled. But all of them include Bulma with some other components that many folks might not want. So I thought of creating a clean Bulma starter template. It is simple and offers complete flexibility who wants to build on a Gatsby + Bulma stack. 

For the record, here are the projects that are closest to mine. But as I have mentioned, they include other things that might get in the way of anyone looking for a clean slate. 

* https://github.com/Cethy/gatsby-starter-bloomer - Bulma with Bloomer integration
* https://github.com/gvaldambrini/gatsby-starter-bulma-storybook - Bulma with Storybook, Jest, and ESLint
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorthe-dragon
permlinkhow-i-created-a-basic-gatsby-bulma-starter-template
categoryutopian-io
json_metadata{"tags":["utopian-io","blog","gatsby","bulma"],"image":["https://cdn.steemitimages.com/DQmYz25V8Dcm9LjRectfMQb8525tRuoTcKiUJmntzPaENHk/gatsby.png","https://cdn.steemitimages.com/DQmcviMTwwXy8Uk7QCGwiomBbs7XheqJW54j7WYdkdV6ubQ/Screen%20Shot%202018-06-09%20at%202.18.50%20PM.png","https://cdn.steemitimages.com/DQmTgND1Mcj8X64wzwPSSVqKLzCLTWtqwYHwnkDWSa5Qnc5/carbon%20(1).png","https://cdn.steemitimages.com/DQmWTVf5mpGwoVFUW3YfCCJDNndHiPBwBHcHqkmCbajuGJv/carbon%20(4).png","https://cdn.steemitimages.com/DQmXEFHTuGCW5N2CK9DuqQZkDooSK1kaB3WCP5WK5KmhEcE/carbon%20(2).png"],"links":["https://github.com/aviaryan/gatsby-bulma-default","https://github.com/gatsbyjs/gatsby-starter-default","https://www.npmjs.com/package/gatsby-starter-default","https://www.npmjs.com/package/gatsby-plugin-sass","https://github.com/aviaryan/gatsby-bulma-default/blob/master/gatsby-config.js","https://github.com/aviaryan/gatsby-bulma-default/blob/master/src/layouts/index.scss","https://bulma.io/documentation/overview/customize/","https://github.com/aviaryan/gatsby-bulma-default/blob/master/src/pages/index.js","https://aviaryan.in/gatsby-bulma-default/","https://www.npmjs.com/package/gatsby-bulma-default","https://github.com/Cethy/gatsby-starter-bloomer","https://github.com/gvaldambrini/gatsby-starter-bulma-storybook"],"app":"steemit/0.1","format":"markdown"}
created2018-06-09 10:57:06
last_update2018-06-09 11:35:57
depth0
children3
last_payout2018-06-16 10:57:06
cashout_time1969-12-31 23:59:59
total_payout_value18.771 HBD
curator_payout_value6.057 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,555
author_reputation1,461,184,535,530
root_title"How I created a basic Gatsby + Bulma starter template"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id59,976,249
net_rshares9,235,220,228,307
author_curate_reward""
vote details (27)
@espoem ·
Hello, I must say that it was really easy to go through this post. It was clear, well written and I really like the images with the code. However, as all contributions are related to a particular project, I fail to see big changes you added to integrate Bulma. There were only a few changes made, which happened most likely because the original template was simple as well.

Please understand that for this reason, the final score was adjusted slightly and was not completely followed by our review questionnaire.

Anyway, keep up the good work.

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/1/13314124).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  
properties (23)
authorespoem
permlinkre-the-dragon-how-i-created-a-basic-gatsby-bulma-starter-template-20180610t200638294z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/1/13314124","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-06-10 20:06:39
last_update2018-06-10 20:06:39
depth1
children1
last_payout2018-06-17 20:06:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,037
author_reputation59,289,149,412,912
root_title"How I created a basic Gatsby + Bulma starter template"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,189,670
net_rshares1,136,684,976
author_curate_reward""
vote details (1)
@the-dragon ·
Thanks. I understand that.
properties (22)
authorthe-dragon
permlinkre-espoem-re-the-dragon-how-i-created-a-basic-gatsby-bulma-starter-template-20180611t060136511z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-06-11 06:01:36
last_update2018-06-11 06:01:36
depth2
children0
last_payout2018-06-18 06:01:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length26
author_reputation1,461,184,535,530
root_title"How I created a basic Gatsby + Bulma starter template"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id60,247,129
net_rshares0
@utopian-io ·
Hey @the-dragon
**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Contributing on Utopian**
Learn how to contribute on <a href='https://join.utopian.io'>our website</a> or by watching <a href='https://www.youtube.com/watch?v=8S1AtrzYY1Q'>this tutorial</a> on Youtube.

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-how-i-created-a-basic-gatsby-bulma-starter-template-20180611t142509z
categoryutopian-io
json_metadata"{"app": "beem/0.19.29"}"
created2018-06-11 14:25:12
last_update2018-06-11 14:25:12
depth1
children0
last_payout2018-06-18 14:25:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length507
author_reputation152,955,367,999,756
root_title"How I created a basic Gatsby + Bulma starter template"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,303,721
net_rshares0