EPUBCheck CSS-029: undeclared overlay CSS class
Updated:
EPUBCheck CSS-029 is a usage message: “Found CSS class name "…" but no "…" property was declared in the package document.” The CSS uses a media overlay highlighting class name, but the package document does not declare the matching property. With media overlays, the class that highlights the text being read aloud must be declared in the package metadata (media:active-class or media:playback-active-class); EPUBCheck names both the class and the missing property.
The official message
Found CSS class name "%1$s" but no "%2$s" property was declared in the package document.
- Default severity
- Usage. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- A stylesheet copied from a book with narration into a package that never declared the class.
- The package metadata was edited and the media: meta elements were removed.
How to fix it
- Add the property to the package metadata, for example
<meta property="media:active-class">my-active-item</meta>, with exactly one class name and no selector. - Or remove the unused class from the CSS if the book has no media overlays.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the class is declared but no CSS reaches the chapter, the error is CSS-030.
Terms used here
Other CSS messages
CSS-028Use of Font-face declaration.CSS-030The package document declares media overlays styling class names but no CSS was found in the content document.CSS-019CSS font-face declaration has no attributes.CSS-015Alternative style sheets must have a title.CSS-008An error occurred while parsing the CSS: ….CSS-007Font-face reference "…" refers to non-standard font type "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.