feat(frontend): align single post page 1:1 with Zibll

Restore Zibll float dual-column shell, fix single settings DTO key mapping,
reorder article footer/actions, and match author bar, prev/next, title/body
typography, and limit-height expand UX.
This commit is contained in:
kate522 committed 2026-07-13 08:26:36 +08:00
1 parent a651bd6d2d
commit 5ae1a9ad93
12 files changed
+626 -218

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
@import url("single-post/shell.css");
@import url("single-post/content.css");
@import url("single-post/code-blocks.css");
@import url("single-post/navigation.css");
@@ -440,3 +440,103 @@ html.dark .post-drop-meta__item:hover {
.author-box__posts a:hover { color: var(--color-primary); }
.author-box__posts a::before { content: '\2022'; color: var(--color-primary); }
/* ===== Zibll single-metabox / author bar ===== */
.article-avatar .user-info {
width: 100%;
}
.article-avatar .avatar-img img,
.article-avatar .avatar {
width: 42px;
height: 42px;
border-radius: 50%;
object-fit: cover;
}
.article-avatar .display-name {
font-weight: 600;
color: var(--key-color, #333);
}
.article-header .article-avatar .relative {
margin-top: 20px;
}
.single-metabox {
right: 0;
font-size: 15px;
--meta-color: var(--muted-color, #777);
}
.single-metabox .post-metas {
background: var(--body-bg-color, #f5f5f5);
right: 0;
padding: 2px 6px;
border-radius: 100px;
color: var(--meta-color);
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 0;
}
.single-metabox .post-metas item {
margin: 0 6px;
font-size: 13px;
}
.single-metabox .post-drop-meta {
position: relative;
display: inline-block;
}
.single-metabox.cover-meta {
font-size: 14px;
right: 1em;
top: 1.6em;
--meta-color: rgba(255, 255, 255, 0.8);
--body-bg-color: rgba(0, 0, 0, 0.3);
}
.line-form-line {
display: block;
height: 1px;
background: var(--main-border-color, rgba(50,50,50,.06));
margin: 12px 0 0;
}
.post-actions {
padding-bottom: 15px;
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 10px;
}
.post-actions .action {
min-width: 3.2em;
height: 3.2em;
border-radius: 100px;
border: 0;
background: var(--muted-bg-color, #f2f2f2);
color: var(--muted-color, #777);
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 0 14px;
cursor: pointer;
transition: .15s;
}
.post-actions .action:hover,
.post-actions .action.is-active {
color: var(--focus-color, #f04494);
background: var(--focus-color-opacity1, rgba(240,68,148,.1));
}
.post-actions .action i {
font-size: 16px;
}
+63 -12
View File
@@ -1,20 +1,31 @@
/* ========== Single Post ========== */
.entry-header,
.article-header {
margin-bottom: 28px;
padding-bottom: 18px;
border-bottom: 1px solid var(--color-line-soft);
margin-bottom: 10px;
padding-bottom: 0;
border-bottom: none;
}
/* 标题 — 对齐 zibll: 22px, bold, line-height 1.4 */
.entry-title,
.article-title {
font-size: 28px;
font-weight: 700;
margin: 0 0 18px;
line-height: 1.35;
letter-spacing: -0.01em;
color: var(--color-ink);
font-size: 22px;
font-weight: bold;
margin: 0;
line-height: 1.4;
letter-spacing: 0;
color: var(--key-color, var(--color-ink));
}
.article-header .article-title {
font-size: 22px;
font-weight: bold;
color: var(--key-color, var(--color-ink));
margin-top: 15px;
}
.article-header .article-avatar {
margin-top: 15px;
}
.entry-meta {
@@ -40,15 +51,55 @@
}
/* 内容区 — 对齐 zibll: 16px, line-height 2 */
.entry-content {
.entry-content,
.wp-posts-content {
font-size: 16px;
line-height: 1.95;
color: var(--color-ink);
line-height: 2;
color: var(--main-color, var(--color-ink));
overflow-wrap: break-word;
word-wrap: break-word;
min-height: 90px;
}
/* Zibll content heading bars */
.wp-posts-content > h1:not([class]),
.wp-posts-content > h2:not([class]),
.wp-posts-content > h3:not([class]),
.wp-posts-content > h4:not([class]),
.wp-posts-content > h1.wp-block-heading,
.wp-posts-content > h2.wp-block-heading,
.wp-posts-content > h3.wp-block-heading,
.wp-posts-content > h4.wp-block-heading {
position: relative;
padding-bottom: 8px;
}
.wp-posts-content > h1:not([class]):before,
.wp-posts-content > h2:not([class]):before,
.wp-posts-content > h3:not([class]):before,
.wp-posts-content > h4:not([class]):before,
.wp-posts-content > h1.wp-block-heading:before,
.wp-posts-content > h2.wp-block-heading:before,
.wp-posts-content > h3.wp-block-heading:before,
.wp-posts-content > h4.wp-block-heading:before {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 40px;
height: 3px;
background: var(--theme-color, var(--focus-color, #f04494));
border-radius: 5px;
}
.wp-posts-content > h3:not([class]):before,
.wp-posts-content > h4:not([class]):before,
.wp-posts-content > h3.wp-block-heading:before,
.wp-posts-content > h4.wp-block-heading:before {
width: 28px;
height: 2px;
}
.entry-content > *:first-child {
margin-top: 0;
}
@@ -1,3 +1,47 @@
/* ===== Zibll article-nav (prev/next) ===== */
.article-nav {
display: block;
width: 100%;
}
.article-nav .box-body {
width: calc(50% - 7px);
margin: 0;
display: inline-block;
vertical-align: top;
}
.article-nav .box-body + .box-body {
margin-right: 0;
float: right;
text-align: right;
}
.article-nav a {
display: block;
color: inherit;
text-decoration: none;
}
.article-nav a:hover {
color: var(--focus-color, #f04494);
}
.article-nav .text-ellipsis-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 14px;
line-height: 1.5;
color: var(--key-color, #333);
}
.article-nav p {
margin: 0 0 6px;
font-size: 12px;
}
/* ===== Previous / Next Navigation ===== */
.post-nav-box {
display: grid;
@@ -112,12 +156,45 @@
/* ===== Comment Card Spacing ===== */
.comments-card { margin-bottom: 16px; }
/* ===== Content Height Clamp ===== */
/* ===== Content Height Clamp (Zibll) ===== */
.limit-height,
.wp-posts-content.limit-height {
position: relative;
overflow: hidden;
}
.limit-height .read-more {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
background-image: linear-gradient(0deg, var(--main-bg-color, #fff) 70px, rgba(255, 255, 255, 0) 100%);
animation: lazy_fade 0.5s;
z-index: 80;
}
html.dark .limit-height .read-more,
body.dark-theme .limit-height .read-more {
background-image: linear-gradient(0deg, var(--main-bg-color, #2a2a2a) 70px, rgba(53, 54, 55, 0) 100%);
}
.limit-height .read-more a,
.limit-height .read-more .read-more-open {
padding: 25px 0;
display: inline-block;
color: var(--focus-color, #f04494);
margin-top: 80px;
cursor: pointer;
background: none;
border: 0;
font-size: 14px;
}
@keyframes lazy_fade {
from { opacity: 0; }
to { opacity: 1; }
}
.wp-posts-content.limit-height::after {
content: '';
position: absolute;
+59
View File
@@ -0,0 +1,59 @@
/* Single page shell — Zibll float dual-column (scoped to body.single) */
body.single .container {
position: relative;
}
body.single .content-wrap {
float: left;
width: 100%;
}
/* Clear floats after main dual-column shell */
body.single main.container::after {
content: "";
display: table;
clear: both;
}
/* Default: no sidebar full width */
body.single.container--no-sidebar .content-layout,
body.single .container--no-sidebar .content-layout,
body.single main.container--no-sidebar .content-layout {
margin-right: 0;
}
/* Zibll site-layout-2: content left, sidebar right (311px) */
@media (min-width: 992px) {
body.single:not(.no-sidebar) main.container:not(.container--no-sidebar) .content-layout {
margin-right: calc(var(--sidebar-width, 311px) + 15px);
}
body.single:not(.no-sidebar) main.container:not(.container--no-sidebar) > .sidebar {
float: left;
width: var(--sidebar-width, 311px);
margin-left: calc(0px - var(--sidebar-width, 311px));
position: relative;
}
}
@media (max-width: 991.98px) {
body.single main.container > .sidebar {
display: none;
}
body.single main.container .content-layout {
margin-right: 0 !important;
}
}
/* Sidebar widgets spacing */
body.single .sidebar .zib-widget,
body.single .sidebar .widget {
margin-bottom: 15px;
}
body.single .sidebar .posts-nav-box.toc-widget {
position: sticky;
top: calc(var(--nav-height, 60px) + 16px);
}