Skip to content

Commit a74e793

Browse files
committed
Add new post-preview style that makes headers smaller
Pair it with post-content in places where you want the nice overall spacing and presentation but don't want headings to blow out your whole layout. We can extend this in the future if there are other styles that we find strange when rendering previews.
1 parent 9b27ea7 commit a74e793

4 files changed

Lines changed: 24 additions & 22 deletions

File tree

public/style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7947,19 +7947,19 @@ video {
79477947
.post-content *:last-child {
79487948
margin-bottom: 0;
79497949
}
7950-
.post-content h1 {
7950+
.post-content:not(.post-preview) h1 {
79517951
font-size: 2rem;
79527952
}
7953-
.post-content h2 {
7953+
.post-content:not(.post-preview) h2 {
79547954
font-size: 1.5rem;
79557955
}
7956-
.post-content h3 {
7956+
.post-content:not(.post-preview) h3 {
79577957
font-size: 1.25rem;
79587958
}
7959-
.post-content h4 {
7959+
.post-content:not(.post-preview) h4 {
79607960
font-size: 1rem;
79617961
}
7962-
.post-content h5 {
7962+
.post-content:not(.post-preview) h5 {
79637963
font-size: 0.8rem;
79647964
}
79657965
.post-content h1,

src/rawdata/css/content.css

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@
1111
}
1212
}
1313

14-
h1 {
15-
font-size: 2rem;
16-
}
14+
&:not(.post-preview) {
15+
h1 {
16+
font-size: 2rem;
17+
}
1718

18-
h2 {
19-
font-size: 1.5rem;
20-
}
19+
h2 {
20+
font-size: 1.5rem;
21+
}
2122

22-
h3 {
23-
font-size: 1.25rem;
24-
}
23+
h3 {
24+
font-size: 1.25rem;
25+
}
2526

26-
h4 {
27-
font-size: 1rem;
28-
}
27+
h4 {
28+
font-size: 1rem;
29+
}
2930

30-
h5 {
31-
font-size: 0.8rem;
31+
h5 {
32+
font-size: 0.8rem;
33+
}
3234
}
3335

3436
h1,
@@ -173,4 +175,4 @@
173175
background-color: black;
174176
}
175177
}
176-
}
178+
}

src/templates/src/blog_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
</div>
2222
{{ if .Content }}
23-
<div class="overflow-hidden maxh-5 relative post-content">
23+
<div class="overflow-hidden maxh-5 relative post-content post-preview">
2424
<div>
2525
{{ .Content }}
2626
</div>

src/templates/src/include/blog_list_item.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</div>
1111
</div>
1212
{{ if .Content }}
13-
<div class="overflow-hidden maxh-5 relative post-content">
13+
<div class="overflow-hidden maxh-5 relative post-content post-preview">
1414
<div>
1515
{{ .Content }}
1616
</div>

0 commit comments

Comments
 (0)