pub struct ElementStyle {Show 22 fields
pub padding: Option<PaddingValue>,
pub background: Option<BackgroundValue>,
pub corner_radius: Option<f64>,
pub opacity: Option<f64>,
pub frame: Option<FrameConfig>,
pub border: Option<BorderConfig>,
pub shadow: Option<ShadowConfig>,
pub clip_shape: Option<ClipShape>,
pub flex: Option<f64>,
pub privacy_sensitive: Option<bool>,
pub accessibility_label: Option<String>,
pub bind: Option<BTreeMap<String, String>>,
pub margin: Option<PaddingValue>,
pub aspect_ratio: Option<f64>,
pub layout_priority: Option<f64>,
pub offset_x: Option<f64>,
pub offset_y: Option<f64>,
pub rotation: Option<f64>,
pub scale: Option<f64>,
pub accentable: Option<bool>,
pub when: Option<Value>,
pub transition: Option<Transition>,
}Expand description
Shared visual style applied to any element (padding, background, frame, …).
Fields§
§padding: Option<PaddingValue>Inset padding (number or per-edge object).
background: Option<BackgroundValue>Solid, adaptive, or gradient background.
corner_radius: Option<f64>Corner radius in points.
opacity: Option<f64>Opacity from 0 (invisible) to 1 (opaque).
frame: Option<FrameConfig>Explicit width / height / max constraints.
border: Option<BorderConfig>Border color and width.
shadow: Option<ShadowConfig>Drop shadow.
clip_shape: Option<ClipShape>Clip content to a shape (e.g. circle avatar from square image).
flex: Option<f64>Layout weight for flexible sizing inside stacks (like Android layout_weight).
privacy_sensitive: Option<bool>Hide this content where the OS redacts private data (iOS / macOS locked screen, StandBy). Ignored where no redaction exists.
accessibility_label: Option<String>Text read by screen readers instead of the visible content.
bind: Option<BTreeMap<String, String>>Set fields from data with their JSON type: {"value": "data.progress"}.
Use for numbers / booleans / arrays ({{…}} only fills strings).
margin: Option<PaddingValue>Outer spacing (number or per-edge object), outside background and border.
aspect_ratio: Option<f64>Keep width / height at this ratio (1 = square).
layout_priority: Option<f64>Who keeps its size in a crowded stack: higher first. Default 0.
offset_x: Option<f64>Move right by points after layout (does not affect siblings).
offset_y: Option<f64>Move down by points after layout (does not affect siblings).
rotation: Option<f64>Rotate by degrees (clockwise).
scale: Option<f64>Scale factor (1 = unchanged).
accentable: Option<bool>Apple tinted / accented Home Screen: draw this part in the accent color
(widgetAccentable). Ignored elsewhere.
when: Option<Value>Show only when the condition holds ({"path": "data.n", "gt": 0}; see
crate::resolve). Removed before rendering.
transition: Option<Transition>How this element changes between timeline entries / redraws (a hint):
numeric animates digits, opacity cross-fades, slide pushes from the bottom.
Apple and desktop animate; Android and Adaptive Cards ignore it.
Trait Implementations§
Source§impl Clone for ElementStyle
impl Clone for ElementStyle
Source§impl Debug for ElementStyle
impl Debug for ElementStyle
Source§impl Default for ElementStyle
impl Default for ElementStyle
Source§impl<'de> Deserialize<'de> for ElementStyle
impl<'de> Deserialize<'de> for ElementStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ElementStyle
Available on crate feature schema only.
impl JsonSchema for ElementStyle
schema only.Source§fn schema_name() -> String
fn schema_name() -> String
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 is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more