Skip to main content

ferro_json_ui/assets/
mod.rs

1//! Embedded static assets for ferro-json-ui.
2//!
3//! Served by the framework via the automatically-registered
4//! `GET /_ferro/ferro-base.css` route. Embedded at compile time —
5//! no runtime file I/O.
6
7pub(crate) mod quill;
8
9/// Pre-built Tailwind CSS covering every utility class emitted by
10/// ferro-json-ui components.
11///
12/// Regenerate with `scripts/gen-ferro-base-css.sh` after adding or
13/// modifying components that introduce new utility classes.
14pub const FERRO_BASE_CSS: &str = include_str!("../../assets/ferro-base.css");
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19
20    #[test]
21    #[allow(clippy::const_is_empty)]
22    fn ferro_base_css_non_empty() {
23        assert!(!FERRO_BASE_CSS.is_empty(), "embedded CSS must not be empty");
24        // include_str! guarantees valid UTF-8 (compile error otherwise),
25        // so runtime validation is unnecessary. Smoke-check a class that
26        // every ferro-json-ui page relies on:
27        assert!(
28            FERRO_BASE_CSS.contains("flex"),
29            "expected `flex` utility in generated CSS"
30        );
31    }
32}