Is it possible to import external library theme variables and use them with utility classes #17407
Unanswered
NiestrojMateusz
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey 👋🏻
I try to import external library theme like this
@import "tailwindcss";
@import "@mylib/mylibname/dist/css/tokens.css" layer(theme);
Token css include different theme variables like
--color-avocado-500: #ffffff;
etc
What I would expect is that Tailwind will be able to create utility classes based on those variables to use like
bg-avocado-500
similarly like it does for variables typed within @theme block manually. But it doesn't work like this. I see the variables are available and I can use it arbitrary waybg-(--color-avocado-500)
, but wondering could I do something to use it in shorter form.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions