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 {
background: var(--background);
box-shadow: rgba(255, 255, 255, .3) 0px -1px 3px 0px;
box-shadow: none;
}
:global(.dark) .content {

View File

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

View File

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

View File

@@ -26,49 +26,60 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
---
<Layout title={data.title} description={data.summary}>
<h1 class="post-title">{data.title}</h1>
<div class="post">
<h1 class="post-title">{data.title}</h1>
<div class="post-meta">
<div class="published-at">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-calendar-days-icon lucide-calendar-days">
<path d="M8 2v4"/>
<path d="M16 2v4"/>
<rect width="18" height="18" x="3" y="4" rx="2"/>
<path d="M3 10h18"/>
<path d="M8 14h.01"/>
<path d="M12 14h.01"/>
<path d="M16 14h.01"/>
<path d="M8 18h.01"/>
<path d="M12 18h.01"/>
<path d="M16 18h.01"/>
</svg>
{published_at}
<div class="post-meta">
<div class="published-at">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-calendar-days-icon lucide-calendar-days">
<path d="M8 2v4"/>
<path d="M16 2v4"/>
<rect width="18" height="18" x="3" y="4" rx="2"/>
<path d="M3 10h18"/>
<path d="M8 14h.01"/>
<path d="M12 14h.01"/>
<path d="M16 14h.01"/>
<path d="M8 18h.01"/>
<path d="M12 18h.01"/>
<path d="M16 18h.01"/>
</svg>
{published_at}
</div>
<div class="post-view">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="5122">
<path
d="M509.618 415.795c-42.695 0-77.253 38.372-77.253 85.738 0 47.352 34.558 86.22 77.253 86.22 42.667 0 76.716-38.867 76.716-86.22 0-47.352-34.049-85.738-76.716-85.738z m1.9-177.9c-211.548 0-383.265 159.859-383.265 274.587 0 114.727 171.717 273.624 383.266 273.624 212.484 0 384.227-162.522 384.227-273.624 0-111.088-171.743-274.587-384.227-274.587z m-1.446 452.006c-89.7 0-162.134-81.71-162.134-181.903 0-101.157 72.435-182.397 162.134-182.397 90.183 0 163.1 81.241 163.1 182.397 0 100.206-72.917 181.903-163.1 181.903z"
p-id="5123"></path>
</svg>
{data.view}
</div>
</div>
<div class="post-view">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="5122">
<path
d="M509.618 415.795c-42.695 0-77.253 38.372-77.253 85.738 0 47.352 34.558 86.22 77.253 86.22 42.667 0 76.716-38.867 76.716-86.22 0-47.352-34.049-85.738-76.716-85.738z m1.9-177.9c-211.548 0-383.265 159.859-383.265 274.587 0 114.727 171.717 273.624 383.266 273.624 212.484 0 384.227-162.522 384.227-273.624 0-111.088-171.743-274.587-384.227-274.587z m-1.446 452.006c-89.7 0-162.134-81.71-162.134-181.903 0-101.157 72.435-182.397 162.134-182.397 90.183 0 163.1 81.241 163.1 182.397 0 100.206-72.917 181.903-163.1 181.903z"
p-id="5123"></path>
</svg>
{data.view}
</div>
<div
class="markdown-body"
data-color-mode="dark"
set:html={content}
></div>
</div>
<div
class="post markdown-body"
data-color-mode="dark"
set:html={content}
></div>
</Layout>
<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 {
margin-bottom: 16px;
font-size: 24px;
font-size: 32px;
}
.post-meta {
@@ -91,17 +102,10 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
height: 18px;
}
.post {
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) {
:global(.markdown-body img) {
object-fit: contain;
height: auto !important;
border-radius: 8px;
}
.post-view {
@@ -131,8 +135,9 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
}
:global(.dark) .post {
background: #090b0c;
box-shadow: rgba(255, 255, 255, 0.5) 0 0px 10px -4px;
background: #171717;
box-shadow: none;
border: none;
}
</style>

View File

@@ -132,7 +132,7 @@
margin: 0;
font-weight: var(--base-text-weight-normal, 400);
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-size: 16px;
line-height: 1.5;

View File

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