feat: 样式调整

This commit is contained in:
2026-07-18 21:03:04 +08:00
parent ed73a3fe72
commit f77f8d13d1
6 changed files with 58 additions and 53 deletions

View File

@@ -32,7 +32,7 @@
:global(.dark) footer { :global(.dark) footer {
background: var(--background); background: var(--background);
box-shadow: rgba(255, 255, 255, .3) 0px -1px 3px 0px; box-shadow: none;
} }
:global(.dark) .content { :global(.dark) .content {

View File

@@ -84,7 +84,7 @@ import ThemeIcon from './ThemeIcon.astro'
:global(.dark) header { :global(.dark) header {
background: var(--background); background: var(--background);
box-shadow: rgba(255, 255, 255, .3) 0px 1px 2px 0px; box-shadow: none;
} }
:global(.dark) .main-nav h1 { :global(.dark) .main-nav h1 {

View File

@@ -151,7 +151,7 @@ posts.map((post) => {
} }
:global(.dark) .post { :global(.dark) .post {
background: #1f2937; background: #171717;
} }
:global(.dark) .published-at { :global(.dark) .published-at {
@@ -159,6 +159,7 @@ posts.map((post) => {
} }
:global(.dark) .category-name { :global(.dark) .category-name {
background: #374151; background: #e5e5e5;
color: #0a0a0a;
} }
</style> </style>

View File

@@ -26,6 +26,7 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
--- ---
<Layout title={data.title} description={data.summary}> <Layout title={data.title} description={data.summary}>
<div class="post">
<h1 class="post-title">{data.title}</h1> <h1 class="post-title">{data.title}</h1>
<div class="post-meta"> <div class="post-meta">
@@ -59,16 +60,26 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
</div> </div>
<div <div
class="post markdown-body" class="markdown-body"
data-color-mode="dark" data-color-mode="dark"
set:html={content} set:html={content}
></div> ></div>
</div>
</Layout> </Layout>
<style> <style>
.post {
background: #fff;
border-radius: 12px;
overflow: auto;
padding: 24px;
box-shadow: rgba(149, 157, 165, 0.2) 0 2px 14px -4px;
border: 1px solid #e7e8ec;
}
.post-title { .post-title {
margin-bottom: 16px; margin-bottom: 16px;
font-size: 24px; font-size: 32px;
} }
.post-meta { .post-meta {
@@ -91,17 +102,10 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
height: 18px; height: 18px;
} }
.post { :global(.markdown-body img) {
background: #fff;
border-radius: 16px;
overflow: auto;
padding: 24px;
box-shadow: rgba(149, 157, 165, 0.2) 0 2px 14px -4px;
}
:global(.post.markdown-body img) {
object-fit: contain; object-fit: contain;
height: auto !important; height: auto !important;
border-radius: 8px;
} }
.post-view { .post-view {
@@ -131,8 +135,9 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
} }
:global(.dark) .post { :global(.dark) .post {
background: #090b0c; background: #171717;
box-shadow: rgba(255, 255, 255, 0.5) 0 0px 10px -4px; box-shadow: none;
border: none;
} }
</style> </style>

View File

@@ -132,7 +132,7 @@
margin: 0; margin: 0;
font-weight: var(--base-text-weight-normal, 400); font-weight: var(--base-text-weight-normal, 400);
color: var(--fgColor-default); color: var(--fgColor-default);
background-color: var(--bgColor-default); /*background-color: var(--bgColor-default);*/
font-family: var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"); font-family: var(--fontStack-sansSerif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");
font-size: 16px; font-size: 16px;
line-height: 1.5; line-height: 1.5;

View File

@@ -13,12 +13,12 @@
html, html,
body { body {
width: 100%; width: 100%;
height: 100%; min-height: 100vh;
font-size: 16px; font-size: 16px;
} }
html { html {
background: #fafafa; background: #f8fafc;
} }
html.dark { html.dark {
@@ -26,7 +26,6 @@ html.dark {
color: #fff; color: #fff;
} }
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;