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

Icons not generated properly #38

Closed
Fabstilelook opened this issue Jun 6, 2019 · 4 comments
Closed

Icons not generated properly #38

Fabstilelook opened this issue Jun 6, 2019 · 4 comments

Comments

@Fabstilelook
Copy link

If I type for example:

= fa_icon('youtube', type: :fab)

The result I get is:

<i type="fab" class="fa fa-youtube"></i>

While, reading from the documentation, the result should be:

<i class="fab fa-youtube"></i>

I also have gem 'font-awesome-rails', '~> 4.4.0' installed. So I wonder if the issue is some conflict with that gem.

@tomkr4l
Copy link
Owner

tomkr4l commented Jun 7, 2019

@Fabstilelook Hello, definitelly issue comes from conflict with font-awesome-rails, because in this gem I'm using the same method helper name fa_icon. We have tests for the example you mentioned, so I'm sure It's working correctly. Problem is that fa_icon method called is executed from font-awesome-rails gem and from ours so you get icon generated for older version of font.

If you want to use both gems simultaneously, you can try this:
= fab_icon('youtube')
This method is not present in font-awesome-rails gem so It should call right method from this gem and you can ommit type specification. Check Readme for use far, fas, fab helper methods.

Hope this helps.

@Fabstilelook
Copy link
Author

@tomkra I'm also using the gem rails_admin and it seems it has a dependency with font-awesome-rails that's why I would like to keep them both. I've tried your suggestion:

= fab_icon('youtube')

but this still prints out:

<i type="fab" class="fa fa-youtube"></i>

instead of:

<i class="fab fa-youtube"></i>

@tomkr4l
Copy link
Owner

tomkr4l commented Jun 9, 2019

@Fabstilelook I've tried use both gems simultaneously and I had difficulties you've described. So I've added new fa5_icon and fa5_stacked_icon method aliases.

Please update to last version of gem to 0.7.0. After that you will be able to use font awesome 5 icons by calling these methods. Since they are not present in original font-awesome-rails gem, they will be called from right gem and proper method icon generator will be used.

Please try this solution and let me know, if it worked.

@Fabstilelook
Copy link
Author

@tomkra great thank you very much! it's working now with version 0.7.0 and using the method fa5_icon

@tomkr4l tomkr4l closed this as completed Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants