Skip to content

Commit ead023b

Browse files
committedApr 29, 2024·
feat: add font size setting to the theme. #651
1 parent 6440766 commit ead023b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎themes/theme/src/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export interface Settings {
4343
gutterBorder?: string;
4444
/** set editor font */
4545
fontFamily?: string;
46+
/** set editor font size */
47+
fontSize?: StyleSpec;
4648
}
4749

4850
export const createTheme = ({ theme, settings = {}, styles = [] }: CreateThemeOptions): Extension => {
@@ -59,6 +61,9 @@ export const createTheme = ({ theme, settings = {}, styles = [] }: CreateThemeOp
5961
if (settings.foreground) {
6062
baseStyle.color = settings.foreground;
6163
}
64+
if (settings.fontSize) {
65+
baseStyle.fontSize = settings.fontSize;
66+
}
6267
if (settings.background || settings.foreground) {
6368
themeOptions['&'] = baseStyle;
6469
}

0 commit comments

Comments
 (0)
Please sign in to comment.