mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
MonacoEditor: set font to Roboto mono (#98672)
set default code editor font to roboto mono
This commit is contained in:
parent
f75bbe9f43
commit
42f6f917c9
@ -11,7 +11,7 @@ import type { ReactMonacoEditorProps } from './types';
|
|||||||
monacoEditorLoader.config({ monaco });
|
monacoEditorLoader.config({ monaco });
|
||||||
|
|
||||||
export const ReactMonacoEditor = (props: ReactMonacoEditorProps) => {
|
export const ReactMonacoEditor = (props: ReactMonacoEditorProps) => {
|
||||||
const { beforeMount } = props;
|
const { beforeMount, options, ...restProps } = props;
|
||||||
|
|
||||||
const theme = useTheme2();
|
const theme = useTheme2();
|
||||||
const onMonacoBeforeMount = useCallback(
|
const onMonacoBeforeMount = useCallback(
|
||||||
@ -23,6 +23,14 @@ export const ReactMonacoEditor = (props: ReactMonacoEditorProps) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Editor {...props} theme={theme.isDark ? 'grafana-dark' : 'grafana-light'} beforeMount={onMonacoBeforeMount} />
|
<Editor
|
||||||
|
{...restProps}
|
||||||
|
options={{
|
||||||
|
...options,
|
||||||
|
fontFamily: theme.typography.code.fontFamily,
|
||||||
|
}}
|
||||||
|
theme={theme.isDark ? 'grafana-dark' : 'grafana-light'}
|
||||||
|
beforeMount={onMonacoBeforeMount}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user