View Single Post
Old 02-06-2024, 04:07 AM   #82
paperwhite13
Zealot
paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.paperwhite13 can eat soup with a fork.
 
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
Quote:
Originally Posted by nabsltd View Post
h2.chapterheader {} only applies to the h2 element. If you decide that you need to move levels up or down in the heading structure (i.e., h1 becomes h2 or h2 becomes h1), you need to go back and change the stylesheet, becauset the old h2.chapterheader {} won't apply to an h1.

On the other hand, if your stylesheet only referenced .chapterheader {}, then it doesn't matter if that class name is in an h1, an h2 or even a p, it will still get applied.
Thank you, I now understand what you meant about moving levels and restrictions, but it doesn’t appply to my InDesign workflow. With an epub exported from ID, it’s not a work in progress, the hierarchy is set, the multi-level ToC is ready and nothing will ever move up or down. At this point it’s just cleaning up.

Quote:
Originally Posted by nabsltd View Post
h1.specialchapter has to "undo" everything that the bare h1 declares if it doesn't match what you want h1.specialchapter to look like. You either do this by making h1.specialchapter declare all properties or by just declaring what needs to change.

In the first case, you aren't using the base h1 at all in h1.specialchapter, so why pretend it's related to the base? In the second case, if you change the base h1, then h1.specialchapter will also change, if you didn't override that property. If that's not what you want, you have to change both declarations.

My way means I only change the declaration I want to change, and don't have to worry about any other side effects. Part of the reason I do this is because physical books often had what would be h1 and h2 in an EPUB having formatting that has nothing at all in common. For example h1 was a fairly large sans-serif font centered (the chapter number) with a very large bottom margin, while h2 was left-justified, italic, and only slightly larger than the body text, and a normal bottom margin ("datelines" that occured 3-4 times per chapter).
With the h1.specialchapter, I override the few properties that change, and like I said, it’s not really a work in progress, h1 is already set. I understand your concern about side effects, but InDesign *Based On* styles work the same way (if anything changes in the base style that hasn’t been overwritten, the change will propagate), so I'm used to working with a base style for body or title text.

It does makes sense not to style h1, h2 etc. and focus on their semantic roles (which would be akin to the no-style, [Basic Paragraph] in InDesign), so I may end up not styling them in practice, but that means I will end up with declarations for .regularchapter and .exception, the latter of which might be longer than if I had used styled bare tags, am I correct (if I wanted, say, a sans-serif font for both)? It would also make no difference if they were attached to h1 or not, since I wouldn’t be able to use them elsewhere and they would make the style sheet a little harder to follow (it’s easier for me to parse h1.exception than .exception).

Last edited by paperwhite13; 02-06-2024 at 04:50 AM.
paperwhite13 is offline   Reply With Quote