- That is because you can use tailwind inside blade files. It just tells tailwind to scan all files listed there, for tailwind classes
- How are you adding classes? Can you show the code for that span? Also, what version of tailwind are you using?
Tailwind suddenly not working well
I have two problems / queries.
1. I can see that my tailwind.config.js has the below:
const defaultTheme = require('tailwindcss/defaultTheme');
module.exports = {
content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./vendor/laravel/jetstream/**/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./resources/js/**/*.vue',
],
theme: {
extend: {
fontFamily: {
sans: ['Nunito', ...defaultTheme.fontFamily.sans],
},
},
},
plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')],
};
Why is tailwind including blade PHP files?
2. CSS not resolved properly.
Below is the screenshot of a project I am working on when "status" is Inactive: _You can see the highlighted code indicates gray colour, and it is working as expected

Below is the screenshot of a project I am working on when "status" is Active: _You can see the highlighted code indicates green colour, and it is NOT working as expected

This was working until some time back, but then when I edited something entirely different on an entirely new file, npm recompiled (it was on watch mode) and then it is gone. I reverted my changes to that file and still this hasn't resolved.
@mathewparet OK. The problem is that you are creating the class name dynamically. This wont work in tailwind 3, as it purges (removes) any classes that it cannot find in use.
'bg-'+this.theme+'-100
This sort of thing wont work.. You need to either
- Pass in the full class
- Use a safelist (I suggest regex)
https://tailwindcss.com/docs/content-configuration#safelisting-classes
Please or to participate in this conversation.