Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FA5: Icon hover class #11950

Open
TheColorRed opened this issue Dec 16, 2017 · 7 comments
Open

FA5: Icon hover class #11950

TheColorRed opened this issue Dec 16, 2017 · 7 comments

Comments

@TheColorRed
Copy link

I am not sure if this is built in or not, but I can't seem to find a way to do this.

It would be nice if each icon had a hover class that would take effect when hovered upon.

Maybe something like this:

<i class="fal fa-times-circle fas-times-circle-hover"></i>
@Joyrex
Copy link

Joyrex commented Dec 19, 2017

You could write a CSS class for :hover that would change the SVG's color - you can see this in effect on the icon detail page (although they are wrapping a <span> around the FA icon):

.hover-orange:focus, .hover-orange:hover {
	color: #fd7e14;
}

@TheColorRed
Copy link
Author

That works for color, but what about completely changing the icon to something else on hover?

@wolfy1339
Copy link

You would need to add CSS that refers to the icon you want's unicode codepoint

@tagliala
Copy link
Member

Are you using the webfont or the javascript framework?

@TheColorRed
Copy link
Author

I am using the JavaScript framework

@PeterShaggyNoble
Copy link

See https://fontawesome.com/how-to-use/svg-with-js#pseudo-elements for the solution to this.

@kiquenet
Copy link

Solution full sample code for changing the icon to something else on hover?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants