Skip to content

Commit 4566d71

Browse files
committedNov 17, 2022
feat: add gutterActiveForeground option.
1 parent cd4d0f4 commit 4566d71

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
 

‎themes/theme/src/index.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export interface Settings {
3535
gutterBackground?: string;
3636
/** Text color inside gutter. */
3737
gutterForeground?: string;
38+
/** Text active color inside gutter. */
39+
gutterActiveForeground?: string;
3840
/** Gutter right border color. */
3941
gutterBorder?: string;
4042
}
@@ -66,15 +68,17 @@ export const createTheme = ({ theme, settings, styles }: CreateThemeOptions): Ex
6668
borderLeftColor: settings.caret,
6769
};
6870
}
69-
71+
let activeLineGutterStyle: StyleSpec = {};
72+
if (settings.gutterActiveForeground) {
73+
activeLineGutterStyle.color = settings.gutterActiveForeground;
74+
}
7075
if (settings.lineHighlight) {
7176
themeOptions['.cm-activeLine'] = {
7277
backgroundColor: settings.lineHighlight,
7378
};
74-
themeOptions['.cm-activeLineGutter'] = {
75-
backgroundColor: settings.lineHighlight,
76-
};
79+
activeLineGutterStyle.backgroundColor = settings.lineHighlight;
7780
}
81+
themeOptions['.cm-activeLineGutter'] = activeLineGutterStyle;
7882

7983
if (settings.selection) {
8084
themeOptions[

‎www/src/pages/theme/editor/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export function ThemeEditor() {
8181
gutterBackground: '#FFFFFF',
8282
gutterForeground: '#4D4D4C',
8383
gutterBorder: '#ddd',
84+
gutterActiveForeground: '',
8485
lineHighlight: '#EFEFEF',
8586
});
8687

‎www/src/pages/theme/editor/themeCode.ts

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ const myTheme = createTheme({
207207
gutterBackground: '${styles.gutterBackground}',
208208
gutterForeground: '${styles.gutterForeground}',
209209
gutterBorder: '${styles.gutterBorder}',
210+
gutterActiveForeground: '${styles.gutterActiveForeground}',
210211
lineHighlight: '${styles.lineHighlight}',
211212
},
212213
styles: [

0 commit comments

Comments
 (0)
Please sign in to comment.