fn add_document_styles(css: &str) {
    let head = document().head().unwrap();
    let style = document().create_element("style").unwrap();
    style.set_attribute("type", "text/css").unwrap();
    style.append_html(css).unwrap();
    head.append_child(&style);
}
// Small helper function, only for the example. Uses stdweb, DIV-RS does not really help you with this part of CSS.
// It is not recommended to add classes like this but it is useful here to keep everything in a single file.
Small helper function, only for the example. Uses stdweb, DIV-RS does not really help you with this part of CSS.
It is not recommended to add classes like this but it is useful here to keep everything in a single file.
Small helper function only for the example . Uses stdweb DIV - RS does not really help you with this part of CSS . It is not recommended to add classes like this but it is useful here to keep everything in a single file .
fn add_document_styles(css: &str) {
    let head = document().head().unwrap();
    let style = document().create_element("style").unwrap();
    style.set_attribute("type", "text/css").unwrap();
    style.append_html(css).unwrap();
    head.append_child(&style);
}
fn add_document_styles ( css : & str ) { let head = document ( ) . head ( ) . unwrap ( ) ; let style = document ( ) . create_element ( " " ) . unwrap ( ) ; style . set_attribute ( " " , " " ) . unwrap ( ) ; style . append_html ( css ) . unwrap ( ) ; head . append_child ( & style ) ; }
Small helper function, only for the example.
Small helper function only for the example .
css
&str
css
&str