GithubHelp home page GithubHelp logo

codepriince / hass-fontawesome Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thomasloven/hass-fontawesome

0.0 0.0 0.0 1.63 MB

๐Ÿ”น Use icons from fontawesome in home-assistant

License: Other

Shell 4.90% JavaScript 66.24% Python 28.85%

hass-fontawesome's Introduction

hass-fontawesome

hacs_badge

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

Installation instructions

  • Install using HACS (Or copy the contents of custom_components/fontawesome/ to <your config dir>/custom_components/fontawesome/.)

  • Restart Home Assistant

  • Click this: Open your Home Assistant instance and start setting up a new integration.

    • Alternatively: Go to your integrations configuration, click Add Integration and find "Fontawesome icons"

Icon sets

The icons are divided into three sets.

  • Solid
  • Regular
  • Brands

Usage

Find the icon you want in the gallery.

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

So,

  • to get a solid heart, use fas:heart
  • to get a heart outline, use far:heart
  • to get the github logo, use fab:github

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 advanded 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

hass-fontawesome's People

Contributors

michaelarnauts avatar thomasloven avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.