arctic_admin icon indicating copy to clipboard operation
arctic_admin copied to clipboard

Icons not showing

Open ameerh opened this issue 6 years ago • 26 comments

@cle61 I have integrated arctic admin with Rails5 API application. Its integrated fine and everything works well except the icons, they are not displaying. Please see attached screenshot.

I did import font-awesome. Here is my active_admin.css.scss file looks like:

@import "font-awesome"; @import "arctic_admin/base";

screenshot 2018-07-10 14 50 43

ameerh avatar Jul 10 '18 09:07 ameerh

You can remove the line : @import "font-awesome"; it's useless. which version of arctic_admin and font-awesome-rails do you use ?

cprodhomme avatar Jul 10 '18 12:07 cprodhomme

@cle61 Below are the gems in Gemfil:

gem 'arctic_admin' gem "font-awesome-rails" gem 'font-awesome-sass'

I have tried after removing @import "font-awesome"; but its still same. Please advise.

ameerh avatar Jul 10 '18 13:07 ameerh

give me the exact version in the Gemfile.lock, please.

cprodhomme avatar Jul 10 '18 13:07 cprodhomme

Its arctic_admin (1.5.0)

ameerh avatar Jul 10 '18 13:07 ameerh

and "font-awesome-rails" & 'font-awesome-sass' ? I think you use font-awesome 5 and arctic_admin use font-awesome 4

cprodhomme avatar Jul 10 '18 13:07 cprodhomme

font-awesome-sass (5.0.13)
font-awesome-rails (4.7.0.4)

ameerh avatar Jul 11 '18 05:07 ameerh

arctic_admin use font-awesome 4 and you use font-awesome 5. I need to update arctic_admin but i don't have the time now. If you don't use the gem font-awesome-sass, remove it

cprodhomme avatar Jul 11 '18 09:07 cprodhomme

@cle61 Yes I am not using it. I have removed it from gemfile. Its giving this error now:

Here is my active_admin.css.scss file looks like:

@import "font-awesome"; @import "arctic_admin/base";

screenshot 2018-07-11 17 33 54

ameerh avatar Jul 11 '18 12:07 ameerh

@ameerh I think you also dont need @import "font-awesome"; can you try again after removing the line? thanks

wasifhossain avatar Jul 11 '18 18:07 wasifhossain

@wasifhossain It shows the same error message even after removing @import "font-awesome";

ameerh avatar Jul 12 '18 09:07 ameerh

@ameerh so you are sure that you removed all font-awesome import/require variations as well as related gems still getting the error: File to import not found or unreadable: font-awesome ?

Logically if you remove all the references of a particular resource from js/css manifest files, it should not end up with errors like: <resource> not found. No?

wasifhossain avatar Jul 12 '18 09:07 wasifhossain

This trick works

Gemfile gem 'arctic_admin' gem 'font-awesome-sass' active_admin.css.scss

@import 'font-awesome.css'; @import "arctic_admin/base";

ameerh avatar Jul 12 '18 09:07 ameerh

hello, I'm also struggling with this issue on production (not on development though) and I tried the suggested fixes and also have font-awesome-rails 4 installed. Is there a different solution for this?

Divepit avatar Sep 18 '18 19:09 Divepit

Same issue here, already tried the suggested above

jcarlos7121 avatar Mar 07 '19 21:03 jcarlos7121

I have created a new version 2.0.0 with the gem font-awesome-sass, do you have test ?

cprodhomme avatar Mar 08 '19 09:03 cprodhomme

@cprodhomme the same problem / Arctic Admin 2.0.0 and no icons (font-awesome)

EvanBrightside avatar Mar 16 '19 17:03 EvanBrightside

Fix in the version 2.0.1 ! thanks for the repport ! :)

cprodhomme avatar Mar 28 '19 11:03 cprodhomme

icons still not showing, is there someone that knows a fix in 2020 ?

mykeeouellet avatar Mar 14 '20 00:03 mykeeouellet

@mykeeouellet can you give me some context ? What is your gemfile ? Sass version

cprodhomme avatar Mar 15 '20 17:03 cprodhomme

Someone with the can test with the branch fix/#57

https://github.com/cprodhomme/arctic_admin/tree/fix/%2357

cprodhomme avatar May 02 '20 20:05 cprodhomme

@cprodhomme im just tried branch fix/#57 / not working for me, no icons its rails 6 / activeadmin 2.7.0 / arctic_admin 3.2.0

EvanBrightside avatar May 02 '20 20:05 EvanBrightside

@cprodhomme for adding FA icons to arctic admin (with rails 6 / webpacker / activeadmin 2.7.0 / arctic_admin 3.2.0) we just need:

  1. yarn add @fortawesome/fontawesome-free
  2. Add import "@fortawesome/fontawesome-free/js/all.js"; and import "@fortawesome/fontawesome-free/css/all.css"; to /app/javascript/packs/active_admin.js

EvanBrightside avatar May 02 '20 21:05 EvanBrightside

Any guide for rails 6 without yarn webpacker? I am using sprockets.

mehmetaydogduu avatar Jul 19 '20 16:07 mehmetaydogduu

@EvanBrightside Wouldn't work with .scss files, not sure if I did something wrong there. I had to do the following to make the webfonts work

In app/javascript/stylesheets/active_admin.scss

$fa-font-path: '~@fortawesome/fontawesome-free/webfonts';
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/solid';
@import '~@fortawesome/fontawesome-free/scss/brands';
@import '~@fortawesome/fontawesome-free/scss/regular';

hgeorgilas avatar Sep 20 '20 17:09 hgeorgilas

I am using rails 6. This is what you need to do in order to fix missing icons:

  • yarn add @fortawesome/fontawesome-free
  • import "@fortawesome/fontawesome-free/css/all.css"; to /app/javascript/packs/active_admin.js

As @EvanBrightside pointed out thank you for that. But you don't need to add the full js library: import "@fortawesome/fontawesome-free/js/all.js"; it adds a 1.1 mb additional size you wanna import that via webpacked for only things you need. This import will import the full JS and not recommended for production.

CR1AT0RS avatar Sep 27 '20 09:09 CR1AT0RS

Doesn't work with sprockets

revskill10 avatar Dec 14 '22 10:12 revskill10