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

Fix File to import not found or unreadable: font-awesome-sprockets #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
=require twitter-bootstrap-static/bootstrap
*/

@import "font-awesome-sprockets";
Copy link

@toomanyjoes toomanyjoes Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this doesn't break for everyone else wouldn't you want to do something like this?

$rails_version: '#{asset-path("config/application.rb")}';
@if ($rails_version < 6) {
  // Import sprockets only if the Rails version is less than 6
  @import "font-awesome-sprockets";
}
# config/application.rb or an initializer

# Set a custom environment variable to indicate the Rails version
Rails.application.config.rails_version = Rails.gem_version

I'm not entirely sure this works as written as it was generated by chatGPT but some author who knows scss syntax better than me could clean it up.

@import "font-awesome";

html {
Expand Down