Bulma CSS Framework Ultimate Cheatsheet

Introduction: What is Bulma and Why Use It?

Bulma is a free, open-source CSS framework based on Flexbox that provides ready-to-use frontend components. Created by Jeremy Thomas in 2016, Bulma offers a modern, responsive design system without any JavaScript dependencies. Its lightweight nature (only ~200KB minified), modular structure, and intuitive class naming make it an excellent choice for rapid development of responsive websites and applications.

Key advantages:

  • 100% responsive and mobile-first
  • Modular architecture (import only what you need)
  • Pure CSS (no JavaScript dependencies)
  • Readable, human-friendly naming conventions
  • Active community and regular updates
  • Modern Flexbox-based grid system

Core Concepts & Structure

Installation Options

MethodCommand/LinkNotes
NPMnpm install bulmaRecommended for most projects
CDN<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">Quick setup without installation
Downloadbulma.io/downloadFor offline development
Starter Templatesbulma.io/templatesPre-built templates to jumpstart projects

Modular Import Structure

For optimized builds, import only the components you need:

// Import specific Bulma components
@import "bulma/sass/utilities/_all.sass";
@import "bulma/sass/base/_all.sass";
@import "bulma/sass/elements/button.sass";
@import "bulma/sass/components/navbar.sass";
// etc.

Bulma’s File Structure

bulma/
├── css/
│   ├── bulma.css
│   └── bulma.min.css
└── sass/
    ├── base/
    ├── components/
    ├── elements/
    ├── form/
    ├── grid/
    ├── helpers/
    ├── layout/
    └── utilities/

Responsive Design System

Viewport Breakpoints

Breakpoint NameWidthClass PrefixUsage
Mobile< 768pxis-* (default)Base styling
Tablet≥ 769pxis-*-tabletTablet-specific styles
Desktop≥ 1024pxis-*-desktopDesktop-specific styles
Widescreen≥ 1216pxis-*-widescreenWidescreen-specific styles
Fullhd≥ 1408pxis-*-fullhdFull HD-specific styles

Example: is-half-mobile is-one-third-tablet is-one-quarter-desktop

Visibility Helpers

ClassEffect
is-hidden-mobileHidden on mobile only
is-hidden-tablet-onlyHidden on tablet only
is-hidden-desktop-onlyHidden on desktop only
is-hidden-widescreen-onlyHidden on widescreen only
is-hidden-touchHidden on mobile and tablet
is-hidden-desktopHidden on desktop, widescreen, and fullhd

Grid System

Columns

Basic structure:

<div class="columns">
  <div class="column">First column</div>
  <div class="column">Second column</div>
  <div class="column">Third column</div>
</div>

Column Sizes

ClassWidth
is-full100%
is-four-fifths80%
is-three-quarters75%
is-two-thirds66.6666%
is-three-fifths60%
is-half50%
is-two-fifths40%
is-one-third33.3333%
is-one-quarter25%
is-one-fifth20%
is-1 through is-128.3333% to 100% (12-column system)

Column Modifiers

ClassEffect
is-narrowColumn takes only the space it needs
is-offset-*Shifts column to the right (e.g., is-offset-3)
is-mobileMobile-first columns (stacked on mobile)
is-multilineAllows columns to wrap
is-centeredCenters columns horizontally
is-vcenteredCenters columns vertically
is-gaplessRemoves gaps between columns
is-variableVariable gap widths (is-0 through is-8)

Typography

Text Size Classes

ClassSize
is-size-13rem
is-size-22.5rem
is-size-32rem
is-size-41.5rem
is-size-51.25rem
is-size-61rem (default)
is-size-70.75rem

Responsive variants: is-size-1-mobile, is-size-1-tablet, etc.

Text Alignment

ClassEffect
has-text-centeredCenter-aligned text
has-text-justifiedJustified text
has-text-leftLeft-aligned text
has-text-rightRight-aligned text

Responsive variants: has-text-centered-mobile, has-text-left-desktop, etc.

Text Transformation

ClassEffect
is-capitalizedTransforms first letter of each word to uppercase
is-lowercaseTransforms all letters to lowercase
is-uppercaseTransforms all letters to uppercase
is-italicItalicizes text
has-text-weight-lightSets font weight to light
has-text-weight-normalSets font weight to normal
has-text-weight-mediumSets font weight to medium
has-text-weight-semiboldSets font weight to semibold
has-text-weight-boldSets font weight to bold

Color System

Context Colors

