Bulma CSS Framework

1.0.4 · active · verified Sun Apr 19

Bulma is a modern, open-source CSS framework built entirely on Flexbox, providing a responsive and mobile-first design system. Currently at version 1.0.4, it undergoes active development with frequent bug fixes and feature enhancements, as evidenced by multiple patch releases within the 1.x series. A key differentiator is its "CSS only" philosophy, meaning it ships without any JavaScript, allowing developers to integrate their preferred front-end logic. It focuses solely on the styling layer, making it "environment agnostic." Bulma offers a comprehensive set of CSS components and utilities, and while it provides a compiled `bulma.css` file, it is highly customizable through its Sass source files, particularly since its rewrite in v1.0.0 to use Dart Sass. The framework is designed for ease of use, maintaining consistent HTML snippets across major versions to simplify upgrades.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to integrate Bulma's CSS into a modern TypeScript project using a module bundler, either by importing the pre-compiled CSS or by customizing and importing its Sass source files. It also includes a basic JS snippet to show dynamic content creation with Bulma classes.

import 'bulma/css/bulma.min.css';

// For custom Sass, create a file like `src/styles/custom-bulma.scss`:
// $primary: #00d1b2; // A custom primary color
// @import 'bulma/bulma.sass';
// Then, import it here instead of `bulma/css/bulma.min.css`:
// import '../styles/custom-bulma.scss';

// This JavaScript demonstrates adding content that will be styled by Bulma.
// Ensure your HTML has a basic structure for Bulma classes to apply.
document.addEventListener('DOMContentLoaded', () => {
    const root = document.createElement('div');
    root.className = 'section';
    root.innerHTML = `
        <div class="container">
            <h2 class="title is-2">Dynamic Content</h2>
            <p class="content">This content was added dynamically using JavaScript, styled by Bulma.</p>
            <button class="button is-danger">Dynamic Button</button>
            <div class="columns is-mobile mt-4">
                <div class="column is-half-mobile is-one-quarter-desktop">
                    <div class="box has-background-info-light">Column 1</div>
                </div>
                <div class="column is-half-mobile is-one-quarter-desktop">
                    <div class="box has-background-warning-light">Column 2</div>
                </div>
            </div>
        </div>
    `;
    document.body.appendChild(root);
});

view raw JSON →