Theme toggle with new theme stuff

Hello,

With the new and improved them editor, is there any way to affect theme variables from the user interface? I would like my users to be able to choose from at least light and dark themes with a toggle component.

Thanks :slight_smile:
M

using a variable, assigned to the theme values, you can make dinamic changes to the theme.

to do that , first you need to assign the colors in your theme


and then, use a function in your components


finally, set the function with the theme variables

1 Like

It looks like this will work - mostly.
To affect change across all components I would need to go into each style class and tie each to a local pallet and color variable, right?

1 Like


if you mean here, yes you would have to choose some colors and then connect them to each component you want

I tried to use this method to toggle the background color of a page to get dark/light theme. But it does not automatically adjust the content colors, as “smartcolors” are meant to. Setting the background color manually to my “custom dark background” does behave smartly, but not when a formula is used. Is there a proper solution?