#css #tailwind #compiler #encre-css

encre-css-typography

Define beautiful typographic defaults for HTML you don't control

4 releases

new 0.1.3 Apr 11, 2024
0.1.2 Dec 26, 2023
0.1.1 Jul 1, 2023
0.1.0 Apr 18, 2023

#2302 in Web programming

Download history 4/week @ 2023-12-22 18/week @ 2024-02-23 6/week @ 2024-03-01 41/week @ 2024-03-29 78/week @ 2024-04-05

119 downloads per month

MIT license

710KB
18K SLoC

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.3"

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

lib.rs:

Define beautiful typographic defaults for HTML you don't control.

Dependencies

~1–1.7MB
~35K SLoC