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

Add Bootstrap icons as (optional) task #63

Closed
viktorianer opened this issue Jan 6, 2022 · 2 comments · Fixed by #76
Closed

Add Bootstrap icons as (optional) task #63

viktorianer opened this issue Jan 6, 2022 · 2 comments · Fixed by #76

Comments

@viktorianer
Copy link
Contributor

viktorianer commented Jan 6, 2022

It took me 2 days to figure out, how to use this gem with bootstrap icons. Frustrating thing!

I would suggest adding a task to this gem, which helps start with Bootstrap 5 and Bootstrap Icons as quickly as possible.

Steps you need to add bootstrap-icons to a new app, created with rails new sample_app --javascript esbuild --css bootstrap.

# Add Bootstrap icons
say "Add Bootstrap icons"
run yarn add bootstrap-icons

append_file "app/assets/stylesheets/application.bootstrap.scss" do
  <<~SCSS 
  @import 'bootstrap-icons/font/bootstrap-icons';
  SCSS
end

inject_into_file "config/initializers/assets.rb", after: /.*Rails.application.config.assets.paths.*\n/ do
  Rails.application.config.assets.paths << Rails.root.join("node_modules/bootstrap-icons/font")
end

I think I can add the steps on this task, but if we need more, I need some help.
Maybe it's better to add another installer?!

What do you think?
What about documentation?

Many thanks to Junichi Ito on StackOverflow
https://stackoverflow.com/questions/70526113/how-to-use-bootstrap-icons-with-rails-7-0

@jnunemaker
Copy link

Thanks for sharing! Found this in a few minutes and saved me the 2 days. :)

@dhh
Copy link
Member

dhh commented Jan 9, 2022

Happy to see this added. Please do a PR.

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

Successfully merging a pull request may close this issue.

3 participants