Recent searches
No recent searches
Added an Icon to my Categories with Copenhague theme Now I want a Hover Color (just for that icon)
Answered
Posted Oct 11, 2021
Hi guys,
Maybe you can assist here,
I applied the method described by Anonymous here:
I chose the first method, uploading assets and using the IS helper.
It works fine now I see my beautiful Icons on top of my title.
But when I hover on the buttons, the text become White (from blue to white) but the icon just stay blue,
Is there a way for me to change the color of the Icon color (just the icon) in all my categories?
If so what's the easiest way to go?
Thanks in advance
/Edwin
0
10
10 comments
Ifra Saqlain
Hey, if your icon is image (png, jpg, jpeg) then the color couldn't change on hover, you can change the color of SVG icon and font icon on hover.
Yes, you can do one thing, you can upload the two images- one for normal and second for hover with another color which you want and then via CSS you can get your point.
1
Edwin Andermyr
My icons were initially SVG, but I converted them to PNG for the sake of it.
If I upload them again in .SVG format, what shall I do so that the color of the icon can switch to White on hover?
1
Ifra Saqlain
Edwin, do these simple steps:
1). Upload your SVG icons into assets folder.
2). Replace png icons with svg icons.
3). Now, add the below code but change the class, I have added button and you have any different class so.
Try this, if any issue, do let me know.
Thanks
1
Edwin Andermyr
Hi Ifra,
Thanks for the response.
But I don't understand the class thingy,
Am I suppose to create a class?
hmm I can definitely change the assets to svg and point it to the svg icons:
by editing the homepage_hbs page:
"
<!--Images for categories Home Page -->
{{#is id XXXXXXXXX}}<img class="" src="{{asset 'Manual-TEST.svg'}}" />{{/is}}
instead of the png one.
But for the piece of code you wrote, should I write it in the css page?
is there something like a div class code I should add to make it work?
I'm confused here sorry about it!
0
Edwin Andermyr
Actually I can't convert my files back to .svg
I needed to change the color that's why I exported the .svg into .png,
But I am not able to edit the color and export it as .svg
So well I'll need to find another alternative, where I can do that with a .png
0
Ifra Saqlain
Hi Edwin,
Share your public URL of your HC and make sure your working theme must be saved as Live, I can convert the PNG icons in SVG and provide you the exact code here.
You only need to upload those SVG icons in your assets folder and after that, you will be done.
Thanks
Ifra
1
Edwin Andermyr
Hi Ifra,
I highly appreciate the effort here:
The code is indeed live right now:
https://support.qbank.se/hc/en-us
Thanks in advance.
0
Ifra Saqlain
Hi Edwin, you can convert png icons to svg by online tool: https://www.pngtosvg.com/
You can se, I only converted the png icon to svg and uploaded it into the assets folder and remove the png icon from image SRC and then add the SVG icon into image SRC.
Then copy this given CSS code and paste it at the bottom of the syle.css file.
Screenshots for the same work:
For SVG icon: filter property.
Icon color would be change on mouse hover.
If any confusion, do let me know :)
Thanks
Ifra
1
Edwin Andermyr
Dear Ifra,
It works like a charm now:
https://support.qbank.se/hc/en-us
Thank you once again for the help here! Highly appreciate your effort!
Sincerely,
/Edwin
0
Ifra Saqlain
Happy to hear this :)
0