-
Hi all,
The upgrade conversion tool turned it into this:
I was loading branding colors in dynamically (user’s color prefs are saved on the backend) so I had some JS code that took these branding colors and set CSS variables Eg:
in Tailwind 3.0, as soon as the CSS variables got set, the colors specified in my tailwind.config.js updated automatically, eg. "dark-2": "oklch(from var(--background) calc(l - 0.02) c h)", recalculated using the —background set on the body. I only had to load the base CSS variable style, eg. —background, —foreground, —accent and —logo onto document.body. With tailwind 4.0, the colors do not recalculate inside @theme. So --color-background-light-8: oklch(from var(--background) calc(l + 0.08) c h); does not contain the newly loaded CSS variable. The only solution I can think of is to load every single color value inside @theme onto document.body. I was curious if there’s a more optimal approach. Any ideas? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could try one of:
|
Beta Was this translation helpful? Give feedback.
You could try one of:
document.documentElement
@theme inline
instead of@theme
.