fix(ace-editor): use monospace fonts by default (#23747)
This commit is contained in:
parent
f80e738196
commit
b2b8c3e05b
|
|
@ -65,9 +65,6 @@ const StyledAceEditor = styled(AceEditor)`
|
|||
// double class is better than !important
|
||||
border: 1px solid ${theme.colors.grayscale.light2};
|
||||
font-feature-settings: 'liga' off, 'calt' off;
|
||||
// Fira Code causes problem with Ace under Firefox
|
||||
font-family: 'Menlo', 'Consolas', 'Courier New', 'Ubuntu Mono',
|
||||
'source-code-pro', 'Lucida Console', monospace;
|
||||
|
||||
&.ace_autocomplete {
|
||||
// Use !important because Ace Editor applies extra CSS at the last second
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ export type AsyncAceEditorOptions = {
|
|||
defaultMode?: AceEditorMode;
|
||||
defaultTheme?: AceEditorTheme;
|
||||
defaultTabSize?: number;
|
||||
fontFamily?: string;
|
||||
placeholder?: React.ComponentType<
|
||||
PlaceholderProps & Partial<IAceEditorProps>
|
||||
> | null;
|
||||
|
|
@ -98,6 +99,7 @@ export default function AsyncAceEditor(
|
|||
defaultMode,
|
||||
defaultTheme,
|
||||
defaultTabSize = 2,
|
||||
fontFamily = 'Menlo, Consolas, Courier New, Ubuntu Mono, source-code-pro, Lucida Console, monospace',
|
||||
placeholder,
|
||||
}: AsyncAceEditorOptions = {},
|
||||
) {
|
||||
|
|
@ -153,6 +155,7 @@ export default function AsyncAceEditor(
|
|||
theme={theme}
|
||||
tabSize={tabSize}
|
||||
defaultValue={defaultValue}
|
||||
setOptions={{ fontFamily }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue