Struct css_inline::CSSInliner

source ·
pub struct CSSInliner<'a> { /* private fields */ }
Expand description

Customizable CSS inliner.

Implementations§

source§

impl<'a> CSSInliner<'a>

source

pub const fn new(options: InlineOptions<'a>) -> Self

Create a new CSSInliner instance with given options.

source

pub fn options() -> InlineOptions<'a>

Return a default InlineOptions that can fully configure the CSS inliner.

§Examples

Get default InlineOptions, then change base url

use css_inline::{CSSInliner, Url};
let url = Url::parse("https://api.example.com")?;
let inliner = CSSInliner::options()
    .base_url(Some(url))
    .build();
source

pub fn inline(&self, html: &str) -> Result<String>

Inline CSS styles from