0.5.1 • Published 2 years ago

rehype-inline-css v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

0.5.0

2 years ago

0.4.0

2 years ago

0.5.1

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago