Crates.io | inline-css |
lib.rs | inline-css |
version | 0.0.3 |
source | src |
created_at | 2023-05-18 00:53:22.202815 |
updated_at | 2023-05-18 03:53:05.237838 |
description | Embed CSS directly in your Rust code |
homepage | |
repository | https://git.stuerz.xyz/rustcloud/inline-css |
max_upload_size | |
id | 867324 |
size | 62,513 |
Inline CSS directly into your Rust code.
use inline_css::css;
fn main() {
let css = css! {
h1 {
color: red;
}
};
println!("{css}");
}
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.
h1::after {}