Bulma Navbar Variables

Last Updated : 23 Jul, 2025

Bulma is an Open source CSS framework developed by Jeremy Thomas. This framework is based on the CSS Flexbox property. It is highly responsive, minimizing the use of media queries for responsive behavior.

A navbar is a horizontal navigation bar that has navbar items, buttons, dropdown menus, etc.

Classes Used:

  • navbar: It is the main component.
  • navbar-brand: We can place the logo using this class.
  • navbar-burger: It is also called the hamburger icon in the left corner of the navbar.
  • navbar-menu: The right part of the screen is visible only in desktop mode.
  • navbar-item: Items in the navigation bar are shown using this class.
  • navbar-link: This class is used to set the links to other routes.
  • navbar-dropdown: This class is used to set the dropdown menu.
  • navbar-divider: This class is used to set the horizontal line that can separate the navbar items from each other.

Variable Used: 

Name                         DescriptionTypeValueComputed ValueComputed Type
$navbar-background-colorThis provides color to the background.variable$scheme-mainhsl(0, 0%, 100%)color
$navbar-box-shadow-sizeThis variable is used to define the size of the shadow of the navbar.size0 2px 0 0  
$navbar-box-shadow-colorThis variable is used to define the color of the shadow of the navbar.variable$backgroundhsl(0, 0%, 96%)color
$navbar-heightThis variable is used to define the height of the navbar.size3.25rem  
$navbar-padding-verticalThis variable is used to define the vertical padding on the navbar.size1rem  
$navbar-padding-horizontalThis variable is used to define the horizontal padding on the navbar.size2rem  
$navbar-zThis variable is used to define the level on which you want to place your navbar.string30  
$navbar-fixed-z This variable is used to define the fixed level of the navbar.string30  
$navbar-item-colorThis variable is used to define the color of the item on the navbar.variable$texthsl(0, 0%, 29%)color
$navbar-item-hover-colorThis variable is used to define the color of the item on the navbar on hover.variable$linkhsl(229, 53%,  53%)color
$navbar-item-hover-background-colorThis variable is used to define the background color of the item on the navbar on hover.variable$scheme-main-bishsl(0, 0%, 98%)color
$navbar-item-active-colorThis variable is used to provide color to the active items only.variable$scheme-inverthsl(0, 0%, 4%)color
$navbar-item-active-background-colorThis variable is used to provide the background color to the active item of the navbar on hover.stringtransparent  
$navbar-item-img-max-heightThis variable is used to provide the max height of the image in the navbar.size1.75rem  
$navbar-burger-colorThis variable is used to provide color to the burger of the navbar.variable$navbar-item-color  
$navbar-tab-hover-background-colorThis variable is used to provide background-color to the navbar tab on hover.stringtransparent  
$navbar-tab-hover-border-bottom-colorThis variable is used to provide color to the bottom border of the navbar tab on hover.variable$linkhsl(229, 53%,  53%)color
$navbar-tab-active-colorThis variable is used to provide color to the active navbar tabs.variable$linkhsl(229, 53%,  53%)color
$navbar-tab-active-background-colorThis variable is used to provide background color to the active tabs of the navbar.stringtransparent  
$navbar-tab-active-border-bottom-colorThis variable is used to provide color to the active bottom border of the navbar.variable$linkhsl(229, 53%,  53%)color
$navbar-tab-active-border-bottom-styleThis variable is used to define style to the active bottom border.stringsolid  
$navbar-tab-active-border-bottom-widthThis variable is used to define the width of the active bottom part of the border.size3px  
$navbar-dropdown-background-colorThis variable is used to define the background color of the dropdown menu of the navbar.variable$scheme-mainhsl(0, 0%, 100%)color
$navbar-dropdown-border-topThis variable is used to provide the border-top effect on the dropdown menu of the navbar.size2px solid $border  
$navbar-dropdown-offsetThis variable is used to provide the offset effect on the dropdown menu of the navbar.size-4px  
$navbar-dropdown-arrowThis variable is used to provide an arrow effect on the dropdown menu of the navbar.variable$linkhsl(229, 53%,  53%)color
$navbar-dropdown-radiusThis variable is used to provide the radius effect on the dropdown menu of the navbar.variable$radius-large6pxsize
$navbar-dropdown-zThis variable is used to define the level of your element on the webpage.string20  
$navbar-dropdown-boxed-radiusThis variable is used to provide the boxed radius effect on the dropdown menu of the navbar.variable$radius-large6pxsize
$navbar-dropdown-boxed-shadowThis variable is used to provide the boxed shadow effect on the dropdown menu of the navbar.shadow0 8px 8px bulmaRgba($scheme-invert, 0.1), 0 0 0 1px bulmaRgba($scheme-invert, 0.1)  
$navbar-dropdown-item-hover-colorThis variable is used to provide the color to the dropdown menu of the navbar.variable$scheme-inverthsl(0, 0%, 4%)color
$navbar-dropdown-item-hover-background-colorThis variable is used to provide background color to the item of the navbar on hover.variable$backgroundhsl(0, 0%, 96%)color
$navbar-dropdown-item-active-colorThis variable is used to provide the color to the active item of the dropdown menu.variable$linkhsl(229, 53%,  53%)color
$navbar-dropdown-item-active-background-colorThis variable is used to provide a background color to the active item of the dropdown menu.variable$backgroundhsl(0, 0%, 96%)color
$navbar-divider-background-colorThis variable is used to provide the background color to the divider of the navbar.variable$backgroundhsl(0, 0%, 96%)color
$navbar-divider-heightThis variable is used to provide height to the divider of the navbar.size2px  
$navbar-bottom-box-shadow-sizeThis variable is used to provide the size of the box shadow of the navbar.size0 -2px 0 0  
$navbar-breakpointThis variable is used to provide the breakpoint of the navbar when we decrease or increase the size of the screen.variable$desktop960px + (2 * $gap)computed
$navbar-colorsThis variable is used to define the color of the navbar.variable$colorsBulma colorsmap

