View Single Post
Old 06-24-2025, 04:45 PM   #34
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 Falkor View Post
That's not how CSS works. It's a nasty bug in RMSDK. CSS error handling is designed to allow for fallback.
But because older versions of RMSDK are still very much used by a lot of people, you have to deal with the bug and code for it not to be triggered.

Quote:
You may apply that style only to readers that support initial-letter, so you can add as much padding or margin as you need

Code:
@supports (initial-letter: 2;) {
  p.chapter-lead::first-letter {
    initial-letter: 2;
    -webkit-initial-letter: 2;
}
}
I did test @supports with an older RMSDK and yes it either works or is ignored. So that's not going to be a problem.

Quote:
Another ridiculous bug in their error handling. I haven't ever managed to make it ignore the entire CSS, though. @supports has never been a problem for me.
StandardEbooks has managed to cause the entire CSS to be ignored because they used extremity crappy code. They use code that you don't need at all. The idea is to keep it as simple as possible and they make it as complicated as possible.



You have to undo the span’s styling for readers that support initial-letter. This works fine for me:

Code:
span.dropcap-epub2 {
  font-size:580%;
  float:left;
  margin: -0.1em 0.1em -0.1em 0;
  vertical-align: top;
  line-height: 1 !important;
}

@supports (initial-letter:2) or (-webkit-initial-letter:2) {
  span.dropcap-epub2 {
    font-size:revert;
    float:revert;
    margin: revert;
    vertical-align: revert;
    line-height: revert;
    }
  
  h2 + p::first-letter{
    initial-letter: 2;
    -webkit-initial-letter: 2;
    margin-right: 0.3em;
    }  
}
Looks OK. However, a better solution (IMHO) would be to forget drop caps for ePub2.
JSWolf is offline   Reply With Quote