Skip to content

Instantly share code, notes, and snippets.

@davistran86
Last active January 19, 2022 15:45
Show Gist options
  • Save davistran86/91c1b732070a9bb519136525c9f37e02 to your computer and use it in GitHub Desktop.
Save davistran86/91c1b732070a9bb519136525c9f37e02 to your computer and use it in GitHub Desktop.
Use Bulma with Create React App

Install

npx create-react-app react-bulma
npm i bulma node-sass

Usage

To import all, in App.js:

import 'bulma'

To import only what you need from Bulma, don't add import 'bulma' in App.js but change App.css to App.scss and import only what you need:

// Import only what you need from Bulma
@import "../node_modules/bulma/sass/utilities/_all.sass";
@import "../node_modules/bulma/sass/base/_all.sass";
@import "../node_modules/bulma/sass/elements/button.sass";
@import "../node_modules/bulma/sass/elements/container.sass";
@import "../node_modules/bulma/sass/elements/title.sass";
@import "../node_modules/bulma/sass/form/_all.sass";
@import "../node_modules/bulma/sass/components/navbar.sass";
@import "../node_modules/bulma/sass/layout/hero.sass";
@import "../node_modules/bulma/sass/layout/section.sass";
@import "../node_modules/bulma/sass/grid/columns.sass";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment