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:
@@ -155,6 +155,6 @@ const letterStyle = computed(() => {
|
||||
color: var(--td-text-color-anti);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-family: var(--app-font-family);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -271,7 +271,7 @@ defineExpose({ loadShares })
|
||||
gap: 8px;
|
||||
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);
|
||||
@@ -344,7 +344,7 @@ defineExpose({ loadShares })
|
||||
align-items: center;
|
||||
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);
|
||||
@@ -451,7 +451,7 @@ defineExpose({ loadShares })
|
||||
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);
|
||||
@@ -463,7 +463,7 @@ defineExpose({ loadShares })
|
||||
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-placeholder);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ watch(showTooltip, (newVal) => {
|
||||
border: 1px solid var(--td-component-stroke);
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.08);
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 1.6;
|
||||
@@ -273,7 +273,7 @@ watch(showTooltip, (newVal) => {
|
||||
|
||||
.tooltip-content {
|
||||
color: var(--td-text-color-primary);
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 1.6;
|
||||
|
||||
@@ -2543,7 +2543,7 @@ const getImgSrc = (url: string) => {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
font-family: var(--td-font-family, "PingFang SC");
|
||||
font-family: var(--app-font-family);
|
||||
padding: 12px 16px 56px 16px;
|
||||
border-radius: 0 0 12px 12px;
|
||||
border: none;
|
||||
@@ -2558,7 +2558,7 @@ const getImgSrc = (url: string) => {
|
||||
|
||||
&::placeholder {
|
||||
color: var(--td-text-color-placeholder, #00000066);
|
||||
font-family: var(--td-font-family, "PingFang SC");
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
|
||||
@@ -421,7 +421,7 @@ onBeforeUnmount(() => {
|
||||
color: var(--td-text-color-primary);
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ const scrollToItem = (index: number) => {
|
||||
border-radius: var(--td-radius-default, 3px);
|
||||
color: var(--td-text-color-primary, #333);
|
||||
font-size: var(--td-font-size-body-medium, 14px);
|
||||
font-family: var(--td-font-family, "PingFang SC");
|
||||
font-family: var(--app-font-family);
|
||||
transition: background 0.2s cubic-bezier(0.38, 0, 0.24, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ function handleGoToOrgSettings(orgId: string) {
|
||||
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);
|
||||
@@ -427,7 +427,7 @@ function handleGoToOrgSettings(orgId: string) {
|
||||
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-placeholder);
|
||||
|
||||
|
||||
@@ -180,6 +180,6 @@ const letterStyle = computed(() => {
|
||||
color: var(--td-text-color-anti);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-family: var(--app-font-family);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
margin-top: 5px;
|
||||
font-weight: bold;
|
||||
color: var(--td-text-color-placeholder);
|
||||
font-family: "PingFang SC", "Cascadia Code";
|
||||
font-family: var(--app-font-family);
|
||||
transition: all 0.2s ease-out;
|
||||
font-size: 20px;
|
||||
}
|
||||
@@ -91,7 +91,7 @@
|
||||
table {
|
||||
font-size: 14px;
|
||||
margin: 10px 0;
|
||||
font-family: "PingFang SC", "Cascadia Code";
|
||||
font-family: var(--app-font-family);
|
||||
}
|
||||
|
||||
h2 {
|
||||
@@ -307,7 +307,7 @@
|
||||
|
||||
.md-image>.md-meta {
|
||||
border-radius: 3px;
|
||||
font-family: var(--font-monospace);
|
||||
font-family: var(--app-font-family-mono);
|
||||
padding: 2px 0 0 4px;
|
||||
font-size: 0.9em;
|
||||
color: inherit;
|
||||
@@ -337,7 +337,7 @@
|
||||
.context-menu,
|
||||
.megamenu-content,
|
||||
footer {
|
||||
font-family: var(--font-sans-serif);
|
||||
font-family: var(--app-font-family);
|
||||
}
|
||||
|
||||
.file-node-content:hover .file-node-icon,
|
||||
@@ -436,6 +436,6 @@
|
||||
}
|
||||
|
||||
.outline-label {
|
||||
font-family: "Cascadia Code", "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ const { t } = useI18n()
|
||||
|
||||
.empty-txt {
|
||||
color: var(--td-text-color-placeholder);
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 26px;
|
||||
@@ -31,7 +31,7 @@ const { t } = useI18n()
|
||||
.empty-type-txt {
|
||||
color: var(--td-text-color-disabled);
|
||||
text-align: center;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
width: 217px;
|
||||
|
||||
@@ -971,7 +971,7 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
:deep(.t-textarea__inner) {
|
||||
font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
|
||||
font-family: var(--app-font-family-mono);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -997,7 +997,7 @@ onBeforeUnmount(() => {
|
||||
background: var(--td-bg-color-container-hover);
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
|
||||
font-family: var(--app-font-family-mono);
|
||||
}
|
||||
|
||||
:deep(pre) {
|
||||
|
||||
@@ -1106,7 +1106,7 @@ const onDragHandleMouseDown = (e: MouseEvent) => {
|
||||
.menu_title {
|
||||
color: var(--td-text-color-secondary);
|
||||
text-overflow: ellipsis;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
@@ -1118,7 +1118,7 @@ const onDragHandleMouseDown = (e: MouseEvent) => {
|
||||
}
|
||||
|
||||
.submenu {
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
overflow-y: auto;
|
||||
@@ -1161,7 +1161,7 @@ const onDragHandleMouseDown = (e: MouseEvent) => {
|
||||
}
|
||||
|
||||
.timeline_header {
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--td-text-color-disabled);
|
||||
|
||||
@@ -19,7 +19,7 @@ const { t } = useI18n()
|
||||
}
|
||||
.drag-txt {
|
||||
color: var(--td-brand-color);
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
line-height: 26px;
|
||||
@@ -31,7 +31,7 @@ const { t } = useI18n()
|
||||
width: 217px;
|
||||
color: var(--td-text-color-disabled);
|
||||
text-align: center;
|
||||
font-family: "PingFang SC";
|
||||
font-family: var(--app-font-family);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user