Skip to content

Commit 60d53ec

Browse files
authored
fix: overview page style (#229)
1 parent fb83f5d commit 60d53ec

File tree

3 files changed

+60
-27
lines changed

3 files changed

+60
-27
lines changed

.changeset/short-pillows-learn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/doom": patch
3+
---
4+
5+
fix: overview page style

packages/doom/src/runtime/components/Overview.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -230,24 +230,28 @@ export function Overview(props: {
230230
<h3>
231231
<Link href={item.link} {...renderInlineMarkdown(item.text)} />
232232
</h3>
233-
<div className={classes.overviewDescription}>
234-
{item.description}
235-
</div>
236-
<ul className={classes.overviewList}>
237-
{item.headers?.map((header) => (
238-
<li
239-
key={header.id}
240-
className={`${classes.overviewGroupLi} ${
241-
classes[`level${header.depth}`]
242-
}`}
243-
>
244-
<Link
245-
href={`${item.link}#${header.id}`}
246-
{...renderInlineMarkdown(header.text)}
247-
/>
248-
</li>
249-
))}
250-
</ul>
233+
{item.description && (
234+
<div className={classes.overviewDescription}>
235+
{item.description}
236+
</div>
237+
)}
238+
{!item.headers?.length || (
239+
<ul className={classes.overviewList}>
240+
{item.headers.map((header) => (
241+
<li
242+
key={header.id}
243+
className={`${classes.overviewGroupLi} ${
244+
classes[`level${header.depth}`]
245+
}`}
246+
>
247+
<Link
248+
href={`${item.link}#${header.id}`}
249+
{...renderInlineMarkdown(header.text)}
250+
/>
251+
</li>
252+
))}
253+
</ul>
254+
)}
251255
</div>
252256
))}
253257
</div>

packages/doom/styles/overview.module.scss

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
:global .overview-index.doom-overview-index {
2-
margin-left: auto;
3-
margin-right: auto;
4-
padding-left: 0;
5-
padding-right: 0;
2+
h2 {
3+
letter-spacing: -0.02em;
4+
color: var(--rp-c-text-1);
5+
border-top: 1px solid var(--rp-c-divider-light);
6+
margin: 36px 0;
7+
padding-top: 36px;
8+
font-size: 24px;
9+
transition: color 0.5s;
10+
11+
&:first-child:before {
12+
display: none;
13+
}
14+
}
15+
16+
h3 > a {
17+
margin: 0;
18+
line-height: 1.3;
19+
letter-spacing: -0.01em;
20+
color: var(--rp-c-link);
21+
font-size: 18px;
22+
font-weight: 600;
23+
transition: color 0.5s;
24+
}
625

7-
h2:first-child:before {
8-
display: none;
26+
h2,
27+
h3 {
28+
line-height: 1;
929
}
1030

1131
.rp-link:hover {
@@ -15,7 +35,7 @@
1535

1636
.overview-list {
1737
list-style: none;
18-
margin: 0;
38+
margin-bottom: 0;
1939
padding-left: 0;
2040
}
2141

@@ -60,15 +80,19 @@
6080

6181
.overview-group {
6282
break-inside: avoid;
63-
margin-bottom: 28px;
83+
margin-bottom: 16px;
6484
background-color: var(--rp-c-bg-soft);
6585
border-radius: var(--rp-radius);
66-
padding: 28px 32px;
86+
padding: 24px;
6787
transition: background-color 0.5s;
6888

6989
h3 {
7090
margin-top: 0;
7191
margin-bottom: 8px;
92+
93+
&:last-child {
94+
margin-bottom: 0;
95+
}
7296
}
7397
}
7498

0 commit comments

Comments
 (0)