styles/
styles.rs

1use html_tag::styles::{Style, StyleSheet};
2
3fn main() {
4    let mut style = StyleSheet::new();
5    style.add_style(".wow", "color", "red");
6    style.add_style(".wow", "font-size", "20px");
7    style.add_style(".wow", "font-family", "sans-serif");
8
9    style.add_style("h1", "color", "blue");
10    style.add_style("h1", "font-size", "30px");
11
12    println!("{}", style.get_style_sheet());
13    println!("{}", style.get_with_tag());
14
15    // with HtmlTag
16    let div = html_tag::HtmlTag::new("div")
17        .with_id("wow")
18        .embed_style_sheet(&style)
19        .with_child(
20            html_tag::HtmlTag::new("h1")
21                .with_class("wow")
22                .with_body("Hello World"),
23        );
24
25    println!("{}", div.to_html());
26}