rails, tailwind, engine, css
spec.add_dependency "tailwindcss-rails", "~> 2.0", ">= 2.0.33"
bundle install
const defaultTheme = require('tailwindcss/defaultTheme') module.exports = { safelist: [ { pattern: /prose/, }, ], content: [ './app/assets/stylesheets/**/*.css', './app/views/**/*.html.erb' ], theme: { extend: { fontFamily: { sans: ['Inter var', ...defaultTheme.fontFamily.sans], }, }, }, plugins: [ require('@tailwindcss/forms'), require('@tailwindcss/aspect-ratio'), require('@tailwindcss/typography'), require('@tailwindcss/container-queries'), ] }
@tailwind base; @tailwind components; @tailwind utilities;
<%= stylesheet_link_tag "hello_world/tailwind", "data-turbo-track": "reload" %>
//= link_tree ../builds/hello_world .css
touch bin/tailwindcss-builder && chmod u+x bin/tailwindcss-builder
#!/usr/bin/env bash $(bundle show tailwindcss-rails)/exe/tailwindcss \ -i app/assets/stylesheets/application.tailwind.css \ -o app/assets/builds/hello_world/tailwind.css \ -c tailwind.config.js \ --minify \ -w
<div class="bg-white px-6 py-24 sm:py-32 lg:px-8"> <div class="mx-auto max-w-2xl text-center"> <h2 class="text-4xl font-bold tracking-tight text-gray-900 sm:text-6xl"><div data-controller="test"></div></h2> <p class="mt-6 text-lg leading-8 text-gray-600">Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.</p> </div> </div>
bin/tailwindcss-builder
bin/rails s