@uiw/codemirror-themes 4.21.24 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Extension } from '@codemirror/state';
2
2
  import { TagStyle } from '@codemirror/language';
3
+ import { StyleSpec } from 'style-mod';
3
4
  export interface CreateThemeOptions {
4
5
  /**
5
6
  * Theme inheritance. Determines which styles CodeMirror will apply by default.
@@ -38,6 +39,8 @@ export interface Settings {
38
39
  gutterBorder?: string;
39
40
  /** set editor font */
40
41
  fontFamily?: string;
42
+ /** set editor font size */
43
+ fontSize?: StyleSpec['fontSize'];
41
44
  }
42
45
  export declare const createTheme: ({ theme, settings, styles }: CreateThemeOptions) => Extension;
43
46
  export default createTheme;
package/cjs/index.js CHANGED
@@ -25,6 +25,9 @@ var createTheme = exports.createTheme = function createTheme(_ref) {
25
25
  if (settings.foreground) {
26
26
  baseStyle.color = settings.foreground;
27
27
  }
28
+ if (settings.fontSize) {
29
+ baseStyle.fontSize = settings.fontSize;
30
+ }
28
31
  if (settings.background || settings.foreground) {
29
32
  themeOptions['&'] = baseStyle;
30
33
  }
package/esm/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Extension } from '@codemirror/state';
2
2
  import { TagStyle } from '@codemirror/language';
3
+ import { StyleSpec } from 'style-mod';
3
4
  export interface CreateThemeOptions {
4
5
  /**
5
6
  * Theme inheritance. Determines which styles CodeMirror will apply by default.
@@ -38,6 +39,8 @@ export interface Settings {
38
39
  gutterBorder?: string;
39
40
  /** set editor font */
40
41
  fontFamily?: string;
42
+ /** set editor font size */
43
+ fontSize?: StyleSpec['fontSize'];
41
44
  }
42
45
  export declare const createTheme: ({ theme, settings, styles }: CreateThemeOptions) => Extension;
43
46
  export default createTheme;
package/esm/index.js CHANGED
@@ -19,6 +19,9 @@ export var createTheme = _ref => {
19
19
  if (settings.foreground) {
20
20
  baseStyle.color = settings.foreground;
21
21
  }
22
+ if (settings.fontSize) {
23
+ baseStyle.fontSize = settings.fontSize;
24
+ }
22
25
  if (settings.background || settings.foreground) {
23
26
  themeOptions['&'] = baseStyle;
24
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uiw/codemirror-themes",
3
- "version": "4.21.24",
3
+ "version": "4.22.0",
4
4
  "description": "Themes for CodeMirror.",
5
5
  "homepage": "https://uiwjs.github.io/react-codemirror/#/theme/doc",
6
6
  "funding": "https://jaywcjlove.github.io/#/sponsor",
package/src/index.tsx CHANGED
@@ -43,6 +43,8 @@ export interface Settings {
43
43
  gutterBorder?: string;
44
44
  /** set editor font */
45
45
  fontFamily?: string;
46
+ /** set editor font size */
47
+ fontSize?: StyleSpec['fontSize'];
46
48
  }
47
49
 
48
50
  export const createTheme = ({ theme, settings = {}, styles = [] }: CreateThemeOptions): Extension => {
@@ -59,6 +61,9 @@ export const createTheme = ({ theme, settings = {}, styles = [] }: CreateThemeOp
59
61
  if (settings.foreground) {
60
62
  baseStyle.color = settings.foreground;
61
63
  }
64
+ if (settings.fontSize) {
65
+ baseStyle.fontSize = settings.fontSize;
66
+ }
62
67
  if (settings.background || settings.foreground) {
63
68
  themeOptions['&'] = baseStyle;
64
69
  }