stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.24k stars 889 forks source link

Allow light/dark theme toggle within embeds #3119

Open effulgentsia opened 7 hours ago

effulgentsia commented 7 hours ago

If I go to any StackBlitz URL, for example: https://stackblitz.com/edit/node, there's an icon at the bottom left for "Switch to Light Theme" / "Switch to Dark Theme".

The embed version of this (https://stackblitz.com/edit/node?embed=1) allows for theme=dark or theme=light to be passed as a URL parameter or SDK option, but doesn't provide the user-clickable toggle at the bottom left.

It would be great to be able to use the toggle within embeds. Whether that's made available by default for embeds globally, or whether a new SDK option gets added to enable it.

effulgentsia commented 7 hours ago

I see that there's the editor.setTheme() API, which might actually solve my use case well enough, though having the toggle within the StackBlitz UI itself would still be nice.