Skip to content

Commit e68618f

Browse files
committed
拆除tailwind 优化排版
(全局引入tailwind完全是疏忽导致的()
1 parent 160c3b8 commit e68618f

File tree

10 files changed

+95
-260
lines changed

10 files changed

+95
-260
lines changed

astro.config.mjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// @ts-check
22
import { defineConfig, envField } from "astro/config";
33

4-
import tailwindcss from "@tailwindcss/vite";
5-
64
// https://astro.build/config
75
export default defineConfig({
86
site: "https://linglambda.github.io",
@@ -11,18 +9,16 @@ export default defineConfig({
119
//悬停预加载
1210
prefetch: true,
1311

14-
vite: {
15-
plugins: [tailwindcss()],
16-
},
12+
vite: {},
1713
env: {
1814
schema: {
1915
PATH_MODULE: envField.enum({
20-
values:['no_change','pinyin','pinyin_with_tones'],
21-
default: 'pinyin',
16+
values: ["no_change", "pinyin", "pinyin_with_tones"],
17+
default: "pinyin",
2218
optional: false,
2319
context: "server",
2420
access: "secret",
25-
}),
21+
}),
2622
},
2723
},
2824
});

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@
1010
"astro": "astro"
1111
},
1212
"dependencies": {
13-
"@tailwindcss/vite": "^4.1.1",
1413
"astro": "^5.5.4",
1514
"astro-seo": "^0.8.4",
16-
"pinyin-pro": "^3.26.0",
17-
"tailwindcss": "^4.1.1"
15+
"pinyin-pro": "^3.26.0"
1816
},
19-
"devDependencies": {
20-
"@tailwindcss/typography": "^0.5.16"
21-
}
17+
"devDependencies": {}
2218
}

src/components/Prose.astro

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
---
2-
// markdown样式 使用Tailwind
2+
import "../styles/markdown.css";
33
---
44

5-
<div
6-
class="prose dark:prose-invert
7-
prose-h1:font-bold prose-h1:text-xl
8-
prose-a:text-blue-600 prose-p:text-justify prose-img:rounded-xl
9-
prose-headings:underline"
10-
>
5+
<div class="prose">
116
<slot />
127
</div>
13-
<!-- 用法: prose-[element]:class-to-apply 给所有的 <h1> 标签添加 font-bold 的 Tailwind 类。 -->

src/layouts/BaseLayout.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ const { description, keywords ,selected} = Astro.props;
102102
}
103103

104104
main {
105+
max-width: 65ch;
105106
flex-grow: 1; /* 使 main 占据剩余空间 */
107+
font-size: 1rem;
108+
line-height: 1.75;
106109
}
107110

108111
footer {

src/layouts/BlogLayout.astro

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
22
import BaseLayout from "./BaseLayout.astro";
3-
4-
53
---
4+
65
<BaseLayout>
76
<section>
87
<slot />
98
</section>
109
</BaseLayout>
1110

1211
<style>
13-
14-
section {
15-
padding: 0 8%;
12+
section {
13+
max-width: 65ch;
14+
padding: 0;
1615
/* padding:8% */
1716
}
18-
</style>
17+
</style>

src/layouts/MainLayout.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
import BaseLayout from "./BaseLayout.astro";
3-
4-
53
---
4+
65
<BaseLayout>
76
<slot />
87
</BaseLayout>
98

109
<style>
11-
</style>
10+
</style>

src/posts/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ title: about
66

77
编程爱好者,支持开源与自由软件运动,最喜欢的语言是rust ~~但不太擅长~~,最擅长的语言是Java,还会写一点kt,ts,c,lua,能够写一点前端。为了做更多好玩的东西而卖力的学习着。想当高手,梦想着能做出有创造型的开源项目。
88

9-
兴趣驱动型人类,对一个东西有兴趣会拼命地去了解,折腾 **** 单片机,树莓派,X86硬件DIY,客制化键盘,服务器,软路由,ArchLinux,YOLO,剪辑,游戏开发,游戏模组,QQ机器人…… 最早是因为nonebot入坑开源的。
9+
兴趣驱动型,对一个东西有兴趣会拼命地去了解,折腾 **** 单片机,树莓派,X86硬件DIY,客制化键盘,服务器,软路由,ArchLinux,YOLO,剪辑,游戏开发,游戏模组,QQ机器人…… 最早是因为nonebot入坑开源的。
1010

11-
比较开放和包容的一个人类
11+
比较开放和包容的一只Tac
1212

1313
<!-- 这里没有夹带私货 -->

src/styles/global.css

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
1-
@import "tailwindcss";
2-
@plugin '@tailwindcss/typography';
1+
*,
2+
::after,
3+
::before,
4+
::backdrop {
5+
box-sizing: border-box;
6+
border: 0 solid;
7+
margin: 0;
8+
padding: 0;
9+
}
10+
html {
11+
color: #374151;
12+
font-family: var(
13+
--default-font-family,
14+
ui-sans-serif,
15+
system-ui,
16+
-apple-system,
17+
BlinkMacSystemFont,
18+
"Segoe UI",
19+
Roboto,
20+
"Helvetica Neue",
21+
Arial,
22+
"Noto Sans",
23+
sans-serif,
24+
"Apple Color Emoji",
25+
"Segoe UI Emoji",
26+
"Segoe UI Symbol",
27+
"Noto Color Emoji"
28+
);
29+
}
30+
31+
img,
32+
video {
33+
max-width: 100%;
34+
height: auto;
35+
margin-top: 2em;
36+
margin-bottom: 2em;
37+
display: block;
38+
}
39+
40+
p {
41+
text-align: justify;
42+
}
43+
44+
a {
45+
color: unset;
46+
}

src/styles/markdown.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.prose {
2+
line-height: 1.75;
3+
}
4+
5+
.prose h1,
6+
h2,
7+
h3,
8+
h4,
9+
h5,
10+
h6 {
11+
margin-bottom: 1em;
12+
}
13+
14+
.prose h2 {
15+
line-height: 1.33333;
16+
}
17+
18+
.prose p {
19+
margin-top: 1.25em;
20+
margin-bottom: 1.25em;
21+
}
22+
23+
.prose p:first-of-type {
24+
margin-top: 0;
25+
}
26+
27+
.prose p:last-of-type {
28+
margin-bottom: 0;
29+
}

0 commit comments

Comments
 (0)