rehype-inline-css
Rehype plugin for juice
Last updated 4 years ago by taniguchi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rehype-inline-css 
SYNC missed versions from official npm registry.

Rehype Inline CSS

Rehype plugin to embed a stylesheet to each html elements.

Installation

npm install rehype-inline-css

Usage

import { unified } from 'unified'
import rehype from 'rehype-parse'
import stringify from 'rehype-stringify'
import inlineCss from './index.js'
const processor = unified().use(rehype).use(inlineCss).use(stringify)
const i = `<p>test</p><style>p { color: red; }</style>`
const o = processor.processSync(i).toString()
cosnole.log(o)

Now running the above script yields:

<p style="color: red;">test</p>

API

rehype().use(inlineCss)

Security

This plugin embeds all stylesheets in documents. Please take care of Suspicious stylesheets.

License

MIT © TANIGUCHI Masaya

https://git.io/mit-license

Current Tags

  • 0.5.1                                ...           latest (4 years ago)

12 Versions

  • 0.5.1                                ...           4 years ago
  • 0.5.0                                ...           4 years ago
  • 0.4.0                                ...           4 years ago
  • 0.3.4                                ...           4 years ago
  • 0.3.3                                ...           4 years ago
  • 0.3.2                                ...           4 years ago
  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |