encre-css-typography

Crates.ioencre-css-typography
lib.rsencre-css-typography
version0.1.6
sourcesrc
created_at2023-04-18 16:05:02.334269
updated_at2024-09-01 09:51:27.170632
descriptionDefine beautiful typographic defaults for HTML you don't control
homepage
repositoryhttps://gitlab.com/encre-org/encre-css.git
max_upload_size
id842597
size109,027
(nifouprog)

documentation

https://docs.rs/encre-css-typography

README

encre-css-typography

A plugin that provides a set of prose classes you can use to add beautiful typographic defaults to any vanilla HTML you don't control, like HTML rendered from Markdown, or pulled from a CMS.

Getting started

To integrate encre-css-typography with encre-css, add it in your Cargo.toml:

[dependencies]
encre-css-typography = "0.1.4"

Then, call the register function with a mutable reference to a Config structure:

use encre_css::Config;

let mut config = Config::from_file("encre-css.toml")?;
// Or let mut config = Config::default();
encre_css_typography::register(&mut config);

let _css = encre_css::generate(
    [r#"<div class="prose prose-headings:text-blue-500 prose-slate lg:prose-lg dark:prose-invert"></div>"#],
    &config,
);
// Do something with the CSS
Commit count: 252

cargo fmt