diff options
| author | Eltrac <hi@guhub.cn> | 2025-07-15 16:58:55 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-07-15 16:58:55 +0800 |
| commit | 4f5cd04a00f233059fb837d1e997006be8576ec9 (patch) | |
| tree | 2f875a86b84962d830087cbced97794defc416ee | |
| parent | ef16dffd81595af3bc03efea78d45032d0b467a2 (diff) | |
refactor: replace _comment.scss with UnoCSS
| -rw-r--r-- | assets/css/components/_comment.scss | 50 | ||||
| -rw-r--r-- | assets/css/content.scss | 1 | ||||
| -rw-r--r-- | layouts/_partials/posts/comment.html | 19 |
3 files changed, 10 insertions, 60 deletions
diff --git a/assets/css/components/_comment.scss b/assets/css/components/_comment.scss deleted file mode 100644 index 47007d4e..00000000 --- a/assets/css/components/_comment.scss +++ /dev/null @@ -1,50 +0,0 @@ -.post-comments { - .static-comments { - margin: 2rem 0; - .static-comments-heading { - color: var(--secondary-text-color) - } - .static-comments-item { - font-size: 1.2rem; - border-bottom: 1px solid #ccc; - padding: 1rem 0.25rem; - .static-comments-item-header { - margin-bottom: 1rem; - display: flex; - justify-content: space-between; - .comment-author { - font-weight: bold; - } - .comment-date { - color: var(--secondary-text-color); - } - } - .static-comments-item-footer { - font-size: 1rem; - text-align: right; - color: var(--secondary-text-color); - } - } - } - - .giscus { - margin: 1rem 0 - } -} - -.links-container { - text-align: center; - display: flex; - justify-content: center; - gap: 0.5rem; - a { - @include small-button; - font-size: .9rem; - display: inline-flex; - align-items: center; - gap: 0.25rem; - img { - width: 1rem; - } - } -} diff --git a/assets/css/content.scss b/assets/css/content.scss index 65a4339c..f671b23d 100644 --- a/assets/css/content.scss +++ b/assets/css/content.scss @@ -2,7 +2,6 @@ @import "components/post"; @import "components/post-tabs"; -@import "components/comment"; @import "libraries/littlefoot"; @import "libraries/fancybox"; diff --git a/layouts/_partials/posts/comment.html b/layouts/_partials/posts/comment.html index 804570bc..18bc479a 100644 --- a/layouts/_partials/posts/comment.html +++ b/layouts/_partials/posts/comment.html @@ -1,17 +1,18 @@ <div class="post-comments"> {{ with .Params.comments }} - <div class="static-comments"> - <p class="static-comments-heading">{{ T "postPage.staticCommentsSectionHeader" }}</p> + <!-- Static Comments --> + <div class="my-8"> + <p class="font-secondary">{{ T "postPage.staticCommentsSectionHeader" }}</p> {{ range . }} - <div class="static-comments-item"> - <div class="static-comments-item-header"> - <span class="comment-author">{{ .name }}</span> - <span class="comment-date font-mono">{{ .date }}</span> + <div class="text-xl border-b border-solid border-[#ccc] py-4 px-1"> + <div class="mb-4 flex justify-between"> + <span class="font-bold">{{ .name }}</span> + <span class="font-secondary">{{ .date }}</span> </div> - <div class="static-comments-item-content"> + <div> {{ .content | safeHTML }} </div> - <div class="static-comments-item-footer"> + <div class="text-[1rem] text-right font-secondary"> {{ with .source }} <p class="font-mono">{{ T "postPage.originallyPostedOn" . }}</p> {{ end }} @@ -20,7 +21,7 @@ {{ end }} </div> {{ end }} - <div class="giscus"> + <div class="giscus my-4"> <p style="text-align:center"> {{ T "postPage.commentNotLoaded" }} </p> |
