Skip to content

Commit e31635e

Browse files
committed
Make code blocks fit content
1 parent 5ca2010 commit e31635e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/layouts/BlogPost.astro

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ const { title, description, author, pubDate, updatedDate, heroImage } =
3636
</BaseLayout>
3737

3838
<style>
39-
main {
40-
width: calc(100% - 2em);
41-
max-width: 100%;
42-
margin: 0;
39+
article {
40+
max-width: 90ch;
41+
margin-left: auto;
42+
margin-right: auto;
4343
}
44+
4445
.hero-image {
4546
width: 100%;
4647
}
48+
4749
.hero-image img {
4850
display: block;
4951
margin: 0 auto;
@@ -66,4 +68,13 @@ const { title, description, author, pubDate, updatedDate, heroImage } =
6668
color: rgb(var(--gray));
6769
font-style: italic;
6870
}
71+
72+
:global(.astro-code) {
73+
width: fit-content;
74+
max-width: 100%;
75+
margin-left: auto;
76+
margin-right: auto;
77+
78+
padding: 10px;
79+
}
6980
</style>

0 commit comments

Comments
 (0)