wasm-css 0.2.0

Ergonomic WASM CSS Framework
Documentation
// Authors: Robert Lopez

use super::Components;

#[test]
fn test_css_parsing_generation() {
    let css = "
      font-size: 30rem;;

        &:hover    {{
            color :   blue;
            background-color: red;
        }}

        @media  (max-width: 800px ) {{
            max-width: 100rem;
            max-height: 20 0rem;
        }}

        background-color: rgba(13 7, 137, 137, 0.1);
    ";

    let components = Components::from_css(css);
    let expected_css = ".class {\n\tbackground-color: rgba(137, 137, 137, 0.1);\n\tfont-size: 30rem;\n\t&:hover {\n\t\tbackground-color: red;\n\t\tcolor: blue;\n\t}\n\t@media (max-width: 800px) {\n\t\tmax-height: 200rem;\n\t\tmax-width: 100rem;\n\t}\n}";
    assert_eq!(expected_css, components.to_css(".class"));
}