View Single Post
Old 02-07-2024, 12:03 PM   #17
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: 79,796
Karma: 146391129
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 KevinH View Post
The answer is no, there is no appreciable code loading or execution differences 99% of the time.

And an epub publisher who uses a standard css across a number of books, is much more likely to make fewer errors of omission or design, thus improving quality.

JSWolf has simply overstated/over claimed things as usual. He makes unneeded changes for no valid reason other than he thinks it should be so and gets irrationally upset when explained otherwise.

Making code simpler when possible is always a good thing, but simplifying classes when css inheritance is in effect (and with some css injected by the reader) itself is fraught with errors and really is not a good idea.

Removing unused id attributes is another one of those short sighted mistakes people make as external cfi references by scholars and others into locations inside the epub, page boundaries, and etc are often lost or destroyed.

And as a practical rule, anything that does not significantly impact loading or execution speed should generally be left alone is probably a good idea.

What JSWolf does with his own books is up to him, but advocating his views to everyone else as a "law" is not. Simpler is better until it is not. Be careful making changes not fully understood. Adding or removing default css from a class can and does impact inheritance and can cause errors when reader injected css exists that needs to be overridden, etc.
Removing the unused IDs can speed up the ePub. It's been proven that if your ToC used IDs to go to then it gets slower.'

So if I have <h2 id="chapter01">Chapter 01</h2> and I have the ToC reference the ID instead of just going to the start of the HTML file, it will be slower. The only time an ID is needed in the ToC is when you are going to someplace that's not the top of the HTML.

There is nothing wrong with removing unused IDs. You don't see them. They don't do anything. They are not referenced for anything. You can't referenced them. You cannot go to a specific ID or page number (based on some pBook version). They don't do anything. If someone can show how to reference an unused ID in an eBook while viewing it, please do so. IDs do not reference anything external. They either there for a reason and they get used or they are extraneous and have no need to be there.

I've seen errors in a house CSS. The problem then becomes that they keep using it and the error stays because it could be in a not often used class.

Removing code you don't need is not a bad idea. But it is up to you to do so or not. When editing an eBook to be published, it's a good idea not to have any extra code. In calibre or Sigil, it's trivial to remove unused CSS.

CSS is there to override defaults if needed. But there's no need to 0 out all sorts of tags. You set them as they are needed.

Adding in your own CSS is not an issue. I don't add in all that much CSS. If it clashes with the existing CSS, I'll fit it so that's not an issue. You do not have to worry about any sort of inherited values. None of the CSS I add has any errors.

The changes I make are my choice. But they are not wrong. The format of the eBook is based on the publisher's format and it works to be the way I prefer. I don't like large space in chapter headers, like the based font size to be the default size. I don't like a smaller font size in offset text, I don't like large indents. I don't like paragraph spaces. I don't like space for section breaks. I don't like large first letter or drop-cap. I don't like large margins or large line-height. Some emendded fonts I don't want so I remove the embedded fall or some of the embedded fonts. for example, Adobe Garamond Pro is used a lot of the base font to emulate the pBook. It's too light and I don't to read with it. So I remove it and use the font of my choice. Stripping or changing code that does some of these things is not wrong. I have a Kobo and it has settings for font, font-size, margins, and line height. So I have to remove code for the font size if it makes the base font size smaller then 1em. Overall L/R margins get removed and left at 0. Line-height gets removed so I can set it how i like.

When I am done, the code is very clean and works as expected. Nothing I do is incorrect.
JSWolf is offline   Reply With Quote