From 38ff5b7696119b7adfa4f883868a34a6d0fea20b Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Thu, 20 Apr 2023 11:20:25 +0300 Subject: [PATCH] fix(ace-editor): use monospace fonts by default --- .../src/SqlLab/components/AceEditorWrapper/index.tsx | 3 --- superset-frontend/src/components/AsyncAceEditor/index.tsx | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx index d14d532dcd81b..213a8c3239f71 100644 --- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx +++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx @@ -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 diff --git a/superset-frontend/src/components/AsyncAceEditor/index.tsx b/superset-frontend/src/components/AsyncAceEditor/index.tsx index dc5a37a61460c..297ff7b552223 100644 --- a/superset-frontend/src/components/AsyncAceEditor/index.tsx +++ b/superset-frontend/src/components/AsyncAceEditor/index.tsx @@ -84,6 +84,7 @@ export type AsyncAceEditorOptions = { defaultMode?: AceEditorMode; defaultTheme?: AceEditorTheme; defaultTabSize?: number; + fontFamily?: string; placeholder?: React.ComponentType< PlaceholderProps & Partial > | 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} /> );