Skip to content

Paragraphs and headings not affected by font-size #112

@danielweck

Description

@danielweck

Issue originally reported by @jonaslil :
edrlab/thorium-reader#1550

Summary

All p elements are displayed with the same font size, regardless of publisher css.

Problem

Lack of variation in font size distorts the layout of title pages and other special text elements. Endnotes, bibliographies, figcaptions containing p:s, which are usually styled smaller, are rendered with body text size (= 1 em).

Variations in font size are a basic typographic means to communicate text structure and hierarchy.

Tested with v1.7.2 on Windows.

Example

Title page in Thorium

Main title much too small, publisher info much too large:
Thorium_title

Title page in ADE

ADE_2

Sample book

Download book here

Code

HTML

    <section epub:type="titlepage" class="titlepage">
        <p class="book-author">Guss Mattsson</p>
        <p class="book-title">En tur om hörnet</p>
        <p class="book-subtitle">Bref till Dagens Press af G.&#8239;M.</p>
        <p class="editors">Utg. Clas Zilliacus</p>
        <p class="publisher">Svenska litteratursällskapet i Finland <br />Helsingfors 2021</p>
    </section>

CSS

p.book-author {
font-size: 1.4em;
font-style: italic;
line-height: 1;
margin-top: 2em;
text-indent: 0;
}
p.book-title {
font-family: "Source Serif Subhead", serif;
text-transform: uppercase;
font-size: 2.2em;
letter-spacing: 0.025em;
font-weight: bold;
line-height: 1;
margin-top: 1.5em;
text-indent: 0;
}
p.book-author + p.book-title {
margin-top: 1.5rem;
}
p.book-subtitle {
font-size: 1.4em;
line-height: 1.3;
margin-top: 1.2rem;
text-indent: 0;
}
p.editors {
font-size: 1.25em;
line-height: 1.3;
margin-top: 3rem;
font-style: italic;
text-indent: 0;
}
p.publisher {
font-size: 0.9em;
line-height: 1.4;
margin-top: 4rem;
text-indent: 0;
font-variant: small-caps;
letter-spacing: 0.08em;
page-break-before: avoid;
}


Issue originally reported by @apgrover :
edrlab/thorium-reader#1508

Summary

Setting font-size on h1-h6 tags does not render a visual change. Default h1-h6 font sizes appear instead.

Scope

Observed in Thorium for PC/Mac v1.6.0

Expected

Setting font-size: 2.5em on h1-h6 will set each element to the same font size.

Observed

font-size: 2.5em is ignored on h1-h6 and default font size appears instead.

Code Example

HTML

			<h1 class="gx">A</h1>
			<h2 class="gx">A</h2>
			<h3 class="gx">A</h3>
			<h4 class="gx">A</h4>
			<h5 class="gx">A</h5>
			<h6 class="gx">A</h6>

CSS

.gx {
    font-size: 2.5em;
}

Sample file available upon request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions