Skip to main content

Introduction

Bulma’s Sass variables are the foundation of its customization system. By overriding these variables, you can control every aspect of the framework’s appearance.

Variable Categories

Bulma organizes variables into two main files:
  • initial-variables.scss: Base values (colors, typography, spacing)
  • derived-variables.scss: Computed values based on initial variables

Overriding Variables with @use

The modern way to customize Bulma is using Sass’s @use rule with the with clause:
@use "bulma/sass/utilities" with (
  $primary: hsl(171, 100%, 41%),
  $family-sans-serif: "Inter", sans-serif,
  $radius: 0.5rem
);

@use "bulma/sass" as bulma;
The old @import syntax is deprecated. Always use @use for new projects.

Color Variables

Scheme Colors

Control the base hue and saturation for your color scheme:
@use "bulma/sass/utilities" with (
  $scheme-h: 221,      // Hue (0-360)
  $scheme-s: 14%,      // Saturation
  $dark-l: 20%,        // Dark theme lightness
  $light-l: 90%        // Light theme lightness
);

Grayscale Colors

Bulma provides a comprehensive grayscale palette:
// From darkest to lightest
$black: hsl(221, 14%, 4%)
$black-bis: hsl(221, 14%, 9%)
$black-ter: hsl(221, 14%, 14%)

$grey-darker: hsl(221, 14%, 21%)
$grey-dark: hsl(221, 14%, 29%)
$grey: hsl(221, 14%, 48%)
$grey-light: hsl(221, 14%, 71%)
$grey-lighter: hsl(221, 14%, 86%)
$grey-lightest: hsl(221, 14%, 93%)

$white-ter: hsl(221, 14%, 96%)
$white-bis: hsl(221, 14%, 98%)
$white: hsl(221, 14%, 100%)
The “-bis” and “-ter” suffixes provide subtle variations for layering and depth.

Theme Colors

Override Bulma’s semantic color palette:
@use "bulma/sass/utilities" with (
  $orange: hsl(14, 100%, 53%),
  $yellow: hsl(42, 100%, 53%),
  $green: hsl(153, 53%, 53%),
  $turquoise: hsl(171, 100%, 41%),
  $cyan: hsl(198, 100%, 70%),
  $blue: hsl(233, 100%, 63%),
  $purple: hsl(271, 100%, 71%),
  $red: hsl(348, 100%, 70%)
);

Derived Color Variables

These are computed from initial variables in derived-variables.scss:
// Semantic colors
$primary: $turquoise      // Main brand color
$info: $cyan             // Informational messages
$success: $green         // Success states
$warning: $yellow        // Warning messages
$danger: $red            // Error states
$light: $white-ter       // Light elements
$dark: $grey-darker      // Dark elements

// UI colors
$link: $blue             // Link color
$text: $grey-dark        // Body text
$text-weak: $grey        // Secondary text
$text-strong: $grey-darker  // Emphasized text
$background: $white-ter  // Page background
$border: $grey-lighter   // Border color
$border-weak: $grey-lightest  // Subtle borders
Example override:
@use "bulma/sass/utilities";
@use "bulma/sass/utilities/derived-variables" with (
  $primary: hsl(171, 100%, 41%),
  $link: hsl(229, 53%, 53%),
  $success: hsl(141, 71%, 48%)
);

Typography Variables

Font Families

@use "bulma/sass/utilities" with (
  $family-sans-serif: (
    "Inter",
    "SF Pro",
    "Segoe UI",
    "Roboto",
    sans-serif
  ),
  $family-monospace: (
    "Inconsolata",
    "Hack",
    "SF Mono",
    "Roboto Mono",
    monospace
  )
);

Font Sizes

Bulma uses a 7-step size scale:
$size-1: 3rem      // 48px
$size-2: 2.5rem    // 40px
$size-3: 2rem      // 32px
$size-4: 1.5rem    // 24px
$size-5: 1.25rem   // 20px
$size-6: 1rem      // 16px (base)
$size-7: 0.75rem   // 12px
Customize the scale:
@use "bulma/sass/utilities" with (
  $size-1: 3.5rem,
  $size-2: 2.75rem,
  $size-3: 2.25rem,
  $size-4: 1.75rem,
  $size-5: 1.25rem,
  $size-6: 1rem,
  $size-7: 0.875rem
);

Font Weights

$weight-light: 300
$weight-normal: 400
$weight-medium: 500
$weight-semibold: 600
$weight-bold: 700
$weight-extrabold: 800

Spacing Variables

Block Spacing

@use "bulma/sass/utilities" with (
  $block-spacing: 1.5rem  // Vertical spacing between blocks
);

Container Gap

@use "bulma/sass/utilities" with (
  $gap: 32px  // Horizontal padding for containers
);

Responsiveness Variables

Breakpoints

$tablet: 769px
$desktop: 1024px      // 960px + 2 * $gap
$widescreen: 1216px   // 1152px + 2 * $gap
$fullhd: 1408px       // 1344px + 2 * $gap
Customize breakpoints:
@use "bulma/sass/utilities" with (
  $tablet: 768px,
  $gap: 16px,
  $desktop: 960px + 2 * 16px,  // 992px
  $widescreen: 1152px + 2 * 16px,  // 1184px
  $fullhd: 1344px + 2 * 16px  // 1376px
);

Enable/Disable Breakpoints

@use "bulma/sass/utilities" with (
  $widescreen-enabled: false,  // Disable widescreen
  $fullhd-enabled: false       // Disable fullhd
);

Border Radius Variables

$radius-small: 0.25rem   // 4px
$radius: 0.375rem        // 6px (default)
$radius-medium: 0.5em    // Relative to font size
$radius-large: 0.75rem   // 12px
$radius-rounded: 9999px  // Fully rounded
Example: Remove all rounded corners:
@use "bulma/sass/utilities" with (
  $radius-small: 0,
  $radius: 0,
  $radius-medium: 0,
  $radius-large: 0,
  $radius-rounded: 0
);

Animation Variables

@use "bulma/sass/utilities" with (
  $speed: 86ms,          // Fast transitions
  $duration: 294ms,      // Standard animations
  $easing: ease-out      // Timing function
);

Prefix Variables

Control class and CSS variable naming:
@use "bulma/sass/utilities" with (
  $class-prefix: "bulma-",       // .bulma-button
  $cssvars-prefix: "bulma-",     // --bulma-primary
  $helpers-prefix: "is-",        // .is-active
  $helpers-has-prefix: "has-"    // .has-text-centered
);

Complete Example

Here’s a complete customization example:
// custom-bulma.scss
@use "bulma/sass/utilities" with (
  // Colors
  $primary: hsl(171, 100%, 41%),
  $link: hsl(229, 53%, 53%),
  $success: hsl(141, 71%, 48%),
  $warning: hsl(48, 100%, 67%),
  $danger: hsl(348, 100%, 61%),
  
  // Typography
  $family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif,
  $size-6: 1rem,
  $weight-normal: 400,
  $weight-semibold: 600,
  $weight-bold: 700,
  
  // Spacing
  $block-spacing: 2rem,
  $gap: 24px,
  
  // Borders
  $radius: 0.5rem,
  $radius-large: 1rem,
  
  // Animations
  $speed: 100ms,
  $duration: 300ms
);

@use "bulma/sass/utilities/derived-variables" with (
  $background: hsl(0, 0%, 98%),
  $border: hsl(0, 0%, 90%)
);

@use "bulma/sass" as bulma;

Next Steps

Sass Setup

Learn how to set up your build process for Sass customization

CSS Variables

Discover runtime customization with CSS custom properties

Build docs developers (and LLMs) love