I have a checkbox with an icon that changes on click/when checked. It works fine, but I wondered if its possible to add in some kind of fade animation on it? If so, what would would be the best way to do this?
You can’t animate the content property as you are just supplying new content so the change is immediate. You could fade one icon out and another in but it gets a little tricky.
Basically you use the :after element to place the rollover icon in the same place as the original icon and then on hover you fade one icon out and fade the other icon in.