Bulma Card 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.

A Bulma Card is a flexible component that can be composed of the content needed. It includes several other components that we have to add exclusively to design our content well.

Variable Used:

Variable-NameDescription.          TypeValue Computed Value
 
Computed Type
 
$card-colorThis variable is used to provide color to the card.variable$texthsl(0, 0%, 29%)color
$card-background-colorThis variable is used to provide background color to the card. variable$scheme-mainhsl(0, 0%, 100%)color
$card-shadowThis variable is used to provide shadow to the card.variable                 $shadow0 0.5em 1em -0.125em rgba($scheme-invert, 0.1), 0 0px 0 1px rgba($scheme-invert, 0.02)shadow
$card-radiusThis variable is used to define the radius of the card.size0.25rem  
$card-header-background-colorThis variable is used to provide background color to the header.stringtransparent  
$card-header-colorThis variable is used to provide color to the header.variable$text-stronghsl(0, 0%, 21%)color
$card-header-paddingThis variable is used to define padding to the header.size0.75rem 1rem  
$card-header-shadowThis variable is used to provide shadow to the header.shadow0 0.125em 0.25em rgba($scheme-invert, 0.1)  
$card-header-weightThis variable is used to provide weight to the header.variable$weight-bold700font-weight
$card-content-background-colorThis variable is used to provide background color to the content.stringtransparent  
$card-content-paddingThis variable is used to provide padding to the content.size1.5rem  
$card-footer-background-colorThis variable is used to provide a background color to the footer of the card.stringtransparent  
$card-footer-border-topThis variable is used to provide a border-top to the footer.size1px solid $border-light  
$card-footer-paddingThis variable is used to provide padding to the footer.size0.75rem  
$card-media-marginThis variable is used to provide a margin to the card.variable            $block-spacing1.5remsize

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

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 Variable</title>
</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-5'>
                    <div class="card">
                        <div class="card-content">
                            <p class='is-success'>
                                GeeksforGeeks 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 .
                            </p>
        
                        </div>
                    </div>
                </div>
            </div>
        </div>        
    </center>
</body>
</html>

SCSS Code:

$card-color: hsl(0, 0%, 29%);
.card {
   color:$card-color;
}

Compiled CSS Code:

.card {
   color: #4a4a4a;
}

Output:

 

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

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 Variable</title>
</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-5'>
                    <div class="card">
                        <div class="card-content">
                            <p class='is-success'>
                                GeeksforGeeks 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 .
                            </p>
        
                        </div>
                    </div>
                </div>
            </div>
        </div>    
    </center>
</body>
</html>

SCSS Code:

$card-background-color: lightgreen;
.card {
   background-color:$card-background-color;
}

CSS Code:

.card {
 background-color: lightgreen; }

Output:

 

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

Comment