How can I change oklab in color-mix to use my own CSS variable? #16319
Answered
by
wongjn
anmoldovanov
asked this question in
Help
-
Hi, is there a way to replace oklab with var(--my-variable)? |
Beta Was this translation helpful? Give feedback.
Answered by
wongjn
Feb 7, 2025
Replies: 1 comment 5 replies
-
@theme inline {
--color-foo: var(--my-variable);
} <div class="bg-foo"> Produces: .bg-foo {
background-color: var(--my-variable);
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not that I can see:
The class name value is resolved here:
tailwindcss/packages/tailwindcss/src/utilities.ts
Line 4061 in 81de67c
In the function, it resolves the color value via
asColor()
:tailwindcss/packages/tailwindcss/src/utilities.ts
Line 212 in 81de67c
In
asColor()
, it resolves viawithAlpha()
:tailwindcss/packages/tailwindcss/src/utilities.ts
Lines 154 to 166 in 81de67c