Open In App

Bulma Icon Colors

Bulma is a free and open-source CSS framework that can be used as an alternative to Bootstrap. It comes with pre-built components like buttons and icons. In this article, we will be seeing how to change Icon colors in Bulma. Since the icons we use are simply text, we can use text color helpers to change the color of the icons. We will use the font awesome icon package for the icons

Font Awesome Icons: Font-awesome is a web icon library that gives you scalable vector icons that can be customized in terms of color, size, and in many more aspects.



https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/font-awesome.min.css

Color Helper Classes:



Syntax:

<span class="icon">
    <i class="fas fa-home"></i>
</span>

Example: The below example shows how to change icon color using text color helper classes.




<!DOCTYPE html>
<html>
  
<head>
    <title>Bulma icon Colors</title>
    <link rel="stylesheet" 
          href=
    <link rel="stylesheet"
          href=
</head>
  
<body class="has-text-centered">
    <h1 class="is-size-2 has-text-success">GeeksforGeeks</h1>
    <b>Bulma Icon Colors</b>
    <div class="container" style="margin-top: 30px;">
        <span class="icon is-large has-text-danger">
            <i class="fas fa-2x fa-home"></i>
        </span>
        <span class="icon is-large has-text-success">
            <i class="fas fa-2x fa-check-square"></i>
        </span>
    </div>
</body>
  
</html>

Output:

Reference: https://bulma.io/documentation/elements/icon/#colors


Article Tags :