Nice to meet you, I m Japanese.
I want to apply TailwindCSS in Rails7 View Component, but it doesn t work.
I also changed the settings in tailswind/config.js but it doesn t work.
The views file has been applied (the top string in the image)
Please tell me if you don t mind.
const defaultTheme = require( tailwindcss/defaultTheme )
module.exports = {
content: [
./public/*.html ,
./app/helpers/**/*.rb ,
./app/javascript/**/*.js ,
./app/views/**/*.{erb,haml,html,slim} ,
./app/components/**/*
],
theme: {
extend: {
fontFamily: {
sans: [ メイリオ , ヒラギノ角ゴ Pro W3 , Hiragino Kaku Gothic Pro , Noto Sans JP , ...defaultTheme.fontFamily.sans],
cabin: [ Cabin Sketch , ...defaultTheme.fontFamily.sans],
},
width: {
50 : 12.5rem ,
88.5 : 22.125rem ,
100 : 25rem ,
160 : 40rem ,
},
aspectRatio: {
4/3 : 4 / 3 ,
1.91/1 : 1.91 / 1 ,
3/1 : 3 / 1 ,
4/1 : 4 / 1 ,
video : 16 / 9 ,
},
maxWidth: {
100 : 25rem ,
}
},
},
variants: {
backgroundColor: [ responsive , odd , hover , focus ],
},
plugins: [
require( @tailwindcss/forms ),
require( @tailwindcss/aspect-ratio ),
require( @tailwindcss/typography ),
]
}
app/components/header/component.html.erb
<div class="text-red-500">Add Footer template here</div>
app/components/header/component.rb
# frozen_string_literal: true
class Footer::Component < ViewComponent::Base
end
I want to apply TailwindCSS in Rails7 View Component, but it doesn t work.
I also changed the settings in tailswind/config.js but it doesn t work.
The views file has been applied (the top string in the image)
Please tell me if you don t mind.