Skip to content

Commit

Permalink
fix(ace-editor): use monospace fonts by default (#23747)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Apr 20, 2023
1 parent f80e738 commit b2b8c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions superset-frontend/src/components/AsyncAceEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export type AsyncAceEditorOptions = {
defaultMode?: AceEditorMode;
defaultTheme?: AceEditorTheme;
defaultTabSize?: number;
fontFamily?: string;
placeholder?: React.ComponentType<
PlaceholderProps & Partial<IAceEditorProps>
> | null;
Expand All @@ -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 = {},
) {
Expand Down Expand Up @@ -153,6 +155,7 @@ export default function AsyncAceEditor(
theme={theme}
tabSize={tabSize}
defaultValue={defaultValue}
setOptions={{ fontFamily }}
{...props}
/>
);
Expand Down

0 comments on commit b2b8c3e

Please sign in to comment.