From 9f6940cca9ec021904cd73f8b4019bae4724a4ca Mon Sep 17 00:00:00 2001 From: HenryZeng Date: Mon, 8 Jan 2024 14:36:25 +0800 Subject: [PATCH] =?UTF-8?q?Update=20zhheoblog.css=20+=20fix=20#611=20?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/zhheo/zhheoblog.css | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/templates/assets/zhheo/zhheoblog.css b/templates/assets/zhheo/zhheoblog.css index 6203a3f7..80ca4cae 100644 --- a/templates/assets/zhheo/zhheoblog.css +++ b/templates/assets/zhheo/zhheoblog.css @@ -2218,6 +2218,10 @@ blockquote footer cite::before { margin-top: 1rem; } +#aside-content :only-child > :first-child { + margin-top: 0rem; +} + #aside-content .card-more-btn { float: right; color: inherit; @@ -6803,9 +6807,20 @@ body[data-type=music] .page #nav #site-name span{ } } +/* 保证无card-widget时自动和左侧元素对齐 */ @media screen and (min-width: 1300px) { #aside-content .sticky_layout { - margin-top: 1rem; + margin-top: 0rem; + } +} + +/* 用 :has() 伪类判断card-widget是否存在,进行属性覆写 */ +/* 若存在,表明需要和card-widget保持距离 */ +@media screen and (min-width: 1300px) { + #aside-content:has(+.card-widget) { + #aside-content .sticky_layout { + margin-top: 1rem; + } } } @@ -6814,10 +6829,6 @@ body[data-type=music] .page #nav #site-name span{ transition: top 0s; } -#aside-content .sticky_layout .card-widget:first-child { - margin-top: 0; -} - #aside-content .card-widget:hover { box-shadow: var(--heo-shadow-border); } @@ -9890,8 +9901,13 @@ div#author-info__sayhi:hover { transform: scale(1.1) } -/* 作者卡片背景 */ +/* 选中第一个卡片,与左侧元素对齐 */ #aside-content > .card-widget:first-child { + margin-top: 0px; +} + +/* 作者卡片背景 */ +#aside-content > .card-widget.card-info { transition: 0.3s; border: none; box-shadow: none;