I’m trying to apply radial gradient in Tailwind but facing some issues. This’s what I’ve tried tailwind.config
backgroundColor: {
'radial-gradient': 'radial-gradient(169.40% 89.55% at 94.76% 6.29%, rgba(0, 0, 0, 0.40) 0%, rgba(255, 255, 255, 0.00) 100%)',
},
and use it like
className='bg-radial-gradient'
This doesn’t seem to work. How can I do this in Tailwind?
2
Answers
As per the MDN documentation on
radial-gradient()
:<image>
s are used in thebackground-image
property, so you’d add the value as abackgroundImage
value in Tailwind:you can apply radial gradient in Tailwind like the below examples.
e.g:
notice