tomkr4l / font_awesome5_rails

font_awesome_5_rails is font awesome 5 gem bundled for rails asset pipeline
https://fontawesome.com/
MIT License
158 stars 25 forks source link

aria-hidden by default? #16

Closed xinspire closed 6 years ago

xinspire commented 6 years ago

Can we have the fa_icon helper method include the aria-hidden attribute by default?

In reading the official FA docs on accessibility, I don't see a use case where aria-hidden wouldn't be present.

Thanks for considering!

tomkr4l commented 6 years ago

@xinspire You have right. Definitely should be default attribute, I will include fix in next version.

tomkr4l commented 6 years ago

@xinspire Hello, I've digged more into this. So when you use FA5 as SVG with JS aria-hidden tag is included by default (FA5 script autoinclude this). But when you use webfont version there was no option for including these tags. Now is possible to add this tags to fa_icon helper, but I didn't make them default in webfont vesion for two reasons:

Firstly in old gem from font-awesome-rails, they are not default too. Secondly In FA5 documentation, they are not default in i tags.

However if you upgrade to version 0.3.3, you will be able to use these tags optionally. Hope It's understandable.

For exapmle: = fa_icon :camera, 'aria-hidden': true