From a08afffea5e614c2ecb795ca6da7cff109ddcb19 Mon Sep 17 00:00:00 2001 From: sendevia Date: Mon, 5 Jan 2026 01:41:03 +0800 Subject: [PATCH] feat(Article): improve layout and styling of article header and description --- .vitepress/theme/layouts/Article.vue | 8 ++- .vitepress/theme/styles/layouts/Article.scss | 57 +++++++++++++++----- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/.vitepress/theme/layouts/Article.vue b/.vitepress/theme/layouts/Article.vue index 73efd8b..dc02584 100644 --- a/.vitepress/theme/layouts/Article.vue +++ b/.vitepress/theme/layouts/Article.vue @@ -261,8 +261,12 @@ if (isClient()) {

{{ frontmatter.title || page.title }}

-
{{ frontmatter.description }}
-
+
+
+
+ {{ frontmatter.description }} +
+
diff --git a/.vitepress/theme/styles/layouts/Article.scss b/.vitepress/theme/styles/layouts/Article.scss index dadeb7b..3a32cd3 100644 --- a/.vitepress/theme/styles/layouts/Article.scss +++ b/.vitepress/theme/styles/layouts/Article.scss @@ -11,24 +11,55 @@ main#article-content { } > hgroup { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + gap: 12px; + position: relative; - width: max-content; + width: 100%; + + margin-block-end: 24px; h1 { @include mixin.typescale-style("display-large"); + + text-align: center; } - h6::before { - @include mixin.material-symbols($name: "message", $size: 18); + div { + display: flex; + align-items: center; + flex-direction: row; + flex-wrap: wrap; + gap: 6px; - margin-inline-end: 3px; + width: 100%; - vertical-align: middle; - } + hr { + flex-grow: 1; - hr { - margin-block-start: 3px; + margin: 0px; + } + + h6 { + display: grid; + align-items: start; + gap: 6px; + grid-template-columns: max-content auto; + + width: max-content; + + line-height: 18px; + text-align: justify; + + &::before { + @include mixin.material-symbols($name: "message", $size: 18); + + vertical-align: middle; + } + } } } } @@ -353,6 +384,10 @@ main#article-content { padding-block-end: 0px; } + &:first-child .title-with-achor { + margin-block-start: 0px; + } + .title-with-achor { h1, h2, @@ -829,12 +864,6 @@ div#article-beside { main#article-content { grid-column: 1 / 7; - > hgroup { - width: 100%; - - text-align: center; - } - .custom-block > * { grid-column: 1 / 3; }