Class PrefixPurpose
is-primaryPrimary brand color
is-linkSecondary brand color
is-infoInformational elements
is-successSuccess elements
is-warningWarning elements
is-dangerError/danger elements
is-lightLight elements
is-darkDark elements
is-blackBlack elements
is-whiteWhite elements

Color Modifiers

ModifierEffect
is-lightLighter shade (e.g., is-primary is-light)
has-text-*Text color (e.g., has-text-primary)
has-background-*Background color (e.g., has-background-info)

Common UI Components

Buttons

Basic usage:

<button class="button is-primary">Primary Button</button>

Button Styles

ClassEffect
is-outlinedOutlined button
is-invertedInverted colors
is-roundedRounded corners
is-loadingLoading state
is-staticStatic button (looks inactive)
is-ghostGhost button (transparent background)

Button Sizes

ClassSize
is-smallSmall button
is-normalNormal button (default)
is-mediumMedium button
is-largeLarge button

Navbar

Basic structure:

<nav class="navbar" role="navigation" aria-label="main navigation">
  <div class="navbar-brand">
    <a class="navbar-item" href="#">
      <img src="logo.png" alt="Logo">
    </a>
    <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
      <span aria-hidden="true"></span>
      <span aria-hidden="true"></span>
      <span aria-hidden="true"></span>
    </a>
  </div>
  
  <div class="navbar-menu">
    <div class="navbar-start">
      <a class="navbar-item">Home</a>
      <div class="navbar-item has-dropdown is-hoverable">
        <a class="navbar-link">Dropdown</a>
        <div class="navbar-dropdown">
          <a class="navbar-item">Item 1</a>
          <a class="navbar-item">Item 2</a>
        </div>
      </div>
    </div>
    
    <div class="navbar-end">
      <div class="navbar-item">
        <div class="buttons">
          <a class="button is-primary">Sign up</a>
          <a class="button is-light">Log in</a>
        </div>
      </div>
    </div>
  </div>
</nav>

Navbar Modifiers

ClassEffect
is-fixed-topFixes navbar to top
is-fixed-bottomFixes navbar to bottom
is-spacedAdds vertical padding
has-shadowAdds shadow
is-transparentMakes background transparent

Cards

Basic structure:

<div class="card">
  <div class="card-image">
    <figure class="image is-4by3">
      <img src="image.jpg" alt="Card image">
    </figure>
  </div>
  <div class="card-content">
    <div class="media">
      <div class="media-content">
        <p class="title is-4">Card title</p>
        <p class="subtitle is-6">Subtitle</p>
      </div>
    </div>
    <div class="content">
      Card content goes here.
    </div>
  </div>
  <footer class="card-footer">
    <a href="#" class="card-footer-item">Footer item</a>
  </footer>
</div>

Forms

Basic form elements:

<div class="field">
  <label class="label">Label</label>
  <div class="control">
    <input class="input" type="text" placeholder="Text input">
  </div>
  <p class="help">Help text</p>
</div>

<div class="field">
  <div class="control">
    <div class="select">
      <select>
        <option>Select dropdown</option>
      </select>
    </div>
  </div>
</div>

<div class="field">
  <div class="control">
    <label class="checkbox">
      <input type="checkbox">
      Checkbox
    </label>
  </div>
</div>

<div class="field">
  <div class="control">
    <label class="radio">
      <input type="radio" name="answer">
      Radio option
    </label>
  </div>
</div>

Form Control Modifiers

ClassEffect
is-focusedFocused state
is-activeActive state
is-loadingLoading state
has-icons-leftLeft icon
has-icons-rightRight icon
is-expandedExpanded width

Layout Components

Hero Sections

<section class="hero is-primary">
  <div class="hero-body">
    <p class="title">Hero title</p>
    <p class="subtitle">Hero subtitle</p>
  </div>
</section>

Hero Modifiers

ClassEffect
is-smallSmall hero
is-mediumMedium hero
is-largeLarge hero
is-fullheightFull height hero
is-fullheight-with-navbarFull height minus navbar height
is-boldBold gradient effect

Containers

<div class="container">
  <!-- Content inside a centered container -->
</div>
ClassEffect
is-fluidFull width on all devices, with margins
is-widescreenMaximum 1152px width
is-fullhdMaximum 1344px width
is-max-desktopMaximum 1344px width
is-max-widescreenMaximum 1152px width

Section

<section class="section">
  <!-- Content inside a section with padding -->
</section>
ClassEffect
is-mediumMedium padding
is-largeLarge padding

