Skip to content

Commit 24592b8

Browse files
committed
兼容暗色模式字体颜色,手机端居中
1 parent 7d2a682 commit 24592b8

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎assets/css/custom-layout.css‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,22 @@
5757
display: inline-block;
5858
}
5959

60+
/* 新增:覆盖侧边栏链接内的 <strong> 标签样式,解决深色模式下不是白色的问题 */
61+
.ty-blog-sidebar__link strong {
62+
color: var(--color-text-heading, #fff); /* 继承 CSS 变量,深色模式下为白色 */
63+
font-weight: bold; /* 保留加粗效果,不改变原有样式 */
64+
}
65+
6066
.ty-blog-sidebar__link:hover {
6167
color: var(--color-link-hover, #0366d6); /* hover 颜色继承主题,提升兼容性 */
6268
text-decoration: underline;
6369
}
6470

71+
/* 新增:侧边栏链接 hover 时,内部 <strong> 标签也同步变色(可选,提升交互一致性) */
72+
.ty-blog-sidebar__link:hover strong {
73+
color: var(--color-link-hover, #4eaaff);
74+
}
75+
6576
/* 2.3 侧边栏下载按钮列表 - 精准类名,避免覆盖全局 ul
6677
修复:强化列表项居中,手机端无错位 */
6778
.ty-blog-sidebar__downloads {
@@ -195,7 +206,6 @@
195206
}
196207

197208
.ty-blog-sidebar {
198-
width: 100%; /* 侧边栏占满屏幕宽度 */
199209
margin-bottom: 0; /* 配合 gap,无需额外间距 */
200210
/* 修复:手机端侧边栏强制居中,覆盖任何主题样式 */
201211
text-align: center;

0 commit comments

Comments
 (0)