Bulma – Functions and Mixins

Bulma Functions and Mixins

In this guide, we will discuss Bulma Functions and Mixins.

Description

Bulma uses some functions and mixins to define the color values and custom elements respectively. There are 3 types of custom functions in Bulma to specify the values and colors −

S.No.FunctionDescription
1powerNumber($number, $exp)It sends back the number value by evaluating value of exposed number to another one.
2colorLuminance($color)It specifies the element color, either as dark or light between 0 and 1. The number <= 0.5 defines dark color and > 0.5 defines light color.
3findColorInvert($color)It defines 70% transparent as black or 100% as opaque white, based on the luminance (brightness) of the color.

Mixins

The following table lists down different types of mixins which can be used with Bulma −

S.No.MixinDescription
1=arrow($color)It specifies down arrow, which can be used for selecting dropdown.
2=blockIt is used for block elements and specifies the margin-bottom of 1.5rem.
3=clearfixIt clears floated content within container and can be added at the end of an element.
4=center($size)It specifies the position of an element as center and often used for the spinner in a loading button.
5=deleteIt is used for deleting an element in modals, messages, tags etc.
6=fa($size, $dimensions)It defines style of Font Awesome icon container.
7=hamburger($dimensions)It is used for navbar toggling by creating the menu with 3 bars.
8=loaderIt defines the loading spinner for input and button spinners.
9=overflow-touchIt sets the scrolling on iOS devices, when there is an overflow of content in the container.
10=overlay($offset: 0)It creates an overlay effect of an element by making the background transparent.
11=placeholderIt defines style of an input placeholder.
12=unselectableIt makes the buttons unselectable when clicking.

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply