A little snippet to add some vibrancy to the Tailwind gradient helpers using oklch colors. This avoids the muddy grey you often get in some gradients. 1st is before, 2nd is using oklch. Miles nicer. You can read more about it in @joshwcomeau.com's article here: www.joshwcomeau.com/css/make-bea...
Post
First import the default theme to amend the gradients. ``` import defaultTheme from 'tailwindcss/defaultTheme'; const vibrantGradients = Object.fromEntries( Object.entries(defaultTheme.backgroundImage).map(([k, g]) => [k, g.replace('gradient(', 'gradient(in oklch ')]), ); ```
0 reposts0 likes