How do I install UIKit via yarn?
Answer:
- Add uikit through yarn: yarn add uikit
- Create a file to be transpiled by webpacker: app/javascript/uikit.sass (or app.sass... whichever name suits you best.)
- Within uikit.sass import your newly added UIKit library: @import '~uikit/dist/css/uikit'
- In the head of your app/views/layouts/application.html.erb add <%= stylesheet_pack_tag 'uikit' %>.
- Run rails s in one terminal window tab and ./bin/webpack-dev-server in the other so webpacker can compile your assets and serve them in your app.