Skip to content

Add support for displaying icons in the Rails app #987

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

Merged
merged 6 commits into from
Jan 25, 2020
Merged

Conversation

connorshea
Copy link
Owner

This was pretty annoying to get working, and it requires running rake assets:precompile to get the icons to show up with webpacker.

You can use the svg_icon helper I've created like so:

<%= svg_icon('star', height: 20, fill: 'red') %>
<%= svg_icon('star-half', height: 20) %>

I haven't added any icons to the app yet because I don't see a great place to get started with it and just want to get this merged for now.

This uses icons from font-awesome.

Resolves #121.

This seems to almost be working, but it requires me to run
`rake assets:precompile` because it's looking in the `public/`
directory.
I can't figure out how to get the webpack-dev-server to load these
itself, it needs to be precompiled, but oh well at least these don't
change often so it shouldn't be much of a problem.
Add InlineSvg to the sorbet-rails helpers generation, to make sure that
the inline_svg_pack_tag is available in application_helper.rb.
@connorshea connorshea added enhancement New feature or request frontend Issues and pull requests related to the vglist frontend labels Jan 25, 2020
@connorshea connorshea merged commit d5efa4d into master Jan 25, 2020
@connorshea connorshea deleted the inline-svg branch January 25, 2020 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Issues and pull requests related to the vglist frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Choose an icon library
1 participant