View Single Post
Old 02-06-2024, 10:20 AM   #83
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,075
Karma: 147983159
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by paperwhite13 View Post
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).
It's better to use a naked <h1> if that's going to be be used that way most of the time. Say you have 10 chapters and only 1 has a subtitle. Style <h1> how it will be for the 9 chapters and leave it naked. Otherwise, you have code bloat. <p> is even worse as you'll have severe code bloat with <p class="codebloat">.

The rule is to keep it simple and <p class="codebloat"> and <h1 class="idontneedaclasshere"> is not keeping it simple.
JSWolf is offline   Reply With Quote