Thanks to visit codestin.com
Credit goes to github.com

Skip to content

use built css color-mix in tailwind config #5

@prestonbourne

Description

@prestonbourne

currently, some of my css classes don't allow for opacity modifier syntax when they're referenced via tailwind

I can do some rewriting to follow for this and make life easier down the line. Here's an example

--background-color: theme("colors.gray.50"); 
--color-primary: theme("colors.purple.600");
--color-secondary: theme("colors.purple.300");
'background': 'color-mix(in srgb, var(--background-color) calc(100% * <alpha-value>), transparent)',
'primary': 'color-mix(in srgb, var(--color-primary) calc(100% * <alpha-value>), transparent)',
'secondary': 'color-mix(in srgb, var(--color-secondary) calc(100% * <alpha-value>), transparent)',

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions