Skip to content

Commit 057203c

Browse files
authored
chore(compass-editor): adjust fold placeholder colors for dark mode (#4100)
chore(compass-editor): adjust fold palceholder colors for dark mode
1 parent 7675c98 commit 057203c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/compass-editor/src/json-editor.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ const editorPalette = {
9898
infoGutterIconColor: encodeURIComponent(palette.blue.base),
9999
warningGutterIconColor: encodeURIComponent(palette.yellow.base),
100100
errorGutterIconColor: encodeURIComponent(palette.red.base),
101+
foldPlaceholderColor: palette.gray.base,
102+
foldPlaceholderBackgroundColor: palette.gray.light3,
101103
},
102104
dark: {
103105
color: codePalette.dark[3],
@@ -114,6 +116,8 @@ const editorPalette = {
114116
infoGutterIconColor: encodeURIComponent(palette.blue.light1),
115117
warningGutterIconColor: encodeURIComponent(palette.yellow.light2),
116118
errorGutterIconColor: encodeURIComponent(palette.red.light1),
119+
foldPlaceholderColor: palette.gray.base,
120+
foldPlaceholderBackgroundColor: palette.gray.dark3,
117121
},
118122
} as const;
119123

@@ -179,6 +183,14 @@ function getStylesForTheme(theme: CodemirrorThemeType) {
179183
'&.cm-focused .cm-activeLineGutter': {
180184
backgroundColor: editorPalette[theme].gutterActiveLineBackgroundColor,
181185
},
186+
'& .cm-foldPlaceholder': {
187+
display: 'inline-block',
188+
border: 'none',
189+
color: editorPalette[theme].foldPlaceholderColor,
190+
backgroundColor: editorPalette[theme].foldPlaceholderBackgroundColor,
191+
boxShadow: `inset 0 0 0 1px ${editorPalette[theme].foldPlaceholderColor}`,
192+
padding: '0 2px',
193+
},
182194
'& .foldMarker': {
183195
width: `${spacing[3]}px`,
184196
height: `${spacing[3]}px`,

0 commit comments

Comments
 (0)