Open MarcinAman opened 3 years ago
Hi, @MarcinAman! Thank you for your feedback. Unfortunately, now the widget does not support changing the theme dynamically. As a workaround, instead of render 2 versions, you can try to recreate the widget with new parameters. Something like that:
let instance;
initPlayground(element, theme) {
if (instance) {
instance.destroy();
}
playground(element, {
getInstance: playgroundInstance => instance = playgroundInstance,
theme: theme
});
}
Most likely, we will add a possibility to change the theme dynamically, but it will take us some time to do this.
Hi, is it possible to change the theme of sample dynamically (in JS). I have a theme toggler on my page therefore i'd like to also adjust the sample theme from
idea
todarcula
. I've tried to just change the parameter manually but it doesn't seem to update anything (probably the change is not propagated)Technically i could just render 2 versions and hide one but this results in super bad user experience