Bulma Modifiers– Bulma Css provides modifier classes which can be used to add the alternative styles. Using Modifier classes you can easily modify the default styles. Modifier classes starts with is- or has-. Here in this article, we are going to explain how we can use modifier classes in Bulma.
Bulma Modifiers | Helpers | Css Classes Syntax & Example
Let us understand how modifier classes works step by step.
Topics
- Syntax
- Helpers
- Responsive Helpers
- Typography Helpers
Syntax
Modifier classes starts with is- or has- for example- is-primary, is-link. Suppose we want to change the default button style we can use these modifier classes. Now let us go through some important modifier classes.
Change Button Color
There are following classes that can be used to change the button color in Bulma.
- is-primary
- is-link
- is-info
- is-success
- is-warning
- is-danger
Using the above modifier classes you can create the following buttons-
Bulma Add Button Color Example:
Button Primary Button Link Button Info Button Success Button Warning Button Danger |
If you run the above example it will produce output something like this-
Change Button Size
You can create small, medium or large buttons in Bulma. You can use the following classes to change size-
- is-small
- is-medium
- is-large
If you run the above example it will produce output something like this-
Change Button Style/State
You can create outlined, loading, disabled buttons using the following class-
- is-outlined
- is-loading
- is-disabled
Output of the above example will be-
Helpers
Following responsive classes are available which can be used easily anywhere-
-
is-clearfix
– Fixes an element’s floating children -
is-pulled-left
– Moves an element to the left -
is-pulled-right
– Moves an element to the right -
is-marginless
– Removes any margin -
is-paddingless
– Removes any padding -
is-overlay
– Completely covers the first positioned parent -
is-clipped
– Adds overflow hidden -
is-radiusless
– Removes any radius -
is-shadowless
– Removes any shadow -
is-unselectable
– Prevents the text from being selectable -
is-invisible
-Adds visibility hidden
Responsive Helpers
You can use the responsive helper to show/hide the content based on viewport of device.
Show
You can use following display classes-
-
block
-
flex
-
inline
-
inline-block
-
inline-flex
Hide Classes
You can use following classes to hide on specific devices-
-
is-hidden-mobile
– Hidden on Mobile devices. -
is-hidden-tablet-only
– Hidden only on Tablet. -
is-hidden-desktop-only
-Hidden only on desktop. -
is-hidden-widescreen-only
– Hidden on wide screen between 1216px and 1407px.