mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 18:32:10 +08:00
fix: unify font-family usage across GUI
- Remove hardcoded body font-family from index.scss, use MUI theme dt.font_family instead - Extract monospace font stack to shared MONACO_FONT_FAMILY constant in utils/font-family.ts - Add platform check for twemoji mozilla in ip-info-card.tsx - Consolidate 5 Monaco Editor font-family declarations into single constant
This commit is contained in:
@@ -24,7 +24,7 @@ import { showNotice } from '@/services/notice-service'
|
||||
import { useThemeMode } from '@/services/states'
|
||||
import type { MonacoEditorInstance, MonacoMarker } from '@/types/monaco'
|
||||
import debounce from '@/utils/debounce'
|
||||
import getSystem from '@/utils/get-system'
|
||||
import { MONACO_FONT_FAMILY } from '@/utils/font-family'
|
||||
|
||||
const appWindow = getCurrentWebviewWindow()
|
||||
|
||||
@@ -247,9 +247,7 @@ export const EditorViewer = ({
|
||||
padding: {
|
||||
top: 33,
|
||||
},
|
||||
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"${
|
||||
getSystem() === 'windows' ? ', twemoji mozilla' : ''
|
||||
}`,
|
||||
fontFamily: MONACO_FONT_FAMILY,
|
||||
fontLigatures: false,
|
||||
smoothScrolling: true,
|
||||
}}
|
||||
|
||||
@@ -60,7 +60,7 @@ import { showNotice } from '@/services/notice-service'
|
||||
import { useThemeMode } from '@/services/states'
|
||||
import type { TranslationKey } from '@/types/generated/i18n-keys'
|
||||
import type { MonacoEditorInstance } from '@/types/monaco'
|
||||
import getSystem from '@/utils/get-system'
|
||||
import { MONACO_FONT_FAMILY } from '@/utils/font-family'
|
||||
import { parseYamlSafe } from '@/utils/yaml'
|
||||
|
||||
interface Props {
|
||||
@@ -1193,9 +1193,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
||||
padding: {
|
||||
top: 33, // 顶部padding防止遮挡snippets
|
||||
},
|
||||
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"${
|
||||
getSystem() === 'windows' ? ', twemoji mozilla' : ''
|
||||
}`,
|
||||
fontFamily: MONACO_FONT_FAMILY,
|
||||
fontLigatures: false, // 连字符
|
||||
smoothScrolling: true, // 平滑滚动
|
||||
}}
|
||||
|
||||
@@ -46,7 +46,7 @@ import { readProfileFile, saveProfileFile } from '@/services/cmds'
|
||||
import { showNotice } from '@/services/notice-service'
|
||||
import { useThemeMode } from '@/services/states'
|
||||
import type { MonacoEditorInstance } from '@/types/monaco'
|
||||
import getSystem from '@/utils/get-system'
|
||||
import { MONACO_FONT_FAMILY } from '@/utils/font-family'
|
||||
import parseUri from '@/utils/uri-parser'
|
||||
import { parseYamlSafe } from '@/utils/yaml'
|
||||
|
||||
@@ -563,9 +563,7 @@ export const ProxiesEditorViewer = (props: Props) => {
|
||||
padding: {
|
||||
top: 33, // 顶部padding防止遮挡snippets
|
||||
},
|
||||
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"${
|
||||
getSystem() === 'windows' ? ', twemoji mozilla' : ''
|
||||
}`,
|
||||
fontFamily: MONACO_FONT_FAMILY,
|
||||
fontLigatures: false, // 连字符
|
||||
smoothScrolling: true, // 平滑滚动
|
||||
}}
|
||||
|
||||
@@ -49,6 +49,7 @@ import { showNotice } from '@/services/notice-service'
|
||||
import { useThemeMode } from '@/services/states'
|
||||
import type { TranslationKey } from '@/types/generated/i18n-keys'
|
||||
import type { MonacoEditorInstance } from '@/types/monaco'
|
||||
import { MONACO_FONT_FAMILY } from '@/utils/font-family'
|
||||
import getSystem from '@/utils/get-system'
|
||||
import { isValidIpCidr } from '@/utils/network'
|
||||
import { parseYamlSafe } from '@/utils/yaml'
|
||||
@@ -894,9 +895,7 @@ export const RulesEditorViewer = (props: Props) => {
|
||||
padding: {
|
||||
top: 33, // 顶部padding防止遮挡snippets
|
||||
},
|
||||
fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"${
|
||||
getSystem() === 'windows' ? ', twemoji mozilla' : ''
|
||||
}`,
|
||||
fontFamily: MONACO_FONT_FAMILY,
|
||||
fontLigatures: false, // 连字符
|
||||
smoothScrolling: true, // 平滑滚动
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user