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

Remove theme parameter from <Editor>: Theme, in monaco, is global. #487

Open
Ivorforce opened this issue May 24, 2023 · 1 comment · May be fixed by #531
Open

Remove theme parameter from <Editor>: Theme, in monaco, is global. #487

Ivorforce opened this issue May 24, 2023 · 1 comment · May be fixed by #531

Comments

@Ivorforce
Copy link

Ivorforce commented May 24, 2023

The theme in monaco is, shockingly, a global variable, not a per-editor variable.

When a new <Editor> is created, it will set the theme. If no theme was explicitly set, it will set it to light. When you have multiple editors, this is wrong because spawning a new editor should not change the theme.

Instead, authors should be encouraged to set the theme themselves during beforeMount, with a hint that the theme is global.

@Ivorforce
Copy link
Author

Ivorforce commented May 24, 2023

An alternative would be to not default to light: When no theme is passed (undefined), just don't call setTheme. I wouldn't do this because it still implies the wrong mindset about the 'theme' parameter being local, but it might be an easier sell because it won't break backward compatibility.

@magic-akari magic-akari linked a pull request Sep 11, 2023 that will close this issue
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 a pull request may close this issue.

1 participant