admin管理员组文章数量:1244222
I am having a difficult time getting FontAwesome Pro to work with propshaft, importmap and other Rails 8 changes.
I'm using tailwindcss 3 with an assets directory that looks like:
app
assets
builds
tailwind.css
stylesheets
application.css
application.tailwind.css
My application head looks like:
!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title ActivityTracker
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
= csrf_meta_tags
= csp_meta_tag
= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload"
= stylesheet_link_tag :app, "data-turbo-track": "reload"
= javascript_importmap_tags
My first attempt to use the font-awesome-pro-sass
gem provided by Font Awesome, seemed to have a conflict between the expectation of application.scss
and application.css
and I could not find the correct edits to make it work.
My current attempt adds the fontawesome directory directly to my app javascripts directory (e.g. app/javascript/fontawesome-pro-6.7.2-web
) and pins it in the importmap config (e.g. pin "@fortawesome/fontawesome-pro", to: "fontawesome-pro-6.7.2-web/js/all.js"
)
It works in my local machine but is insanely slow and doesn't appear to work at all when I deploy it to a server (using kamal 2).
I am having a difficult time getting FontAwesome Pro to work with propshaft, importmap and other Rails 8 changes.
I'm using tailwindcss 3 with an assets directory that looks like:
app
assets
builds
tailwind.css
stylesheets
application.css
application.tailwind.css
My application head looks like:
!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title ActivityTracker
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
= csrf_meta_tags
= csp_meta_tag
= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload"
= stylesheet_link_tag :app, "data-turbo-track": "reload"
= javascript_importmap_tags
My first attempt to use the font-awesome-pro-sass
gem provided by Font Awesome, seemed to have a conflict between the expectation of application.scss
and application.css
and I could not find the correct edits to make it work.
My current attempt adds the fontawesome directory directly to my app javascripts directory (e.g. app/javascript/fontawesome-pro-6.7.2-web
) and pins it in the importmap config (e.g. pin "@fortawesome/fontawesome-pro", to: "fontawesome-pro-6.7.2-web/js/all.js"
)
It works in my local machine but is insanely slow and doesn't appear to work at all when I deploy it to a server (using kamal 2).
Share Improve this question asked Feb 17 at 22:00 GSPGSP 3,7893 gold badges33 silver badges58 bronze badges 3 |1 Answer
Reset to default 0I am having the same problem, for now I fixed the issue by adding a fixed library. I found this solution in a prior thread, but I'm not sure if it will works with the pro version.
Here: https://stackoverflow/a/78348023/20932911
<link rel="stylesheet" href="https://site-assets.fontawesome/releases/v6.5.2/css/all.css" />
本文标签: font awesomeFontAwesome Pro in Rails 8 with importmap and propshaftStack Overflow
版权声明:本文标题:font awesome - FontAwesome Pro in Rails 8 with importmap and propshaft - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740123757a2228473.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
app/assets/stylesheets/application.css.scss
does not exist then renameapp/assets/stylesheets/application.css
" – engineersmnky Commented 2 days ago