Merge pull request #27953 from overleaf/mj-editor-color-scheme

[web] Specify CSS color-scheme based on editor theme

GitOrigin-RevId: dda4039b7fcc4aecc7ed3f96efe15518599c9226
This commit is contained in:
Mathias Jakobsen
2025-08-19 15:02:40 +01:00
committed by Copybot
parent fc5ae92be1
commit 33dbfe4c6f
2 changed files with 13 additions and 1 deletions

View File

@@ -45,7 +45,13 @@ const createThemeFromOptions = ({
]
}
const baseTheme = EditorView.theme({
const baseTheme = EditorView.baseTheme({
'&light.cm-editor': {
colorScheme: 'light',
},
'&dark.cm-editor': {
colorScheme: 'dark',
},
'.cm-content': {
fontSize: 'var(--font-size)',
fontFamily: 'var(--source-font-family)',

View File

@@ -92,6 +92,12 @@ const createThemeFromOptions = ({
* Base styles that can have &dark and &light variants
*/
const baseTheme = EditorView.baseTheme({
'&light.cm-editor': {
colorScheme: 'light',
},
'&dark.cm-editor': {
colorScheme: 'dark',
},
'.cm-content': {
fontSize: 'var(--font-size)',
fontFamily: 'var(--source-font-family)',