Package 'juicyjuice'

Title: Inline CSS Properties into HTML Tags Using 'juice'
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.
Authors: Richard Iannone [aut, cre] , Automattic [cph] (juice library), juice contributors [ctb] (juice library), Posit Software, PBC [cph, fnd]
Maintainer: Richard Iannone <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0.9000
Built: 2024-12-09 03:12:45 UTC
Source: https://github.com/rstudio/juicyjuice

Help Index


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/>")