I'm writing a rust macro that allows for definition of CSS styles in the global scope at compile time similar to Aphrodite in React. The problem is how to combine all the css into either a single string or to write all the classes to a file at compile time. Is there any nice way in which to do this or a work around to achieve something similar?
I have been able to build a hashmap of the css properties of a style at runtime and do checks on the CSS; allowing the definition of objects like this.
css_stylesheet! {
button : {
color: "red"
},
}
However, once the map is created I don't know how to add it to either a global map or string. I am using the "phf" crate for compile time maps.