Last active
April 9, 2021 14:51
-
-
Save ajazfarhad/53eb05cfd435840d09a6ab5037d7e955 to your computer and use it in GitHub Desktop.
Add Milligram css to your Rails app using Webpacker with this app template.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails app:template LOCATION=https://gist.githubusercontent.com/ajazfarhad/53eb05cfd435840d09a6ab5037d7e955/raw/f8c4e850665e800d357da5f0c2555bd84a7ee679/milligram_css.rb | |
def yarn(package) | |
run("yarn add #{package}") | |
end | |
yarn 'milligram' | |
inject_into_file 'app/views/layouts/application.html.erb', before: '</head>' do <<~EOF | |
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> | |
EOF | |
end | |
inject_into_file 'app/javascript/packs/application.js' do <<~EOF | |
import 'milligram/dist/milligram.css' | |
EOF | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment