Skip to content

Commit 3afa3da

Browse files
committed
chore: improve details spacing
1 parent 4b8cb23 commit 3afa3da

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

.changeset/true-trams-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"r.obin.ch": patch
3+
---
4+
5+
Improve details spacing

src/components/Details.astro

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ const { defaultOpen = false, title } = Astro.props;
1010
---
1111

1212
<details data-default-open={defaultOpen}>
13-
<summary>
14-
<slot name="title">
15-
{title}
16-
</slot>
17-
</summary>
13+
<summary><slot name="title">{title}</slot></summary>
1814
<div class="content">
1915
<slot />
2016
</div>
@@ -52,7 +48,7 @@ const { defaultOpen = false, title } = Astro.props;
5248
}
5349

5450
.content {
55-
padding: 0 1ch;
51+
padding: 0 2ch;
5652
}
5753
</style>
5854

src/components/TableOfContents.astro

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const t = useTranslations(locale);
2020

2121
ul {
2222
padding: 0;
23-
margin-left: calc(-1rem * (var(--from-depth) - 1));
2423
margin-bottom: 0;
2524
}
2625

@@ -41,23 +40,23 @@ const t = useTranslations(locale);
4140
}
4241

4342
.depth-2 {
44-
margin-left: 1rem;
43+
margin-left: 1ch;
4544
}
4645

4746
.depth-3 {
48-
margin-left: 2rem;
47+
margin-left: 3ch;
4948
}
5049

5150
.depth-4 {
52-
margin-left: 3rem;
51+
margin-left: 5ch;
5352
}
5453

5554
.depth-5 {
56-
margin-left: 4rem;
55+
margin-left: 7ch;
5756
}
5857

5958
.depth-6 {
60-
margin-left: 5rem;
59+
margin-left: 9ch;
6160
}
6261
</style>
6362

0 commit comments

Comments
 (0)