-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Custom editor.background color not applied in Monaco theme via @monaco-editor/react #700
Comments
I can work on this issue. |
The issue you're experiencing is a known limitation with the |
Is there any work around for this issue? |
The issue occurs because the editor.background property in the Monaco editor theme definition is not being applied correctly, likely due to a conflict with the vs-dark base theme or a misconfiguration in the theme setup. To fix this, ensure the theme is defined and set properly before the editor mounts, and verify that the editor.background property is correctly specified. Additionally, check for any CSS overrides or external styles that might be interfering with the editor's background color. If the problem persists, try using a different base theme or explicitly setting the background color via inline styles or CSS. Finally, ensure the Monaco editor and its dependencies are up to date to avoid potential bugs. |
I tried all the themes including 'vs', 'hc-black', and 'hc-light', yet the issue still persisted. The theme is defined and set before the editor mounts. |
So, the code works fine, but the background of the Monaco editor is red? |
Just the minimap as you can see in the photo |
If only the minimap's background color changes to red while the editor's background remains unchanged, it means the minimap.background property in your custom theme is being applied correctly, but the editor.background property is either being overridden, ignored, or not properly recognized by the Monaco editor. This suggests a potential issue with how the theme is being applied to the editor itself, possibly due to incorrect configuration, conflicts with the base theme (vs-dark), or external styling interference. Focus on ensuring the editor.background property is correctly defined and applied in the theme setup. |
Try to Force Background Override in Tailwind or CSS
Instead of relying only on defineTheme, explicitly set the background color via editorOptions:
|
Describe the bug
A clear and concise description of what the bug is.
Setting editor.background to red via defineTheme doesn't change the background color of the Monaco editor when using it with the @monaco-editor/react package. The property appears to apply only to the minimap, but the background remains unchanged.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The background of the Monaco editor should be red (#FF0000) as defined in the custom theme.
Screenshots
Desktop (please complete the following information):
Additional context
N/a
The text was updated successfully, but these errors were encountered: