Hello everyone,
I’m making my first eBook as a favor for the author, an old friend. I understand HTML and CSS and can use RegEx. The code is clean, but not vanilla, and both the HTML and CSS validate. My workflow is
HTML => Sigil => ePub => KindleGen => mobi
The author’s formatting requests seem reasonable ― some type of first-line styling, some type of section-break decoration, and one small graphic in two places ― so I had thought it would be fairly easy to make a single HTML/CSS source that would create a valid ePub that in turn could be fed to KindleGen to produce old- and new-format Kindle files with the same overall appearance.
That seems to have been a bit naïve.
Everything I try seems to work on one reader but not on another.

I’d been thinking I could still use one HTML/CSS source because
- ADE will ignore ‘@media amzn-mobi' and '@media amzn-kf8' code in the CSS, and
- ‘display: none;’ will work on all devices. (Is this actually true?)
For the section breaks, for example, I might end up with 3 DIVs stacked one on top of the other, two of them always turned off with ‘display: none;’ and ‘@media amzn-’ queries flipping the switches.
But after a weekend of head-scratching I’m tending to think I’d be better off to simply
- make an ePub that looks the way the author wants and validates,
- then edit a copy of the HTML/CSS from the first ePub to make a second ePub,
- and use the second ePub as input for KingleGen.
Nonetheless, part of me shudders at the thought of forking my source documents. I used to develop commercial software and recall the endless hours of entertainment a simple fork could provide.

Hence my quest for the ‘One File to Rule Them All’.
But perhaps a two-source workflow would really be better for an eBook: at least I’d know that a fix for a change in KF8 rendering wouldn’t affect ADE readers, and if typos need to be fixed it’s still only two files.
Still though, I’d like to learn to do this right: not just ‘the book looks okay’, but something approaching ‘best practice’.
What sayeth those who’ve done this many times?