Skip to content

Commit

Permalink
feat: add font size setting to the theme. #651
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 29, 2024
1 parent 6440766 commit ead023b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions themes/theme/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export interface Settings {
gutterBorder?: string;
/** set editor font */
fontFamily?: string;
/** set editor font size */
fontSize?: StyleSpec;
}

export const createTheme = ({ theme, settings = {}, styles = [] }: CreateThemeOptions): Extension => {
Expand All @@ -59,6 +61,9 @@ export const createTheme = ({ theme, settings = {}, styles = [] }: CreateThemeOp
if (settings.foreground) {
baseStyle.color = settings.foreground;
}
if (settings.fontSize) {
baseStyle.fontSize = settings.fontSize;
}
if (settings.background || settings.foreground) {
themeOptions['&'] = baseStyle;
}
Expand Down

0 comments on commit ead023b

Please sign in to comment.