Tailwind Classes Not Applying After Upgrading to v4.x

I've been using the following code:
ImageEntry::make('avatar')
->disk('s3')
->extraImgAttributes([
'class' => 'rounded-md w-full',
'loading' => 'lazy',
])
->columnSpanFull(),
ImageEntry::make('avatar')
->disk('s3')
->extraImgAttributes([
'class' => 'rounded-md w-full',
'loading' => 'lazy',
])
->columnSpanFull(),
This worked fine on v3.x, and the Tailwind classes were properly applied. After upgrading to v4.x, those classes no longer seem to take effect. No changes were made to this specific part of the code during the upgrade.
Solution:
If you don't have a custom theme, you need to start with that. Or if those 2 are the only classes, just apply CSS style="border-radius: 1rem; width: 100%;"...
Jump to solution
4 Replies
Dennis Koch
Dennis Koch3mo ago
You probably don’t have a custom theme or need to recompile it.
Boa Hancock
Boa HancockOP3mo ago
I haven’t configured a custom theme; I just added rounded-md w-full to the element. How can I recompile it?
Solution
Dennis Koch
Dennis Koch3mo ago
If you don't have a custom theme, you need to start with that. Or if those 2 are the only classes, just apply CSS style="border-radius: 1rem; width: 100%;"
Boa Hancock
Boa HancockOP3mo ago
That sounds perfect, thank you

Did you find this page helpful?