Skip to main content

How do I install UIKit via yarn?

CSS • Asked by Tabish Iqbal

Answer:

  1. Add uikit through yarn: yarn add uikit
  2. Create a file to be transpiled by webpacker: app/javascript/uikit.sass (or app.sass... whichever name suits you best.)
  3. Within uikit.sass import your newly added UIKit library: @import '~uikit/dist/css/uikit'
  4. In the head of your app/views/layouts/application.html.erb add <%= stylesheet_pack_tag 'uikit' %>.
  5. 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.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.