Gradients with Transparency on Safari #2399
-
I'm looking to add this gradient with Tailwind's new gradients.
where :root {
--transparent: transparent;
--red-100: rgb(255, 195, 184);
}
/* using CSS variables to define the Tailwind variables */ Now Safari has the habit of interpreting transparent as https://css-tricks.com/thing-know-gradients-transparent-black/ Is there a nice way to create transparent gradients using Tailwind? My only idea so far is to create a transparent version of every Tailwind color and use that transparent version. It should work, but it's not elegant. I'll do it if necessary, but if someone knows of a better way, I'd appreciate it! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey! Check out this demo repo, shows you how to do it: https://github.com/adamwathan/tailwind-css-variable-text-opacity-demo Basically you need to define your colors as a callback, and accept the |
Beta Was this translation helpful? Give feedback.
Hey! Check out this demo repo, shows you how to do it:
https://github.com/adamwathan/tailwind-css-variable-text-opacity-demo
Basically you need to define your colors as a callback, and accept the
opacityValue
argument and stick it in the right place.