Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for light/dark theme toggle in the Playground editor #2223

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

filipw
Copy link
Contributor

@filipw filipw commented Mar 12, 2025

The playground editor theme is now in based on the current system theme.
There is also a new button to toggle between dark/light themes.

out

@billti
Copy link
Member

billti commented Mar 12, 2025

Thanks! It would definitely be nice to have, though I think something more wholistic might be preferable. It seems a little odd when the editor changes to dark theme but the rest of the page is still in a light theme.

I did support theming on the katas preview page if you want to see how it's done there. For example, you can open https://microsoft.github.io/qsharp/katas.html and change the system theme to see the whole site change (or you can explicitly open in light mode or dark mode. Would something like that be possible?

@filipw
Copy link
Contributor Author

filipw commented Mar 12, 2025

Thanks, I wanted to keep the change small, as toggling just Monaco is relatively non-invasive - I didn't know I had the mandate to change the whole thing 😀

I've now pushed a change where the theme management is moved up to the nav component and propagates from there to the editors and the body. I also (obviously) had to introduce a bunch of new CSS.

I might have missed something because I am not sure I know all the nooks and crannies of the playground and what might be shown when, but it seems to work.

out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants