feat(frontend): unify font rendering and add font picker in settings
The UI used hardcoded "PingFang SC" in 50+ components, while the global font stack in App.vue used a different fallback chain. Outside of mainland China this caused visibly different fonts in the sidebar, breadcrumbs, search and agent views compared to settings and document panes. - Introduce --app-font-family / --app-font-family-mono CSS variables in theme.css and route TDesign's --td-font-family through them - Add a useFont composable that persists the user's choice in localStorage and applies it via document.documentElement.style before mount - Replace hardcoded font-family declarations across the app with the new variables (TencentSans logo and the SVG attribute list are preserved) - Add UI font and monospace font selectors in General Settings with i18n strings for en-US, zh-CN, ko-KR and ru-RU https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
This commit is contained in:
@@ -852,7 +852,7 @@ const stepTitles = computed(() => [
|
||||
border-radius: 3px;
|
||||
background: var(--td-bg-color-component);
|
||||
color: var(--td-text-color-secondary);
|
||||
font-family: monospace;
|
||||
font-family: var(--app-font-family-mono);
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ watch(() => props.parserEngineRules, (v) => {
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-family: var(--app-font-family-mono);
|
||||
}
|
||||
|
||||
.desc {
|
||||
@@ -442,7 +442,7 @@ watch(() => props.parserEngineRules, (v) => {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--td-text-color-primary);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-family: var(--app-font-family-mono);
|
||||
}
|
||||
|
||||
.engine-option-desc {
|
||||
|
||||
@@ -314,7 +314,7 @@ onMounted(async () => {
|
||||
|
||||
.section-title {
|
||||
margin: 0 0 8px 0;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: var(--td-text-color-primary);
|
||||
@@ -322,7 +322,7 @@ onMounted(async () => {
|
||||
|
||||
.section-desc {
|
||||
margin: 0;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 14px;
|
||||
color: var(--td-text-color-placeholder);
|
||||
line-height: 22px;
|
||||
@@ -339,7 +339,7 @@ onMounted(async () => {
|
||||
.form-label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: var(--td-text-color-primary);
|
||||
@@ -381,7 +381,7 @@ onMounted(async () => {
|
||||
margin-bottom: 16px;
|
||||
|
||||
.shares-title {
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: var(--td-text-color-primary);
|
||||
@@ -465,7 +465,7 @@ onMounted(async () => {
|
||||
gap: 8px;
|
||||
|
||||
.org-name {
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--td-text-color-primary);
|
||||
@@ -598,7 +598,7 @@ onMounted(async () => {
|
||||
margin-bottom: 2px;
|
||||
|
||||
.org-option-name {
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--td-text-color-primary);
|
||||
@@ -612,7 +612,7 @@ onMounted(async () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 12px;
|
||||
color: var(--td-text-color-secondary);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user