#[derive(Debug, Clone, schemars::JsonSchema)]
pub struct JsonUiConfig {
pub tailwind_cdn: bool,
pub custom_head: Option<String>,
pub body_class: String,
}
impl Default for JsonUiConfig {
fn default() -> Self {
Self {
tailwind_cdn: true,
custom_head: None,
body_class: "dark bg-background text-text font-sans".to_string(),
}
}
}
impl JsonUiConfig {
pub fn new() -> Self {
Self::default()
}
pub fn tailwind_cdn(mut self, enabled: bool) -> Self {
self.tailwind_cdn = enabled;
self
}
pub fn custom_head(mut self, head: impl Into<String>) -> Self {
self.custom_head = Some(head.into());
self
}
pub fn body_class(mut self, class: impl Into<String>) -> Self {
self.body_class = class.into();
self
}
}