Title: Inline CSS Properties into HTML Tags Using 'juice'
Version: 0.1.0
Description: There are occasions where you need a piece of HTML with integrated styles. A prime example of this is HTML email. This transformation involves moving the CSS and associated formatting instructions from the style block in the head of your document into the body of the HTML. Many prominent email clients require integrated styles in HTML email; otherwise a received HTML email will be displayed without any styling. This package will quickly and precisely perform these CSS transformations when given HTML text and it does so by using the JavaScript 'juice' library.
License: MIT + file LICENSE
URL: https://github.com/rich-iannone/juicyjuice
BugReports: https://github.com/rich-iannone/juicyjuice/issues
Encoding: UTF-8
RoxygenNote: 7.2.1
Imports: V8 (≥ 4.2.0)
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2022-11-09 19:42:30 UTC; rich
Author: Richard Iannone ORCID iD [aut, cre, cph], Automattic [cph] (juice library), juice contributors [ctb] (juice library)
Maintainer: Richard Iannone <riannone@me.com>
Repository: CRAN
Date/Publication: 2022-11-10 19:00:02 UTC

Perform CSS inlining with HTML

Description

Given an HTML string, the css_inline() function will render that into HTML with CSS inlined into the style attribute of HTML tags.

Usage

css_inline(html)

Arguments

html

HTML provided as a string.

Value

A character vector of length one which contains the transformed HTML text.

Examples


# Take an HTML string and inline the CSS into the tags
css_inline(html = "<style>div{color:blue;}</style><div/>")