thomasloven / hass-fontawesome

🔹 Use icons from fontawesome in home-assistant
Other
274 stars 52 forks source link

hass-fontawesome

hacs_badge

Use free icons from the fontawesome version 6.4.2 set in Home-assistant.

Installation instructions

Icon sets

The icons are divided into three sets.

Usage

Find the icon you want in the gallery.

The three icon sets have different prefixes: fas:, far: and fab: respectively.

So,

image

The icons are useable anywhere in Home Assistant - not only in lovelace.

Using with custom icons

If you have other svg icons you want to use (including but not limited to the Fontawesome Pro set), you can do so by placing the .svg files in <Home Assistant Config>/custom_icons/. You will need to create this directory yourself.

You can then use those icons with the fapro: prefix. E.g. fapro:lamp will get the icon in the file <Home Assistant Config>/custom_icons/lamp.svg.

Duotone icons

If you have duotone icons, they should contain path elements with the ids fa-primary and fa-secondary or primary and secondary.

You can adjust how the icons look a bit by using the suffixes #invert, #color or #color-invert image

More advanced icons

You can also use more advanced icons, e.g. with multiple colors if you add the suffix #fullcolor. ISmIwO2TJN

You can find some nice ones over at flaticons.com.

Note: SVG files can also contain embedded CSS inside <style> tags...
This gives you some interesting... posibilities...

Hass-fontawesome will not allow any icons containing embedded javascript, though.


IMPORTANT: As the note above implies, SVG can contain CSS and Javascript, and thus shall be considered unsafe. Home Assistant normally protects you from this by unly using a very specific part of the SVG file, but using the #fullcolor suffix circumvents this protection. I have tried adding another layer instead, but as those things go, you're only safe from the things you know.

In short: Only do this with icons you trust (and preferably have inspected the code for).


FAQ

Can I set this up in configure.yaml instead?

Yes.

fontawesome:

That's it.


Buy Me A Coffee