MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.

    Font Awsome icons in the header

    Custom CSS
    2
    11
    284
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kurtern84 Project Sponsor last edited by

      Hi!

      Anyone who knows how to use Font Awsome icons in the header?
      Tried with image in css, but with no luck using this

      .MMM-DHT-Sensor header:before {
        background: url('house-chimney-solid.png');
        display: block;
        width: 16px;
        height: 16px;
      
        /*
          These rules allow you to position the image anywhere you want in the header
        */
        position: absolute;
        right: 30px;
        top: 0px;
      }
      

      nothing shows in the header field.

      1 Reply Last reply Reply Quote 0
      • hango
        hango Module Developer last edited by

        in config js put

        {
        	module: "MMM-DHT-Sensor",
        	position: "your position",
        	header: "<i class=\"fas fa-home\"></i> Header Title",
        	classes: "classes if you have",
        	config: {
        		// your settings
        	}
        },
        

        in Font Awesome v5 don’t exist house-chimney, for v6 use

        {
        	module: "MMM-DHT-Sensor",
        	position: "your position",
        	header: "<i class=\"fa-solid fa-house-chimney\"></i> Header Title",
        	classes: "classes if you have",
        	config: {
        		// your settings
        	}
        },
        

        and you must have in custom.css this line

        @import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css");
        
        or
        
        @import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css");
        

        https://github.com/hangorazvan

        K 2 Replies Last reply Reply Quote 0
        • K
          kurtern84 Project Sponsor @hango last edited by

          @hango Thanks for the help mate! Works perfekt 🙂

          1 Reply Last reply Reply Quote 0
          • K
            kurtern84 Project Sponsor @hango last edited by

            @hango Hi again!

            Did set some classes, but the changes works when refreshed and disapper after a second.

            Do you have a solution for that?

            hango 1 Reply Last reply Reply Quote 0
            • hango
              hango Module Developer @kurtern84 last edited by

              @kurtern84 what classes?
              you can use classes if you have css manipulation but is not necessary

              https://github.com/hangorazvan

              K 1 Reply Last reply Reply Quote 0
              • K
                kurtern84 Project Sponsor @hango last edited by

                @hango

                My custom css:

                .normal {
                  color: #8a8a8a;
                }
                

                I use that one for the header, but the text turn back to white after a second

                hango 1 Reply Last reply Reply Quote 0
                • hango
                  hango Module Developer @kurtern84 last edited by

                  @kurtern84 then write

                  header {
                    color: #8a8a8a;
                  }
                  

                  https://github.com/hangorazvan

                  K 1 Reply Last reply Reply Quote 0
                  • K
                    kurtern84 Project Sponsor @hango last edited by

                    @hango Also tried that with the same result.

                    hango 1 Reply Last reply Reply Quote 0
                    • hango
                      hango Module Developer @kurtern84 last edited by

                      @kurtern84
                      “header” without period before
                      or try this

                      header {
                        color: #8a8a8a !important;
                      }
                      

                      https://github.com/hangorazvan

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        kurtern84 Project Sponsor @hango last edited by

                        @hango !important; Did the tricks!

                        Thanks so much with the help.

                        hango 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy