Crates.io | cssificator |
lib.rs | cssificator |
version | 0.1.0 |
source | src |
created_at | 2024-10-29 10:36:32.013033 |
updated_at | 2024-10-29 10:36:32.013033 |
description | Generate CSS source code through rust functions! |
homepage | |
repository | https://github.com/IsotoxalDev/cssificator |
max_upload_size | |
id | 1426901 |
size | 5,800 |
This crate provides an element struct which can be displayed as HTML.
This crate is licensed under the MIT license
[dependencies]
htmlificator = "0.1.0"
use cssificator::{Style, CSS};
fn main() {
let mut css = CSS::new();
let mut st1 = Style::new("h1");
st1.add_declaration("color", "red");
st1.add_declaration("size", "20px");
let mut st2 = Style::new("div");
st2.add_declaration("background-color", "black");
st2.add_declaration("height", "100vh");
st2.add_declaration("width", "100vw");
css.add_style(st1);
css.add_style(st2);
println!("{}", css)
}