Runtime custom color theming #441
Replies: 3 comments 2 replies
-
Made some progress on this. Right now I'm
<style>
:root, .light, .light-theme {
--gold-1: #f8fefc;
--gold-2: #f1fcf8;
...
}
</style>
<Theme accentColor="gold">{children}</Theme>
extend: {
colors: {
"custom-1": "var(--custom-1)",
"custom-2": "var(--custom-2)",
}
} Edit: I've just realised this is not really necessary, I am using https://github.com/viktorbonino/radix-themes-tw which gives me the ability to use |
Beta Was this translation helpful? Give feedback.
-
I guess it's a similar problem to how the color generator outputs the colors you are seeing when using it. See the source code of that page: You can see how both problems of light/dark theme overrides and color variable naming are solved there. We also have gone through a similar exercise with the AuthKit product, which can be branded using a couple reference colors, so it's all achievable. |
Beta Was this translation helpful? Give feedback.
-
I had similar things to solve a year ago, and I made unocss preset to handle this, see here https://github.com/primus-ui/unocss-preset-radix-palette |
Beta Was this translation helpful? Give feedback.
-
Hey!
We are currently developing a white label multi-tenant platform. The pre-selected radix colors cover a lot of ground, but down the line, clients may want to have their exact brand colors. I've been playing around with the custom palette generator which works well.
However I'm struggling to fully understand if my use-case is possible/feasible.
Context:
style={{--custom-1: #fcfcff, ...}}
Do you have any recommendations on how to get this fully working with dark/light mode colors? IS there a way to get this working nicely with Radix Themes using runtime css values?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions