Here are steps for integrating Keenicons in a Ruby on Rails application and resolving the fonts issue in a production environment like Heroku:
app/assets/fonts
directory.config/application.rb
file:
config.assets.paths << Rails.root.join("app", "assets", "fonts")
style.css
files for each Keenicon variant (e.g., fonts_duotone_style.css
, fonts_outline_style.css
, "fonts_solid_style.css
) to the app/assets/stylesheets
directory.style.css
files to style.scss
.style.scss
files, update any references to font URLs using the font-url
helper provided by Rails. For example, change:
url('fonts/keen-icons.ttf') format('truetype');
font-url('keen-icons.ttf') format('truetype');
style.scss
" files. You can do this by adding the following line to your main stylesheet file (e.g., "application.scss
"):
@import 'style';
RAILS_ENV=production bundle exec rake assets:precompile
By following these steps, you should be able to integrate Keenicons into your Ruby on Rails application and resolve any font-related issues.