You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
I have an icon that I use in multiple colors, and I toggle colors on hover. Due to the :hover requirement, I use customSelectors to select the correct image like so (names changed and selector object shortened considerably for clarity):
Instead of using the filename color naming convention to generate my normal and hover color versions of the icon, I need to use two identical .svg files with colors changed. This isn't ideal (and becomes problematic when you have multiple variants of an icon with their own hover states).
Solution?
In a perfect world, I could do something like this:
This is still pretty gnarly from a configuration perspective, but it would be a lot cleaner than having a messy config object and a bunch of .svg images in different colors floating around.
Halp!
If anyone has good ideas for alternate ways to deal with this, let me know. On some projects I've made sprites for each of my icons with the different states, and used background-position to toggle them. That leaves you with cleaner config and fewer files, but isn't perfect.
The text was updated successfully, but these errors were encountered:
This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.
Problem
I have an icon that I use in multiple colors, and I toggle colors on hover. Due to the
:hover
requirement, I usecustomSelectors
to select the correct image like so (names changed and selector object shortened considerably for clarity):Instead of using the filename color naming convention to generate my normal and hover color versions of the icon, I need to use two identical
.svg
files with colors changed. This isn't ideal (and becomes problematic when you have multiple variants of an icon with their own hover states).Solution?
In a perfect world, I could do something like this:
This is still pretty gnarly from a configuration perspective, but it would be a lot cleaner than having a messy config object and a bunch of
.svg
images in different colors floating around.Halp!
If anyone has good ideas for alternate ways to deal with this, let me know. On some projects I've made sprites for each of my icons with the different states, and used
background-position
to toggle them. That leaves you with cleaner config and fewer files, but isn't perfect.The text was updated successfully, but these errors were encountered: