Skip to content

Commit 91ef97b

Browse files
present: new css class for the heading title for slide articles
The .title class is used in case the title is the only thing being rendered in an article. The position: absolute property was previously set on the h2 element, which broke the article's contents. Now the slide's articles will begin from h2 instead of h3, and will be properly positioned.
1 parent b56102b commit 91ef97b

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

cmd/present/static/styles.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,8 @@ h1 {
316316
}
317317

318318
h2 {
319-
font-size: 45px;
320-
line-height: 45px;
321-
322-
position: absolute;
323-
bottom: 150px;
319+
font-size: 34px;
320+
line-height: 36px;
324321

325322
padding: 0;
326323
margin: 0;
@@ -551,3 +548,11 @@ figcaption {
551548
-moz-border-radius: 10px;
552549
-webkit-border-radius: 10px;
553550
}
551+
552+
.title {
553+
font-size: 45px;
554+
line-height: 45px;
555+
556+
position: absolute;
557+
bottom: 150px;
558+
}

cmd/present/templates/action.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ It determines how the formatting actions are rendered.
44
*/}
55

66
{{define "section"}}
7-
<h{{ .Level}} id="TOC_{{.FormattedNumber}}">{{.FormattedNumber}} {{.Title}}</h{{ .Level}}>
7+
<h{{.Level}} id="TOC_{{.FormattedNumber}}">{{.FormattedNumber}} {{.Title}}</h{{.Level}}>
88
{{range .Elem}}{{elem $.Template .}}{{end}}
99
{{end}}
1010

cmd/present/templates/slides.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757
<!-- start of slide {{$s.Number}} -->
5858
<article {{$s.HTMLAttributes}}>
5959
{{if $s.Elem}}
60-
<h3>{{$s.Title}}</h3>
60+
<h2>{{$s.Title}}</h2>
6161
{{range $s.Elem}}{{elem $.Template .}}{{end}}
6262
{{else}}
63-
<h2>{{$s.Title}}</h2>
63+
<h2 class="title">{{$s.Title}}</h2>
6464
{{end}}
6565
<span class="pagenumber">{{pagenum $s 1}}</span>
6666
</article>

0 commit comments

Comments
 (0)