Bulma Message Variables

Last Updated : 23 Jul, 2025

Bulma is a free and open-source CSS framework based on Flexbox. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses classes to implement its design.

The Message component in Bulma provides colored box-type placeholders to emphasize certain parts of the page. It includes several other components that can be added to design the content. 

Variable Used:

Variable-NameDescriptionType        Value        Computed ValueComputed Type
$message-background-colorThis variable is used to define the background color of the message.
        variable
               
$backgroundhsl(0, 0%, 96%)color
$message-radiusThis variable is used to define the radius of the radius.variable
 
$radius4pxsize
$message-header-background-colorThis variable is used to define the background color of the message.variable
 
$texthsl(0, 0%, 29%)color
$message-header-colorThis variable is used to define the color of the header.variable
 
$text-invert#fffcolor
$message-header-weightThis variable is used to define the weight of the header.variable
 
$weight-bold700font-weight
 
$message-header-paddingThis variable is used to define the padding to the header.size0.75em 1em  
$message-header-radiusThis variable is used to define the radius of the header.variable$radius4pxsize
 
$message-body-border-colorThis variable is used to define the border color of the message.variable$borderhsl(0, 0%, 86%)color
$message-body-border-widthThis variable is used to define the width of the border of the message.size0 0 0 4px  
$message-body-colorThis variable is used to define the color of the message.variable$texthsl(0, 0%, 29%)color
 
$message-body-paddingThis variable is used to define the padding of the message.size1.25em 1.5em  
$message-body-radiusThis variable is used to define the radius of the message.variable$radius4pxsize
$message-body-pre-background-colorThis variable is used to define the background color of the pre-message.variable
 
$scheme-mainhsl(0, 0%, 100%)color
$message-body-pre-code-background-colorThis variable is used to define the background color of the body.stringtransparent  
$message-header-body-border-widthThis variable is used to define the width of the header body.string0  
$message-colorsThis variable is used to define the color of the message.variable$colorsBulma colorsmap

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

HTML
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content=
        "width=device-width,initial-scale=1">
    <link rel="stylesheet" href=
"https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
    <link rel="stylesheet" href="style.css">
        
    <title>Bulma message variable</title>
   <!-- font-awesome cdn -->
   <script src=
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>
    </script>
</head>

<body>
    <center>
        <h1 class="title" style="color:green;" >
            GeeksforGeeks
        </h1>        
        <h3 class="subtitle">
            A computer science portal for geeks
        </h3>  

        <div class='container has-text-centered'>
            <div class='columns is-mobile is-centered'>
              <div class='column is-4'>
                <article class="message is-primary">
                    <div class="message-header">                
                        <p>GeeksforGeeks</p>
                        <button class="delete" aria-label="delete">
                      </button>
                    </div>
                    <div class="message-body">
                        <strong>'GeeksforGeeks'</strong> is a
                         computer science portal.it was created
                         with a goal in mind to provide well
                         written, well thought and well explained
                         solutions for selected questions. The
                         core team of five super geeks
                         constituting of technology lovers and
                         computer science enthusiasts have been
                         constantly working in this direction.
                    </div>
                </article>
              </div>
           </div>
        </div>     
    </center>
</body>
</html>

SCSS Code:

$message-background-color:lightgreen;
.message-body{
   background-color:$message-background-color;
}

Compiled CSS Code:

.message-body {
 background-color: lightgreen; }

Output:

 

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

HTML
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content=
        "width=device-width,initial-scale=1">
    <link rel="stylesheet" href=
"https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
    <link rel="stylesheet" href="style.css">
    

    <title>Bulma message variable</title>
   <!-- font-awesome cdn -->
   <script src=
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>
    </script>
</head>

<body>
    <center>
        <h1 class="title" style="color:green;" >
            GeeksforGeeks
        </h1>        
        <h3 class="subtitle">
            A computer science portal for geeks
        </h3>  

        <div class='container has-text-centered'>
            <div class='columns is-mobile is-centered'>
              <div class='column is-4'>
                <article class="message is-primary">
                    <div class="message-header">                
                        <p>GeeksforGeeks</p>
                        <button class="delete" aria-label="delete">
                      </button>
                    </div>
                    <div class="message-body">
                        <strong>'GeeksforGeeks'</strong> is a
                         computer science portal.it was created
                         with a goal in mind to provide well
                         written, well thought and well explained
                         solutions for selected questions. The
                         core team of five super geeks
                         constituting of technology lovers and
                         computer science enthusiasts have been
                         constantly working in this direction.
                    </div>
                </article>
              </div>
           </div>
        </div>     
    </center>
</body>
</html>

SCSS Code:

 $message-header-weight:20px;
.message-body
{
  font-size:$message-header-weight;
}

Compiled CSS Code:

.message-body
{
   font-size: 20px; 
}

Output:

 

Reference: https://bulma.io/documentation/components/message/#variables

Comment