irontigran / plato_the-dialogues-of-plato_benjamin_jowett

Other
0 stars 0 forks source link

Review: CSS #28

Closed vr8hub closed 2 years ago

vr8hub commented 2 years ago
irontigran commented 2 years ago

Our nth-of-type or not dramatis-personae CSS might be foiled by the essays inserted into some introductions, which each get their own sections. (See Meno, "On the Ideas of Plato")

How do you feel about pattern matching on ids? All the textual sections are labeled "-text" and the books within the Republic and the Laws are labeled "-book-#".

section [id~="book"],
section [id$="text"]{
    page-break-before: always;
}
vr8hub commented 2 years ago

No, that's great with me. Alex has a tendency to adjust CSS to his own liking, anyway, but that works and doesn't require extra markup, so I think it works.

irontigran commented 2 years ago

I thought this would be simple, but I can't get the page break to show up in either Foliate or Calibre with

section [id*="book"],
section [id$="text"]{
    break-before: page;
}

(I was using this commit as a reference: f88567b5e0c2ff5d16869ddd4bbcee242f64b3e8)

Any thoughts? (I pushed my attempt to fix it in the css-review branch.)

vr8hub commented 2 years ago

I believe you have to get rid of the space, i.e.

section[id*="book"],
section[id$="text"]

Same as on the blockquote[xml|lang] for blockquotes that have language attributes on them. See here.

irontigran commented 2 years ago

Seems to work on Calibre at least. (Foliate still doesn't show the page breaks, oddly.)

vr8hub commented 2 years ago

Per Alex's response on his issue, let's use first-of-type instead of nth-of-type(1). I don't think there are any nth-of-type(x) where x is the last one, but if by chance there is, it should be last-of-type instead.

vr8hub commented 2 years ago

Also, as you also saw, on the numbers with overbars, you can either use MathML, or just use regular numbers and CSS (text-decoration-*) to put the overbars on. I tested the latter and it seemed to work fine, but feel free to use MathML if you'd prefer.