Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

postcss-epub

Rycochet50MIT3.0.1

PostCSS plugin to prefix ePub3 properties

css, postcss, postcss-plugin, epub, epub3

readme

postcss-epub Build Status

PostCSS plugin to give correct ePub3 css output.

See the EPUB 3 CSS Profile for more information.

Installation

$ npm install postcss-epub

Options

  • fonts:true - This will ensure fonts have the correct font-weight and font-style defaults. This will also throw an error if any there is not a valid font source format (opentype or woff).
  • strip:true - This will strip any non -epub- prefixes.
  • strict:true - Implies all other options are set.

Usage

postcss([ require("postcss-epub") ])
// or
postcss([ require("postcss-epub")({strict:true}) ])

See PostCSS docs for examples for your environment.

Example

@font-face {
    font-family: 'Fake Font';
    src: local('Fake Font'),
        url('path/to/font.woff') format('woff'),
        url('path/to/font.ttf') format('truetype'),
        url('path/to/font.otf') format('opentype');
}

stuff {
    dont: care;
    hyphens: all;
    line-break: normal;
    text-align-last: center;
    text-emphasis: red triangle;
    text-emphasis-color: red;
    text-emphasis-style: triangle;
    word-break: break-all;
    -webkit-prefix: something;
}
@font-face {
    font-family: 'Fake Font';
    src: local('Fake Font'),url('path/to/font.woff') format('woff'),url('path/to/font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

stuff {
    dont: care;
    -epub-hyphens: all;
    hyphens: all;
    -epub-line-break: normal;
    line-break: normal;
    -epub-text-align-last: center;
    text-align-last: center;
    -epub-text-emphasis: red triangle;
    text-emphasis: red triangle;
    -epub-text-emphasis-color: red;
    text-emphasis-color: red;
    -epub-text-emphasis-style: triangle;
    text-emphasis-style: triangle;
    -epub-word-break: break-all;
    word-break: break-all;
}

License

changelog

Change Log

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

[3.0.1] - 2016-11-29

  • Fixed obsolete PostCSS call

[3.0.0] - 2015-09-08

  • Updated to latest PostCSS

[2.3.0] - 2015-05-27

  • Bumped minor version after it was pointed out that I changed the API

2.2.6 - 2015-05-26

Changed

Added

  • Merged extra code from postcss-epub-clean
  • Options:
    • strict - same as setting all other options (including future ones)
    • fonts - check font defaults and formats
    • strip - remove non -epub- prefixes
  • CHANGELOG.md (this file)

Removed

  • Separate postcss-epub-clean version removed

2.2.5 - 2014-11-04

Added

  • First release
  • Version number set to same as PostCSS for simplicity