Syntax:

<nav class="navbar">
   <div class="...">
       ...
   </div>
</nav>

 Syntax of variable:

$property-name: property-value;

Example 1: In the below code, we will make use of the above variable to demonstrate the use of the navbar.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Bulma Variable</title>
    <link rel='stylesheet' href=
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>

    <!-- font-awesome cdn -->
    <script src=
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>
    </script>
    <link rel="stylesheet" href="style.css">

    <style>
        .title{
            color:green;
        }
        nav{
            margin-left:200px;
            margin-right:200px;
        }
    </style>
</head>

<body>
    <h1 class="title has-text-centered">
        GeekforGeeks
    </h1>
    <h3 class="subtitle has-text-centered">
        A computer science portal for geeks.
    </h3>
    <nav class="navbar">
        <div class="navbar-menu">
            <a class="navbar-item">
              Menu 1
            </a>      
            <a class="navbar-item">
              Menu 2
            </a>
            <a class="navbar-item">
               Menu 3
            </a>
            <a class="navbar-item">
               Menu 4
            </a>
            <a class="navbar-item">
               Menu 5
            </a>
            <a class="navbar-item">
               Menu 6
            </a>        
        </div>
    </nav>    
</body>
</html>

SCSS Code:

$navbar-colors: lightgreen;
.navbar{
    background-color:$navbar-colors;
}

Compiled CSS Code:

.navbar {
    background-color: lightgreen; 
}

Output:

 

Example 2: In the below code, we will make use of the above variable to demonstrate the use of the navbar.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Bulma Variable</title>
    <link rel='stylesheet' href=
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>

    <!-- font-awesome cdn -->
    <script src=
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>
    </script>
    <link rel="stylesheet" href="style.css">

    <style>
        .title{
            color:green;
        }
        nav{
            margin-left:200px;
            margin-right:200px;
        }
    </style>
</head>

<body>
    <h1 class="title has-text-centered">
        GeekforGeeks
    </h1>
    <h3 class="subtitle has-text-centered">
        A computer science portal for geeks.
    </h3>
    <nav class="navbar">
        <div class="navbar-menu">
            <a class="navbar-item">
              Menu 1
            </a>      
            <a class="navbar-item">
              Menu 2
            </a>
            <a class="navbar-item">
               Menu 3
            </a>
            <a class="navbar-item">
               Menu 4
            </a>
            <a class="navbar-item">
               Menu 5
            </a>
            <a class="navbar-item">
               Menu 6
            </a>        
        </div>
    </nav>    
</body>
</html>

SCSS Code:

$navbar-colors: green;
.navbar-item{
    color:$navbar-colors;
}

Compiled CSS Code:

.navbar-item {
    color: green;
}

Output:

 

Reference: https://bulma.io/documentation/components/navbar/

Comment