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.
Reply
Join the discussion
Create an account Log in

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.