Helper Classes

Spacing Helpers

Class PatternFunction
m-*Margin on all sides (0-6)
mt-*Margin top (0-6)
mr-*Margin right (0-6)
mb-*Margin bottom (0-6)
ml-*Margin left (0-6)
mx-*Horizontal margin (0-6)
my-*Vertical margin (0-6)
p-*Padding on all sides (0-6)
pt-*Padding top (0-6)
pr-*Padding right (0-6)
pb-*Padding bottom (0-6)
pl-*Padding left (0-6)
px-*Horizontal padding (0-6)
py-*Vertical padding (0-6)

Display Helpers

ClassEffect
is-blockdisplay: block
is-flexdisplay: flex
is-inlinedisplay: inline
is-inline-blockdisplay: inline-block
is-inline-flexdisplay: inline-flex
is-hiddendisplay: none

Flexbox Helpers

ClassEffect
is-flex-direction-rowflex-direction: row
is-flex-direction-columnflex-direction: column
is-justify-content-startjustify-content: flex-start
is-justify-content-endjustify-content: flex-end
is-justify-content-centerjustify-content: center
is-justify-content-space-betweenjustify-content: space-between
is-justify-content-space-aroundjustify-content: space-around
is-align-items-startalign-items: flex-start
is-align-items-endalign-items: flex-end
is-align-items-centeralign-items: center
is-align-items-baselinealign-items: baseline
is-align-items-stretchalign-items: stretch

Common Challenges & Solutions

Challenge 1: Making Navbar Responsive

Problem: The navbar burger doesn’t automatically open on mobile.

Solution: Add JavaScript to toggle the .is-active class:

document.addEventListener('DOMContentLoaded', () => {
  // Get all "navbar-burger" elements
  const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);

  // Add a click event on each of them
  $navbarBurgers.forEach(el => {
    el.addEventListener('click', () => {
      // Get the target from the "data-target" attribute
      const target = el.dataset.target;
      const $target = document.getElementById(target);

      // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
      el.classList.toggle('is-active');
      $target.classList.toggle('is-active');
    });
  });
});

Challenge 2: Customizing Bulma’s Default Colors

Problem: Need to customize the default color scheme.

Solution: Create your own Sass variables file:

// Custom variables
$primary: #8A4D76;
$info: #FA7C91;
$success: #23D160;
$warning: #FFDD57;
$danger: #FF3860;

// Import Bulma after defining variables
@import "bulma/bulma.sass";

Challenge 3: Fixed Table Headers

Problem: Large tables need fixed headers for scrolling.

Solution: Combine Bulma with custom CSS:

<div class="table-container" style="max-height: 400px; overflow-y: auto;">
  <table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
    <thead style="position: sticky; top: 0; background-color: white; z-index: 1;">
      <tr>
        <th>Header 1</th>
        <th>Header 2</th>
      </tr>
    </thead>
    <tbody>
      <!-- Table content -->
    </tbody>
  </table>
</div>

Best Practices & Tips

1. Modular Import for Performance

Only import the Bulma components you need:

// Import only what you need
@import "bulma/sass/utilities/_all.sass";
@import "bulma/sass/elements/button.sass";
// etc.

2. Mobile-First Approach

  • Start with mobile designs, then enhance for larger screens
  • Use responsive helpers like is-hidden-mobile strategically
  • Test on actual devices or device simulators

3. Extend Rather Than Override

Create your own classes that extend Bulma’s:

.special-button {
  @extend .button;
  @extend .is-primary;
  border-radius: 0;
}

4. Use Sass Functions for Custom Colors

// Create a custom color using Bulma's functions
@import "bulma/sass/utilities/functions";
$custom-color: findLightColor(findColorInvert($primary));

5. Avoid Overusing Columns

  • Don’t nest more than 3 levels of columns
  • Use container with appropriate size modifiers
  • Consider tiles for complex grid layouts

6. Leverage Built-In Color Functions

// Create lighter/darker shades using Bulma's functions
$primary-light: findLightColor($primary);
$primary-dark: findDarkColor($primary);

7. Optimize Loading Time

  • Consider using Purgecss to remove unused CSS
  • Use asynchronous CSS loading for non-critical styles
  • Combine with modern loading techniques like preload/prefetch

Resources for Further Learning

Official Documentation

Community Extensions

Learning Resources

Development Tools


This cheatsheet covers the essentials of Bulma CSS Framework. For more detailed information and examples, refer to the official documentation at bulma.io.

Scroll to Top