How to change bg or text opacity independently of color in v4? #16674
-
Hi! Before v4, it was possible to change just the opacity of the background or text using Sometimes, we need to control the opacity of text or the background without knowing the color in advance, so |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
You could use CSS variables like |
Beta Was this translation helpful? Give feedback.
You could do for all the color utilities you'll use the
<prefix>-opacity-*
pattern for:Though do note this will cause duplicate
bg-<color>
classes in the output CSS (since we can't disable the built-inbg-<color>
utilites:https://play.tailwindcss.com/5vJ3ka5AVO