Skip to content
EPUBCheck · Stylesheets

EPUBCheck CSS-019: empty @font-face rule

Updated:

EPUBCheck CSS-019 is a warning message: “CSS font-face declaration has no attributes.” An @font-face rule is empty, so it declares no font. EPUBCheck warns because the rule does nothing and usually means a font was removed only halfway.

The official message

CSS font-face declaration has no attributes.

Default severity
Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
EPUBCheck version
5.4.0

Typical causes

  • A rule left after its src and font-family were removed.
  • A template stylesheet with placeholder @font-face blocks.

How to fix it

  1. Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
  2. Delete the empty @font-face rule.
  3. Or complete it with font-family and a src that points to a font file in the EPUB and the manifest.
  4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

If the rule names a font in an unusual format, that is CSS-007.

Terms used here

Other CSS messages

  • CSS-015 Alternative style sheets must have a title.
  • CSS-028 Use of Font-face declaration.
  • CSS-029 Found CSS class name "…" but no "…" property was declared in the package document.
  • CSS-008 An error occurred while parsing the CSS: ….
  • CSS-030 The package document declares media overlays styling class names but no CSS was found in the content document.
  • CSS-007 Font-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.

FAQ

What does EPUBCheck CSS-019 mean?

EPUBCheck CSS-019 is a warning message: “CSS font-face declaration has no attributes.” An @font-face rule is empty, so it declares no font. EPUBCheck warns because the rule does nothing and usually means a font was removed only halfway.

Is CSS-019 an error?

CSS-019 is reported as warning by default. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.