Juice
JavaScript library that inlines CSS rules into the style attributes of HTML, used for HTML emails and embeds.
automattic.github.io/juice/repositorydocs
Juice is a JavaScript library that moves CSS rules into the style attribute of the HTML elements they match, for HTML emails and for embedding HTML in third-party websites. It takes an HTML string, a file or a cheerio document, and an options object controls how media queries, font faces, table attributes and template code blocks are handled. A command-line tool does the same for HTML files and whole directories.
The default module runs on Node.js. A separate browser entry exposes the inlining functions for code bundled for the browser, without the file and remote-resource functions. The project site hosts a web client for trying the library on a page of HTML.
Worth knowing
Rules that use pseudo-classes such as :hover cannot be inlined, so they stay in a style tag.
Identity
Rendering and deploy
- Install with
- npm install3
Releases
Adoption
Sources
- 2026-11-16: links
automattic.github.io/juice/ - 2026-11-16: links, License, Written in, GitHub stars
api.github.com/repos/Automattic/juice - 2026-11-16: links, Categories, Runtime, Install with
raw.githubusercontent.com/Automattic/juice/master/README.md - 2026-11-16: Maintainer, License, License model
raw.githubusercontent.com/Automattic/juice/master/LICENSE.md - 2026-11-16: Minimum runtime
raw.githubusercontent.com/Automattic/juice/v12.2.3/package.json - 2026-11-16: npm downloads a week
api.npmjs.org/downloads/range/2026-11-01:2026-11-07/juice - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/juice - 2026-11-16: Contributors
api.github.com/repos/Automattic/juice/contributors - 2026-11-16: Current major version, Last release
api.github.com/repos/Automattic/juice/releases/tags/v12.2.3 - 2026-11-16: First release
registry.npmjs.org/juice