You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear Tailwind friends.
I am currently working on a project using tailwind v3 where the style is pre defined in the backend. The backend will return the style in the following formats:
the style_type is set based on user preference, it is either color or image. When the value is color, the background_color will take place, and if the value is image, the background_color will take place..
My current solution is to generate bunch of css variables for these pre-defined styles using a utility functions that generate something like:
--mobile-bg-color:rgba(19,219,219,1)
--mobile-bg-image:url(https://domain.com/someimage.png)
and so on
as you can see, this works fine. But the down side is, there is over 200+ predefined styles that i have to turn into css variables.
I need a more tailwind way where i can consume the predefined style directly into tailwind utility class...
is this possible in tailwind v3? or is there any plugins that can help me out with this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Dear Tailwind friends.
I am currently working on a project using tailwind v3 where the style is pre defined in the backend. The backend will return the style in the following formats:
the
style_type
is set based on user preference, it is eithercolor
orimage
. When the value is color, thebackground_color
will take place, and if the value isimage
, thebackground_color
will take place..My current solution is to generate bunch of css variables for these pre-defined styles using a utility functions that generate something like:
and then create a custom class like:
as you can see, this works fine. But the down side is, there is over 200+ predefined styles that i have to turn into css variables.
I need a more tailwind way where i can consume the predefined style directly into tailwind utility class...
is this possible in tailwind v3? or is there any plugins that can help me out with this?
Beta Was this translation helpful? Give feedback.
All reactions