Skip to content

Commit 68ac129

Browse files
committed
update css
1 parent 0561324 commit 68ac129

2 files changed

Lines changed: 99 additions & 3 deletions

File tree

src/pages/blog/[...slug].astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ function renderInlineCode(input: string) {
7676

7777
<BaseLayout title={post.data.title} description={post.data.description} containerClass="max-w-6xl">
7878
<div class="lg:grid lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-10">
79-
<article class="prose prose-zinc prose-lg dark:prose-invert max-w-none">
79+
<article class="openai-prose mx-auto w-full max-w-[46rem] min-w-0">
8080
<div class="not-prose mb-8 space-y-3">
8181
<a
8282
href="/"
8383
class="text-sm text-zinc-600 no-underline hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
8484
>
8585
← Back
8686
</a>
87-
<h1 class="mb-0 text-[32px] font-semibold tracking-tight">
87+
<h1 class="mb-0 text-[40px] leading-[1.1] font-semibold tracking-tight">
8888
<span set:html={renderInlineCode(post.data.title)} />
8989
</h1>
9090
<div class="text-base text-zinc-600 dark:text-zinc-400">{formattedDate}</div>
@@ -203,7 +203,7 @@ function renderInlineCode(input: string) {
203203
</script>
204204

205205
<aside class="hidden lg:block">
206-
<div class="sticky top-24 max-h-[calc(100vh-8rem)] overflow-auto">
206+
<div class="sticky top-24 max-h-[calc(100vh-8rem)] overflow-auto border-l border-zinc-200 pl-6 dark:border-zinc-800">
207207
<div class="text-sm font-semibold text-zinc-700 dark:text-zinc-50">Table of content</div>
208208
{toc.length > 0 ? (
209209
<nav class="mt-3">

src/styles/global.css

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,102 @@
5959
.prose :where(h2[id], h3[id], h4[id], h5[id], h6[id]):hover {
6060
@apply underline decoration-zinc-300 underline-offset-4 dark:decoration-zinc-700;
6161
}
62+
63+
.openai-prose {
64+
@apply prose prose-zinc dark:prose-invert;
65+
}
66+
67+
.openai-prose {
68+
font-size: 17px;
69+
line-height: 1.75;
70+
}
71+
72+
.openai-prose :where(p):not(:where(.not-prose, .not-prose *)) {
73+
margin-top: 1.1em;
74+
margin-bottom: 1.1em;
75+
}
76+
77+
.openai-prose :where(h1):not(:where(.not-prose, .not-prose *)) {
78+
@apply tracking-tight;
79+
font-size: 40px;
80+
line-height: 1.1;
81+
margin-top: 0;
82+
margin-bottom: 0.6em;
83+
}
84+
85+
.openai-prose :where(h2):not(:where(.not-prose, .not-prose *)) {
86+
@apply tracking-tight;
87+
font-size: 28px;
88+
line-height: 1.2;
89+
margin-top: 1.6em;
90+
margin-bottom: 0.6em;
91+
}
92+
93+
.openai-prose :where(h3):not(:where(.not-prose, .not-prose *)) {
94+
@apply tracking-tight;
95+
font-size: 22px;
96+
line-height: 1.25;
97+
margin-top: 1.4em;
98+
margin-bottom: 0.5em;
99+
}
100+
101+
.openai-prose :where(ul, ol):not(:where(.not-prose, .not-prose *)) {
102+
margin-top: 1em;
103+
margin-bottom: 1em;
104+
}
105+
106+
.openai-prose :where(li):not(:where(.not-prose, .not-prose *)) {
107+
margin-top: 0.35em;
108+
margin-bottom: 0.35em;
109+
}
110+
111+
.openai-prose :where(a):not(:where(.not-prose, .not-prose *)) {
112+
@apply no-underline;
113+
border-bottom: 1px solid rgb(212 212 216);
114+
transition: border-color 150ms ease, color 150ms ease;
115+
}
116+
117+
.openai-prose :where(a:hover):not(:where(.not-prose, .not-prose *)) {
118+
border-bottom-color: rgb(24 24 27);
119+
}
120+
121+
.openai-prose :where(.dark a):not(:where(.not-prose, .not-prose *)) {
122+
border-bottom-color: rgb(82 82 91);
123+
}
124+
125+
.openai-prose :where(.dark a:hover):not(:where(.not-prose, .not-prose *)) {
126+
border-bottom-color: rgb(244 244 245);
127+
}
128+
129+
.openai-prose :where(pre):not(:where(.not-prose, .not-prose *)) {
130+
@apply rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-800 dark:bg-zinc-950;
131+
padding: 16px;
132+
overflow-x: auto;
133+
}
134+
135+
.openai-prose :where(pre code):not(:where(.not-prose, .not-prose *)) {
136+
background: transparent;
137+
padding: 0;
138+
border-radius: 0;
139+
font-size: 0.9em;
140+
color: inherit;
141+
}
142+
143+
.openai-prose :where(blockquote):not(:where(.not-prose, .not-prose *)) {
144+
@apply rounded-xl border border-zinc-200 bg-zinc-50 px-5 py-4 text-zinc-700 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-200;
145+
border-left-width: 4px;
146+
border-left-color: rgb(161 161 170);
147+
}
148+
149+
.openai-prose :where(hr):not(:where(.not-prose, .not-prose *)) {
150+
@apply border-zinc-200 dark:border-zinc-800;
151+
margin-top: 2em;
152+
margin-bottom: 2em;
153+
}
154+
155+
.openai-prose :where(img):not(:where(.not-prose, .not-prose *)) {
156+
@apply rounded-2xl;
157+
}
62158
}
63159

64160
@layer base {

0 commit comments

Comments
 (0)