All threads / How do I install UIKit via yarn?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I install UIKit via yarn?

Tabish Iqbal asked in CSS

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.
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,665+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.