View Single Post
Old 07-26-2022, 03:58 PM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Suggestions for ::first-letter (:first-letter)?

I just ran across some CSS in an epub using :first-letter. Looking at w3c:

https://www.w3schools.com/cssref/sel_firstletter.asp

it talks about the :: version of that (instead of the : version) and says:

"The ::first-letter selector is used to add a style to the first letter of the specified selector."

Cool. I'm getting tired of worrying about quotation marks and other punctuation when I use a regex to bold the first letter of each non-indented paragraph. That'll work.

Looking at mozilla:

https://developer.mozilla.org/en-US/...::first-letter

it explains that ::first-letter was added to epub3:

"CSS3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements."

OK. Since I convert to CSS3 when I edit an epub, not a problem. I'll use that.

Now for the silly bit. I'm a bit torn over how to stylistically implement this. I have a noindent class that I use on the first paragraph following chapter titles (<h1>, <h2>, ...) and thematic breaks (<hr>). I could apply that ::first-letter thing to that on my stylesheet. But, I worry about the far-less-common use of non-indented paragraphs in other parts of the text.

With your 'druthers, would you prefer using ::first-letter implicitly in the noindent class or creating a new noindentfl class to handle that? Or, is there another preferred way to handle this?
enuddleyarbl is offline   Reply With Quote