Giter Club home page Giter Club logo

postcss-epub's Introduction

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;
}

postcss-epub's People

Contributors

rycochet avatar antyakushev avatar caesar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.