Replies: 1 comment 2 replies
-
Hey @omaishar! Yeah unfortunately slashes inside class names are not supported by the class directive in Svelte right now. You can make it work around this limitation by adding classes like this, though: <div class="{ isDisabled ? 'bg-gray-500/50' : '' }"></div> I don't think there's going to be anything we can do to fix this from our end but there seems to be appetite like there's interest in allowing more characters in css class names if you take a look at this issue: sveltejs/svelte#7170 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One the new changes in Tailwind v4 is the deprecation of
bg-opacity-*
. Tailwind v4 uses the syntaxbg-black/50
instead.However, it does not seem to work with Svelte's class directives.
Example:
Tailwind v3 - works!
<div class:bg-gray-500={isDisabled} class:bg-opacity-50={isDisabled} ...>
Tailwind v4 - does not work!
<div class:bg-gray-500/50={isDisabled} ...>
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions