Bulma Modifiers: A Complete Guide With Examples

Bulma Modifiers

Bulma modifiers are basically started with either is- or has-. It is used to provide alternative styles to HTML elements.

Bulma provides following modifiers that is useful for :

  1. Button Colors
  2. Text Colors
  3. Responsive Layout

Button Styles

Bulma CSS provides different styles of buttons:

Primary,Link,Info,Success,Warning, Danger, etc.

To create button with different style use the followings predefined button helper classes:

is-primary, is-link, is-info, is-success, is-warning, is-danger        

General Syntax

<element class="button is-{primary | secondary | is-link | is-info | is-success | is-warning | is-danger } ">Button</element>        

Source Code

?Download

<div class="container">
   <div class="columns is-mobile">
      <div class="column">
         <button class="button is-primary">Primary</button>
      </div>
      <div class="column">
         <button class="button is-link">Link</button>
      </div>
      <div class="column">
         <button class="button is-info">Info</button>
      </div>
   </div>
   <div class="columns is-mobile">
      <div class="column">
         <button class="button is-success">Success</button>
      </div>
      <div class="column">
         <button class="button is-warning">Warning</button>
      </div>
      <div class="column">
         <button class="button is-danger">Danger</button>
      </div>
   </div>
</div>        

Button Size

There are the following types of button sizes such as small buttons, medium buttons, and large buttons.

Primary, Link, Info

Bulma Button: Size

Follow the following steps to create different size buttons:

  • Steps 1: Assign .button class as well as .is-* class to the button element base class.
  • Steps 2: Here * denotes {small | medium | large }

General Syntax

<elementclass="button is-{small | medium | large}">Button Size</element>        

Source Code

<div class="columns is-multiline has-text-centered mt-5 is-mobile">
   <div class="column is-4">
      <button type="button" class="button is-primary is-small">Primary</button>
   </div>
   <div class="column is-4">
      <button type="button" class="button is-link is-medium">Link</button>
   </div>
   <div class="column is-4">
      <button type="button" class="button is-info is-large">Info</button>
   </div>
</div>        

Button: States

There are mainly following types of the button states such as :

is-outlined , is-loading , [disabled]

Primary,Link,Info

To create different states of button, you have to follow the following steps:

  • Step 1: Assign, .button, is-{outlined| loading|} to create outline button states as well as loading button states Correspondingly.
  • Step 2: To provide different background-color to the button , assign .is-{primary | success | info | danger | warning | link} to the <button> element base class.
  • Step 3: To create a disabled button, assign disabled property to the button element.

General Syntax

<element class="btn is-{primary | success | info | danger | warning | link} is-{outline | lodaing }"></element>        

Source Code

<divclass="columns is-multiline has-text-centered mt-5 is-mobile">
    <divclass="column is-4">
        <buttontype="button"class="button is-primary is-outlined">Primary</button>
    </div>

    <divclass="column is-4">
        <buttontype="button"class="button is-link is-loading">Link</button>
    </div>

    <divclass="column is-4">
       <buttontype="button"class="button is-info"disabled>Info</button>
    </div>

</div>        

To learn more about Bulma modifiers, click here.


要查看或添加评论,请登录

Diwakar Chauhan的更多文章

  • Bootstrap Container Class

    Bootstrap Container Class

    In this tutorial, you will learn and understand the Bootstrap container class with the help of multiple examples…

  • Bootstrap Fixed Width Container

    Bootstrap Fixed Width Container

    Bootstrap containers are an essential element in the Bootstrap grid system. It plays an important role during grid…

  • Bootstrap Fluid Container

    Bootstrap Fluid Container

    Bootstrap fluid container/Bootstrap container fluid spans the entire width of the viewport or screen. It takes 100%…

  • Bootstrap Responsive Container

    Bootstrap Responsive Container

    Bootstrap responsive container covers 100% available width of the screen until the specified breakpoint, after which it…

  • Container in Bootstrap

    Container in Bootstrap

    The container in Bootstrap is used to set the padding around the content as well left and right margin to the content…

  • Bootstrap Containers

    Bootstrap Containers

    Bootstrap containers are the basic layout element in the Bootstrap grid system that is used to create empty space…

  • JSON Examples

    JSON Examples

    This section contains different JSON examples that belong to different JSON functions. Each function's feature has been…

  • HTML 5 Examples

    HTML 5 Examples

    This section consists of different HTML 5 examples that belong to different HTML 5 elements. Each element's feature has…

  • CSS 3 Examples

    CSS 3 Examples

    This section consists of different CSS 3 examples that belong to different CSS 3 components. Each component's feature…

  • Javascript Examples

    Javascript Examples

    This section consists of different Javascript examples that belong to different Javascript functions and features. JS…

社区洞察

其他会员也浏览了