Tailwind class not found in plugin
I have a page on my plugin, and I want to use the
rounded-r-lg
class. However, its not applied which makes me think that its not found by tailwind. Am I missing somethign?
I dont have any css files in my plugin22 Replies
I have already done this. I realize now maybe the class just isnt applied. I used this
And I cant get it to only round the right side...
It remains rounded on all 4 corners
Did you check the DevTools? Is the class on the HTML element? Is it overwritten by a different class?
rounded-r-lg
overwrites rounded-xl
, right?Default
rounded-xl
will probably "overwrite" itoh
Check the CSS definition in your DevTools
One says: "round all" and one says "round-right". So combined they are "round all" 😉
😭
I hate css
So, what can I do now?
How about "don't round left side"? If that's what you want?
yeah, thats what I want
But by default, the section has
w-full
, if I give it w-[17rem]
, it overwrites it, but why doesnt it work with rounded-xl
?Check the CSS.
width
is one property. border-radius
is a shorthand for 4 borders radi
I guess the issue is, that you think in Tailwind, not in CSS.
What if you want radius in top left and bottom right? If rounded-b-r-xl
would overwrite anything else, you couldn't combine them
To solve your issue: "don't round left side" translates to rounded-l-none
Hmm. I see
rounded-l-none
in my html, but on devtools its not a class.. and I did add this to my tailwind config
You created a custom theme?
in my dev app, or my plugin?
The dev app
then yes
oh wait,I add this to my tailwind config class of my theme
yes now it works
I COMPLETELY forgot the theme was there. I thought it was the default config
Apologies 😅
And danke for helping :)
Biddeschön 😅
And this also works for php classes as well. Nice
How does tailwind know to grab classes in
->extraAttributes([])
?it scans what ever files you tell it to scan in the tailwind config's content
noting that if you add it in extraAttributes it won't scope the php files there. So any classes not used i would tend to add a dummp classes.blade.php file in the route and add them to a <div class="my_class"></div> you can use tailwind whitelist too but that's temperamental.