From 5f679f6a20423d06c7c63ee907515be25e5e971d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Fri, 14 May 2021 22:07:42 +0000 Subject: [PATCH] Add fullcolor icons --- README.md | 40 ++++++++++----------- custom_components/fontawesome/main.js | 33 ++++++++++++++++- custom_components/fontawesome/manifest.json | 2 +- js/main.js | 31 +++++++++++++--- 4 files changed, 79 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 4a355e5..1b335c7 100644 --- a/README.md +++ b/README.md @@ -38,23 +38,32 @@ So, The icons are useable anywhere in Home Assistant - not only in lovelace. -# FAQ +## Using with custom icons -### Can I use this with my Pro icon set? +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 `/custom_icons/`. You will need to create this directory yourself. -Yes. -You need the `.svg` files from the Pro icon set. +You can then use those icons with the `fapro:` prefix. E.g. `fapro:lamp` will get the icon in the file `/custom_icons/lamp.svg`. -Place the icon files in `/custom_icons/`. -You will need to create this directory yourself, and the filenames must end with `.svg` +### Duotone icons -Then access your icons with the `fapro:` prefix, e.g. `fapro:lightbulb-on`. +If you have duotone icons, they should contain path elements with the `id`s `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 `#volor-invert` +![image](https://user-images.githubusercontent.com/1299821/118324014-bf0fa380-b501-11eb-890b-126951d67cef.png) -### Can I add non-fontawesome icons using this? +### More advanded icons -Yes, provided you have svg files of the icons which consist one or more `` elements and no transforms or other weird stuff. +You can also use more advanced icons, e.g. with multiple colors if you add the suffix `#fullcolor`. +![ISmIwO2TJN](https://user-images.githubusercontent.com/1299821/118335863-d4d89500-b510-11eb-8d01-2ccf5bbbbba5.gif) -Just do the same as for the Pro icon set above. Put svg files in the same directory, and use the same prefix. +You can find some nice ones over at [flaticons.com](https://www.flaticon.com/). + +> Note: SVG files can also contain embedded CSS inside `