postcss-epub-clean

PostCSS plugin to prefix ePub3 properties and remove non-epub properties and values

Usage no npm install needed!

<script type="module">
  import postcssEpubClean from 'https://cdn.skypack.dev/postcss-epub-clean';
</script>

README

postcss-epub-clean Build Status

PostCSS plugin to produce valid epub3 css.

See the EPUB 3 CSS Profile for more information.

See postcss-epub if you're only wishing to add prefixed css properties.

@font-face requires both font-weight and font-style, so both are set to "normal" if not present (it's not clear in the spec, but required in some readers).

The "-epub-" prefix is added to anything needing it per the spec and all non "-epub-*" prefixes are removed.

Note: This will leave the unprefixed property.

Installation

$ npm install postcss-epub-clean

Usage

// dependencies
var fs = require("fs")
var postcss = require("postcss")
var epub = require("postcss-epub-clean")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

// process css
var output = postcss()
  .use(epub)
  .process(css)
  .css

License