JackJones's avatar

Can't use tailwind classes

Hi All,

I'm following this guide and have followed the instructions exactly:

https://tailwindcss.com/docs/guides/laravel#vite

I have the following in app.scss:

@tailwind base;
@tailwind components;
@tailwind utilities;

body {
    background-color: aquamarine;

    h1 {
        color: blueviolet;
        font-size: larger;
    }
}

but only the css for main elements is available (body, div etc) and font-bold.

What am I missing?

0 likes
6 replies
JackJones's avatar

It was because I hadn't used the class, but I was trying to set it dynamically so it wasn't used yet

Is there any way to bring in all classes?

Snapey's avatar

When you run vite, is the output file created?

JackJones's avatar

It’s created as a scss file when I view it in the browser but it’s all working

JackJones's avatar

@Snapey I'm using the @vite blade directive and it produces:

<script type="module" src="http://[::1]:5174/@vite/client"></script><link rel="stylesheet" href="http://[::1]:5174/resources/sass/app.scss" />   

For some reason it is still working even though it's an scss file

Please or to participate in this conversation.