hexo-theme-halunhaku
Version:
A modern, responsive Hexo theme with enhanced code blocks, perfect cover images, and Chinese text optimization. Production-ready with mobile-first design.
103 lines (90 loc) • 2.36 kB
CSS
/* 中文字符显示优化 */
/* 全局中文字符优化 */
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
/* 标题行高修复 - 确保中文字符完整显示 */
h1, h2, h3, h4, h5, h6,
.text-xl, .text-2xl, .text-3xl, .text-4xl, .text-5xl, .text-6xl {
line-height: 1.4 ;
padding-top: 0.1em ;
padding-bottom: 0.1em ;
min-height: 1.4em ;
}
/* 文章页面标题特殊处理 */
.post-title,
article > header h1,
main h1 {
line-height: 1.5 ;
padding-top: 0.15em ;
padding-bottom: 0.15em ;
min-height: 1.5em ;
display: block ;
overflow: visible ;
}
/* 首页文章卡片标题 */
.post-card h2,
article.group h2 {
line-height: 1.4 ;
padding-top: 0.1em ;
padding-bottom: 0.1em ;
min-height: 1.4em ;
display: block ;
overflow: visible ;
}
/* 修复Tailwind的leading类 */
.leading-tight {
line-height: 1.3 ;
}
.leading-snug {
line-height: 1.4 ;
}
.leading-normal {
line-height: 1.5 ;
}
/* 确保渐变文字也能正确显示 */
.bg-clip-text {
-webkit-background-clip: text ;
background-clip: text ;
line-height: 1.5 ;
padding-top: 0.1em ;
padding-bottom: 0.1em ;
}
/* 中文字符断行优化 */
h1, h2, h3, h4, h5, h6 {
word-break: keep-all ;
overflow-wrap: break-word ;
hyphens: none ;
}
/* 防止字符被裁剪 */
* {
box-sizing: border-box;
overflow: visible;
}
/* 特殊情况:超长标题的处理 */
@media (max-width: 768px) {
h1, h2, h3 {
line-height: 1.3 ;
word-break: break-all ;
overflow-wrap: break-word ;
}
}
/* 确保容器有足够高度 */
.prose h1,
.prose-lg h1,
.prose h2,
.prose-lg h2,
.prose h3,
.prose-lg h3 {
min-height: auto ;
height: auto ;
overflow: visible ;
}
/* 修复可能的容器高度限制 */
header, .header, .post-header {
overflow: visible ;
height: auto ;
min-height: auto ;
}