Skip to content

Commit

Permalink
feat: move font-patch to common
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Sep 30, 2024
1 parent c5483ba commit 96b840e
Show file tree
Hide file tree
Showing 14 changed files with 1,559 additions and 86 deletions.
76 changes: 76 additions & 0 deletions src/modules/rules/common/groups/basic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,79 @@ html[hide-footer] {
display: none !important;
}
}

// 修复字体
html[font-patch-live] {
body,
.gift-item,
.feed-card,
.bb-comment,
.comment-bilibili-fold {
font-family: 'PingFang SC', 'HarmonyOS_Regular', 'Helvetica Neue', 'Microsoft YaHei', sans-serif !important;
font-weight: 400;
}
}
html[font-patch-dynamic] {
.reply-item .root-reply-container .content-warp .user-info .user-name {
font-family:
"PingFang SC",
"HarmonyOS_Medium",
"Helvetica Neue",
"Microsoft YaHei",
sans-serif !important;
font-weight: 500 !important;
font-size: 14px !important;
}
body {
font-family:
"PingFang SC",
"HarmonyOS_Regular",
"Helvetica Neue",
"Microsoft YaHei",
sans-serif !important;
font-weight: 400;
}
}
html[font-patch-popular] {
#internationalHeader,
.international-header,
.suggest-wrap,
.van-popover {
font-family: 'PingFang SC', 'HarmonyOS_Regular', 'Helvetica Neue', 'Microsoft YaHei', sans-serif !important;
font-weight: 400;
}
#app {
font-family: 'PingFang SC', 'HarmonyOS_Medium', 'Helvetica Neue', 'Microsoft YaHei', sans-serif !important;
font-weight: 500;
}
}
html[font-patch-watchlater] {
body {
font-family: 'PingFang SC', 'HarmonyOS_Regular', 'Helvetica Neue', 'Microsoft YaHei', sans-serif !important;
font-weight: 400;
font-size: 14px;
}
.av-item .av-about .t {
font-family: 'PingFang SC', 'HarmonyOS_Medium', 'Helvetica Neue', 'Microsoft YaHei', sans-serif !important;
font-weight: 500 !important;
}
}
html[font-patch-space] {
body,
.h .h-sign,
.reply-item .root-reply-container .content-warp .user-info .user-name,
.bili-comment.browser-pc * {
font-family: 'PingFang SC', 'HarmonyOS_Regular', 'Helvetica Neue', 'Microsoft YaHei', sans-serif !important;
font-weight: 400;
}
body,
.n .n-text {
font-size: 14px;
}
#page-index .channel .channel-item .small-item,
#page-video .page-head__left .be-tab-item,
.n .n-data .n-data-k,
.n .n-data .n-data-v {
font-size: 13px;
}
}
27 changes: 27 additions & 0 deletions src/modules/rules/common/groups/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
isPagePlaylist,
isPagePopular,
isPageSearch,
isPageSpace,
isPageVideo,
isPageWatchlater,
} from '../../../../utils/pageType'
import URLCleanerInstance from '../../../../utils/urlCleaner'

Expand Down Expand Up @@ -139,4 +141,29 @@ export const commonBasicItems: Item[] = [
id: 'hide-footer',
name: '隐藏 页底footer',
},
{
type: 'switch',
id: 'hide-footer',
name: '修复字体 (实验功能)',
// 根据当前页面选定attribute name
attrName: ((): string | undefined => {
if (isPageLive()) {
return 'font-patch-live'
}
if (isPageDynamic()) {
return 'font-patch-dynamic'
}
if (isPagePopular()) {
return 'font-patch-popular'
}
if (isPageWatchlater()) {
return 'font-patch-watchlater'
}
if (isPageSpace()) {
return 'font-patch-space'
}
return undefined
})(),
description: ['让全站字体与首页字体一致', '生效页面:动态、直播、热门、稍后再看'],
},
]
Loading

0 comments on commit 96b840e

Please sign in to comment.