inline-css

Crates.ioinline-css
lib.rsinline-css
version0.0.3
sourcesrc
created_at2023-05-18 00:53:22.202815
updated_at2023-05-18 03:53:05.237838
descriptionEmbed CSS directly in your Rust code
homepage
repositoryhttps://git.stuerz.xyz/rustcloud/inline-css
max_upload_size
id867324
size62,513
Benjamin Stürz (realchonk)

documentation

README

inline-css

Inline CSS directly into your Rust code.

Example

use inline_css::css;

fn main() {
    let css = css! {
        h1 {
            color: red;
        }
    };
    
    println!("{css}");
}

Syntax issues

margin: 10em;

This doesn't work because Rust expects an exponent after the e. The workaround is to write 10m, which the macro implicitly converts to 10em.

padding: calc(10 - 1);

Unsupported, use padding: {10 - 1}; instead.

color: #0000ef;

Impossible to parse, use color: #0xff00ff; instead.

color: #0x0ff;

Is interpreted as color: #0x0000ff;, please use color: #0x00ffff; instead.

TODO

  • Documentation
  • Parse h1::after {}
Commit count: 0

cargo fmt