tailwind-rs

Tailwind translater for html and more

5 releases

0.2.0 Sep 30, 2022
0.1.3 Mar 5, 2022
0.1.2 Mar 3, 2022
0.1.1 Mar 2, 2022
0.1.0 Feb 26, 2022

MPL-2.0 license

490KB
12K SLoC

Rust 10K SLoC // 0.0% comments Objective-C 2K SLoC

Tailwindcss in Rust

Compile your HTML code into CSS using Tailwindcss in Rust.

Usage

use tailwind_rs::{CLIConfig, CssInlineMode, TailwindBuilder, Result};

let mut config = CLIConfig::default();
let mut builder = config.builder();
config.minify = false;
builder.preflight.disable = true;

let input_html = "<div class=\"border-red-500 p-2\"></div>".to_string();

config.mode = CssInlineMode::None;
let (html, css) = config.compile_html(&input_html, &mut builder).unwrap();

assert_eq!(html, input_html);
assert_eq!(css, ".border-red-500 {\n  border-color: #ef4444;\n}\n\n.p-2 {\n  padding: .5rem;\n}\n");

Dependencies

~10–16MB
~249K SLoC