Skip to content

Add Tailwind to a Solidus store #4731

Discussion options

You must be logged in to vote

Hello!

I have a Solidus store running with Tailwind. Here's the step I followed to make it work:

rails new amazing_store # avoid the --skip-javascript flag here
cd amazing_store
bundle add 'solidus'
bin/rails generate solidus:install # devise: Y, payment: none, frontend: starter
bundle add tailwindcss-rails
rails tailwindcss:install

In layout/storefront.html.erb:

-    <%= stylesheet_link_tag 'solidus_starter_frontend', media: 'screen' %>
+    <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>

Now start rails with:

bin/dev

At this point you should be able to add tailwind classes to your HTML; all changes to related files will trigger a recompile, and a page …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gabrielguerin
Comment options

Answer selected by gabrielguerin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants