Macro sauron::jss_with_media

source ·
jss_with_media!() { /* proc-macro */ }
Expand description

build css string that has media selector or any other conditional group

§Example:

use sauron::jss_with_media;

let css = jss_with_media!(
    "@media screen and (max-width: 800px)": {
      ".layer": {
        width: "100%",
      }
    },
);

let expected = "\
    @media screen and (max-width: 800px) {\
        \n.layer {\
        \n  width: 100%;\
        \n}\
        \n\
        \n}\
        \n";
assert_eq!(expected, css);