View Single Post
Old 10-11-2026, 08:28 AM   #2
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: 85,348
Karma: 154365103
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 Zillion_ View Post
Hello, I have an issue trying to use :has() pseudo-class selectors in e-books.

Example:
.ChapterS:has(+.SubChapter) {
margin-bottom: 1em !important;
color: red !important;
}


The Kindle conversion logs show this:

Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Inserting metadata into book...
Flattening CSS and remapping font sizes...
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ blockquote)' (The pseudo-class :has() is unknown)
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ .ChapterLocation)' (Expected an argument, got <DELIM '.' at 16>)
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ .SubChapter)' (Expected an argument, got <DELIM '.' at 16>)
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ blockquote)' (The pseudo-class :has() is unknown)
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ .ChapterLocation)' (Expected an argument, got <DELIM '.' at 16>)
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ .SubChapter)' (Expected an argument, got <DELIM '.' at 16>)
Ignoring CSS rule with invalid selector: '.ChapterS:has(+ blockquote)' (The pseudo-class :has() is unknown)


Calibre supports them correctly for the display in the editor (text displays correctly, tested with some color tags) but the conversion doesn't.
Is this an issue in Calibre or in KFX Output ? (unclear to me)
Try converting to KF8 and see if the pseudo class still works. It could be an issue KFX not supporting it.
JSWolf is online now   Reply With Quote