Maomi supports a limited form of CSS.
In most cases, styles should be specified through classes.
Like common rust structs, classes can be public and used by multiple components.
The class name is in the same namespace of the rust structs and enums.
Do not use element tag name as class names, otherwise the element tag name cannot be used.
The stylesheet syntax is different from standard CSS.
The basic property syntax is "xxx = xxx;", and the CSS words should be connected with "_".
Numbers with units should be written as follows:
Colors in "#xxx" forms should be written as follows:
When not sure about the CSS output, add a "#[error_css_output]" before the class and the generated CSS will output as an error message.
The class names are properly hashed. It is totally OK to use the same class name in different modules.
It is OK to specified the hashed name.
Maomi will generate a static CSS file for each crate.
To get the output CSS file, specify the output path in Cargo.toml.
If "css-out-mode" is configured to "debug", the generated CSS will be easier to read.
The CSS output is in the specified "css-out-dir". Generated file name is "[CRATE_NAME].css". Use it in HTML head:
This two options can be override by environment variables "MAOMI_CSS_OUT_DIR" and "MAOMI_CSS_OUT_MODE".