Skip to content

Commit

Permalink
chore: add postcss plugin replace rem to px
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Oct 2, 2024
1 parent d294659 commit 3f5bb1b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"@thedutchcoder/postcss-rem-to-px": "^0.0.2",
"@vitejs/plugin-vue": "^5.1.3",
"autoprefixer": "^10.4.20",
"eslint": "^9.10.0",
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
// 将全部rem替换为px,避免网页修改html font-size影响tailwind(如直播页)
// https://github.com/TheDutchCoder/postcss-rem-to-px/issues/4
'@thedutchcoder/postcss-rem-to-px': {},
},
}
2 changes: 1 addition & 1 deletion src/modules/rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const loadRules = () => {
break
}
} catch (err) {
error('load item failed', err)
error(`load item failed, type=${item.type}, name=${item.name}`, err)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/modules/rules/live/groups/right.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ html[live-page-compact-danmaku] {
}
.chat-history-panel .chat-history-list .chat-item {
padding: 3px 5px !important;
font-size: 1.2rem !important;
font-size: 15px !important;
}
.chat-history-panel .chat-history-list .chat-item.danmaku-item .user-name {
font-size: 1.2rem !important;
font-size: 15px !important;
}
.chat-history-panel .chat-history-list .chat-item.danmaku-item .reply-uname {
font-size: 1.2rem !important;
font-size: 15px !important;
}
.chat-history-panel .chat-history-list .chat-item.danmaku-item .reply-uname .common-nickname-wrapper {
font-size: 1.2rem !important;
font-size: 15px !important;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/rules/video/groups/toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ html[video-page-hide-below-info-tag] {
.video-tag-container {
visibility: hidden !important;
height: 0 !important;
margin: 0 0 0.5rem !important;
margin: 0 0 10px !important;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@layer base {
/* change 1rem for live.bilibili.com */
:host {
font-size: 16px !important;
font-family:
PingFang SC,
HarmonyOS_Regular,
Expand Down

0 comments on commit 3f5bb1b

Please sign in to comment.