pub struct JsonUiConfig {
pub tailwind_cdn: bool,
pub stylesheet_urls: Vec<String>,
pub custom_head: Option<String>,
pub body_class: String,
}Expand description
Configuration for JSON-UI HTML rendering.
§Example
use ferro_json_ui::JsonUiConfig;
// Default: framework-served base CSS with cache-busting version, no Tailwind CDN.
let default_config = JsonUiConfig::new();
assert!(default_config.stylesheet_urls[0].starts_with("/_ferro/ferro-base.css"));
assert!(!default_config.tailwind_cdn);
// Opt into CDN for dev, and override stylesheet list:
let dev_config = JsonUiConfig::new()
.tailwind_cdn(true)
.stylesheet_urls(vec!["/custom.css".to_string()]);Fields§
§tailwind_cdn: boolInclude Tailwind CDN link in rendered HTML (dev convenience).
Default: false. Set to true to load the Tailwind v4 browser runtime
from cdn.jsdelivr.net. The runtime is a development convenience per
Tailwind’s docs — it does not work reliably on Safari/WebKit. Production
apps rely on the pre-built base CSS served via stylesheet_urls.
stylesheet_urls: Vec<String>Stylesheet URLs emitted as <link rel="stylesheet" href="..."> in <head>,
in order.
Default: vec!["/_ferro/ferro-base.css".to_string()] — the framework-served
pre-built base CSS. Apps override this list to inject additional stylesheets
(e.g., app-level theme token files) or to drop the default entirely.
custom_head: Option<String>Custom content to inject into the <head> element.
body_class: StringDefault CSS classes for the <body> element.
Implementations§
Source§impl JsonUiConfig
impl JsonUiConfig
Sourcepub fn tailwind_cdn(self, enabled: bool) -> Self
pub fn tailwind_cdn(self, enabled: bool) -> Self
Enable or disable Tailwind CDN inclusion.
Sourcepub fn stylesheet_urls(self, urls: Vec<String>) -> Self
pub fn stylesheet_urls(self, urls: Vec<String>) -> Self
Replace the stylesheet URL list.
Each URL emits a <link rel="stylesheet" href="..."> in <head>, in order.
Default: ["/_ferro/ferro-base.css"].
Pass an empty Vec to disable the framework-served base CSS.
Sourcepub fn custom_head(self, head: impl Into<String>) -> Self
pub fn custom_head(self, head: impl Into<String>) -> Self
Set custom content to inject into the <head> element.
Sourcepub fn body_class(self, class: impl Into<String>) -> Self
pub fn body_class(self, class: impl Into<String>) -> Self
Set the default CSS classes for the <body> element.
Trait Implementations§
Source§impl Clone for JsonUiConfig
impl Clone for JsonUiConfig
Source§fn clone(&self) -> JsonUiConfig
fn clone(&self) -> JsonUiConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonUiConfig
impl Debug for JsonUiConfig
Source§impl Default for JsonUiConfig
impl Default for JsonUiConfig
Source§impl JsonSchema for JsonUiConfig
impl JsonSchema for JsonUiConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more