VOOZH about

URL: https://www.geeksforgeeks.org/css/bulma-file-variables/

⇱ Bulma File Variables - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bulma File Variables

Last Updated : 23 Jul, 2025

Bulma is a free, 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 file element is used to upload custom file input. The ‘file’ component comprises several sub-elements that we have to add exclusively to design our content well. 

These elements are listed below.

  • file-label: It is the actual interactive and clickable part of the file element.
  • file-input: It is the native file input, hidden for styling purposes.
  • file-cta: It is the upload call-to-action.
  • file-icon: It is an optional upload icon.
  • file-label:  It is the “Choose a file…” text
  • file-name: It is the container for the chosen file name.

Variable Used:

NameDescriptionTypeValueComputed ValueComputed Type
$file-border-colorThis variable is used to provide border color to the file.variable       $borderhsl(0, 0%, 86%)color
$file-radiusThis variable is used to provide a radius to the file.variable$radius4pxsize
$file-cta-background-colorThis variable is used to provide background color to the file.variable$white-terhsl(0, 0%, 96%)color
$file-cta-colorThis variable is used to provide color to the file.variable$grey-darkhsl(0, 0%, 29%)color
$file-cta-hover-colorThis variable is used to provide color on hover to file.variable$grey-darkerhsl(0, 0%, 21%)color
$file-cta-active-colorThis variable is used to provide color to the active file.variable$grey-darkerhsl(0, 0%, 21%)color
$file-name-border-colorThis variable is used to provide border color to the file name.variable$borderhsl(0, 0%, 86%)color
$file-name-border-styleThis variable is used to provide border style to the file name.stringsolid
$file-name-border-widthThis variable is used to provide border width to the file name.size1px 1px 1px 0
$file-name-max-widthThis variable is used to provide the max width of file name.size16em

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

SCSS Code:

$file-cta-background-color:green;
.container {
 background-color:$file-cta-background-color;
}

Compiled CSS Code:

.container {
 background-color: green; 
}

Output:

👁 Image
 

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

SCSS Code:

$file-name-border-width:5px solid green;
.container {
 border:$file-name-border-width;
}

Compiled CSS Code:

.container {
 border: 5px solid green;
}

Output:

👁 Image
 

Reference: https://bulma.io/documentation/form/file/

Comment
Article Tags: