pub struct Attributes {Show 181 fields
pub width: Option<LengthSpec>,
pub height: Option<LengthSpec>,
pub flex: Option<FlexAxis>,
pub bg: Option<BgSpec>,
pub radius: Option<f32>,
pub radius_corners: Option<[f32; 4]>,
pub padding: Option<Edges>,
pub margin: Option<Edges>,
pub text: Option<String>,
pub text_color: Option<Rgba>,
pub selection_color: Option<Rgba>,
pub caret_color: Option<Rgba>,
pub selection_text_color: Option<Rgba>,
pub scroll: Option<ScrollAxisSpec>,
pub sensitivity: Option<f32>,
pub inertia: Option<f32>,
pub tab_index: Option<i32>,
pub id: Option<String>,
pub classes: Vec<String>,
pub hover_bg: Option<Rgba>,
pub draggable: bool,
pub drag_payload: Option<String>,
pub drop_accept: Option<String>,
pub placeholder: Option<String>,
pub drop_target: bool,
pub title_bar_drag: bool,
pub layout_boundary: bool,
pub tooltip: Option<TooltipSpec>,
pub tab_strip: Option<(String, String)>,
pub signal_seed: Option<(String, String)>,
pub src: Option<String>,
pub alt: Option<String>,
pub href: Option<String>,
pub font_size: Option<f32>,
pub font_family: Option<String>,
pub font_weight: Option<u16>,
pub style_role: Option<String>,
pub gap: Option<f32>,
pub gap_row: Option<f32>,
pub gap_column: Option<f32>,
pub gap_pct: Option<f32>,
pub gap_row_pct: Option<f32>,
pub gap_column_pct: Option<f32>,
pub display: Option<DisplaySpec>,
pub grid_template: Option<GridTemplateSpec>,
pub grid_row: Option<(i16, i16)>,
pub grid_column: Option<(i16, i16)>,
pub align_self: Option<FlexAlign>,
pub justify_items: Option<FlexAlign>,
pub justify_self: Option<FlexAlign>,
pub grow: Option<f32>,
pub align: Option<FlexAlign>,
pub justify: Option<FlexJustify>,
pub text_align: Option<TextAlignSpec>,
pub press_bg: Option<Rgba>,
pub hover_text_color: Option<Rgba>,
pub active_text_color: Option<Rgba>,
pub focus_text_color: Option<Rgba>,
pub disabled_text_color: Option<Rgba>,
pub hover_opacity: Option<f32>,
pub active_opacity: Option<f32>,
pub focus_opacity: Option<f32>,
pub disabled_opacity: Option<f32>,
pub hover_shadows: Option<Vec<ShadowSpec>>,
pub active_shadows: Option<Vec<ShadowSpec>>,
pub focus_shadows: Option<Vec<ShadowSpec>>,
pub disabled_shadows: Option<Vec<ShadowSpec>>,
pub focus_visible_text_color: Option<Rgba>,
pub focus_visible_opacity: Option<f32>,
pub focus_visible_shadows: Option<Vec<ShadowSpec>>,
pub drag_over_bg: Option<Rgba>,
pub drag_over_text_color: Option<Rgba>,
pub drag_over_opacity: Option<f32>,
pub drag_over_shadows: Option<Vec<ShadowSpec>>,
pub focus_outline: Option<OutlineSpec>,
pub focus_visible_outline: Option<OutlineSpec>,
pub outline_offset: Option<f32>,
pub knob_color: Option<Rgba>,
pub border_width: Option<Edges>,
pub border_color: Option<Rgba>,
pub border_color_top: Option<Rgba>,
pub border_color_right: Option<Rgba>,
pub border_color_bottom: Option<Rgba>,
pub border_color_left: Option<Rgba>,
pub border_style: Option<BorderStyleSpec>,
pub box_sizing: Option<BoxSizingSpec>,
pub hover_border: Option<BorderPaintSpec>,
pub focus_border: Option<BorderPaintSpec>,
pub shrink: Option<f32>,
pub basis: Option<LengthSpec>,
pub flex_wrap: Option<FlexWrapSpec>,
pub align_content: Option<AlignContentSpec>,
pub z_index: Option<i32>,
pub checked: Option<bool>,
pub autofocus: bool,
pub default_button: bool,
pub indeterminate: bool,
pub radio_group: Option<String>,
pub radio_value: Option<String>,
pub progress_duration: Option<u32>,
pub part: Option<WidgetPart>,
pub widget: Option<WidgetRole>,
pub checked_bg: Option<Rgba>,
pub selected_bg: Option<Rgba>,
pub disabled: bool,
pub disabled_bg: Option<Rgba>,
pub value: Option<f32>,
pub min: Option<f32>,
pub max: Option<f32>,
pub step: Option<f32>,
pub bind: Option<BindSpec>,
pub bind_disabled: Option<String>,
pub bind_scroll: Option<String>,
pub each: Option<String>,
pub key: Option<String>,
pub virtualized: bool,
pub row_height: Option<f32>,
pub if_signal: Option<String>,
pub if_eq: Option<String>,
pub if_mode: IfModeSpec,
pub text_wrap: Option<TextWrapSpec>,
pub max_lines: Option<u32>,
pub text_overflow: Option<TextOverflowSpec>,
pub position: Option<PositionSpec>,
pub inset: Option<Edges>,
pub min_width: Option<LengthSpec>,
pub min_height: Option<LengthSpec>,
pub max_width: Option<LengthSpec>,
pub max_height: Option<LengthSpec>,
pub aspect_ratio: Option<f32>,
pub overflow: Option<OverflowSpec>,
pub overflow_x: Option<OverflowSpec>,
pub overflow_y: Option<OverflowSpec>,
pub image_fit: Option<ImageFitSpec>,
pub bg_fit: Option<ImageFitSpec>,
pub scrollbar_color: Option<(Rgba, Option<Rgba>)>,
pub scrollbar_width: Option<ScrollbarWidthSpec>,
pub shadows: Vec<ShadowSpec>,
pub opacity: Option<f32>,
pub transitions: Vec<TransitionIr>,
pub transition_property: Option<Vec<TransitionPropertyIr>>,
pub transition_duration: Option<Vec<u32>>,
pub transition_timing: Option<Vec<EasingIr>>,
pub required: bool,
pub pattern: Option<String>,
pub multiline: Option<bool>,
pub dropdown_button: Option<DropdownButtonSpec>,
pub dropdown_option: Option<(String, String, String)>,
pub menu_item: Option<(String, String)>,
pub popup_panel: Option<String>,
pub dir: Option<LayoutDirection>,
pub translatable: Option<String>,
pub format: Option<String>,
pub lang: Option<String>,
pub bind_self_text: Option<String>,
pub bind_self_value: Option<String>,
pub bind_self_checked: Option<String>,
pub bind_parent_text: Option<String>,
pub bind_parent_value: Option<String>,
pub bind_parent_checked: Option<String>,
pub knob_inset: Option<f32>,
pub thumb_size: Option<f32>,
pub popup_gap: Option<f32>,
pub progress_chunk: Option<f32>,
pub disabled_opacity_default: Option<f32>,
pub caret_width: Option<f32>,
pub caret_blink_ms: Option<u32>,
pub password_character: Option<char>,
pub line_height: Option<LineHeightSpec>,
pub scrollbar_thickness: Option<f32>,
pub scrollbar_thickness_thin: Option<f32>,
pub scrollbar_margin: Option<f32>,
pub scrollbar_min_thumb: Option<f32>,
pub scrollbar_track_hover: Option<Rgba>,
pub scrollbar_hover_boost: Option<f32>,
pub scrollbar_fade_delay_ms: Option<u32>,
pub scrollbar_fade_duration_ms: Option<u32>,
pub markup_styles: Vec<(String, String)>,
pub slot_name: Option<String>,
pub deferred: Vec<DeferredAttr>,
pub widget_attributes: Option<Vec<(String, String)>>,
}Expand description
Resolved attribute bag; one struct so the parser fills it in a single pass and the spawner / codegen don’t have to re-parse strings.
Fields§
§width: Option<LengthSpec>width attribute.
height: Option<LengthSpec>height attribute.
flex: Option<FlexAxis>flex attribute (row / column).
bg: Option<BgSpec>bg attribute (background color).
radius: Option<f32>radius attribute in px (uniform).
radius_corners: Option<[f32; 4]>Per-corner radii [top-left, top-right, bottom-right, bottom-left] in px - the CSS border-radius 2-4 value
shorthand and the border-top-left-radius … longhands. When
set, wins over the uniform Self::radius for paint; the
uniform slot is kept in sync (max corner) for the runtime paths
that only understand one number (knob geometry, hit rings).
padding: Option<Edges>padding attribute.
margin: Option<Edges>margin attribute.
text: Option<String>text content (also accepts text child node).
text_color: Option<Rgba>text-color.
selection_color: Option<Rgba>selection-color - text selection highlight. Skins default it
via the --lumen-selection token; unset falls back to the
renderer default (text fill at 32 % alpha).
caret_color: Option<Rgba>caret-color - text-input caret tint (CSS). Lands on
lumen_core::components::TextInputPaint::caret_color; unset
falls back to the text fill (web default). Only meaningful on
<input> / <textarea>.
selection_text_color: Option<Rgba>selection-text-color - selected-glyph foreground (Qt
QPalette::HighlightedText / Slint selection-foreground-color).
Lands on
lumen_core::components::TextInputPaint::selection_foreground;
unset => selected glyphs keep their normal fill. Only meaningful on
<input> / <textarea>.
scroll: Option<ScrollAxisSpec>scroll axis.
sensitivity: Option<f32>sensitivity (scroll containers only).
inertia: Option<f32>inertia (scroll containers only).
tab_index: Option<i32>tab-index.
id: Option<String>id="..." - emits a LumenId marker.
classes: Vec<String>class="a b" - emits a LumenClasses marker (split on whitespace).
hover_bg: Option<Rgba>hover-bg - when set, the entity gains a HoverTint component
whose value the primitives crate swaps in on hover.
draggable: booldraggable="true" - entity gains a Draggable marker so drag
moves translate its Transform automatically.
drag_payload: Option<String>drag-payload="..." - makes the entity an in-app DnD
DragSource publishing this text
payload (interpolated per-row inside a <for>). An empty value
derives the payload from the element’s id. Mirrors HTML5
dataTransfer.setData / Qt QMimeData.
drop_accept: Option<String>accept="text/plain" on a drop target - MIME filter
(DropAccept). Absent = accept any.
placeholder: Option<String>placeholder="..." on <input> - shown when [text] is empty.
drop_target: booldrop="true" - entity gains a DropTarget marker so OS file
drags landing on its bounds fire on_file_dropped(id, path).
title_bar_drag: booldrag="true" on <title-bar> - entity gains a
TitleBarDraggable marker. Pressing the bar requests a native
window drag via the platform backend. Only meaningful in
conjunction with <root frameless="true">.
layout_boundary: boollayout-boundary="true" - entity gains a RelayoutBoundary
marker so layout-dirty propagation stops here. Auto-set for
<scroll> containers and entities with both fixed width and
height; the explicit attribute lets authors override.
tooltip: Option<TooltipSpec>Tooltip spec carried by the single child of a <tooltip text="..." delay="..."> element after the parser flattens the
wrapper away. None = no tooltip. Spawns a TooltipSource
component at spawn time.
tab_strip: Option<(String, String)>Synthetic tab-strip-button attachment generated by the
<tabs> parser pass: (signal_name, tab_value). When set,
spawn attaches a TabStripButton component so clicking the
button writes signal_name = tab_value.
signal_seed: Option<(String, String)>Synthetic “seed this signal on first spawn if absent”
directive. (signal_name, default_value). The <tabs> pass
authors it for the default-active tab, and the <dropdown>
pass for the open-panel flag plus (on the generated header
button) the first option’s value.
src: Option<String>src="path/to/file.png" on <image> - kicks off an async
decode via lumen-assets. The entity gets a LoadedImage
once the bytes are ready.
alt: Option<String>alt="a cat asleep on a keyboard" on <image> - what the image
shows, for a reader who is not looking at it. The web target writes
it out as the alt attribute; nothing on the desktop reads it yet.
An alt="" an author wrote deliberately is kept as an empty string,
which is how a decorative image is marked. A translatable="<key>"
on the same element resolves it through <key>.alt.
href: Option<String>href="settings" on <a> - the target page path for file-based
navigation. The spawner attaches an Anchor component so a click
on the element navigates the active page. Resolved by longest
existing .lmn prefix at navigation time, never here.
font_size: Option<f32>font-size="N" - pixel size for rendered text. Inherited
implicitly via the TextStyle component; absent = 16px.
font_family: Option<String>CSS font-family - the raw family list as authored (commas
preserved, quotes stripped per-name at spawn). Inherited like
font-size. The shaper resolves the first available family in
the list against the system font database, honouring the CSS
generic keywords (sans-serif, serif, monospace, …); an
unresolvable list falls back to the platform sans-serif.
font_weight: Option<u16>CSS font-weight - 100..=1000, normal (400), bold (700).
Inherited. None = 400.
style_role: Option<String>style="display-lg" - Material 3-style typography role. The
parser resolves the role to a concrete pixel size + sets
[font_size] if it isn’t already explicit.
gap: Option<f32>gap="12" - spacing inserted between every adjacent pair of
children inside a flex container. Mirrors CSS gap (px).
gap_row: Option<f32>row-gap="12" - per-axis row gap (W5.9).
gap_column: Option<f32>column-gap="12" - per-axis column gap (W5.9).
gap_pct: Option<f32>CSS gap: 5% - percent gap on both axes. Wins over Self::gap
for the axis; resolves against the container’s content box.
gap_row_pct: Option<f32>CSS row-gap: 5%.
gap_column_pct: Option<f32>CSS column-gap: 5%.
display: Option<DisplaySpec>display="grid|flex|none" (W5.9). When None the spawner
defaults to Display::Flex.
grid_template: Option<GridTemplateSpec>Parsed grid-template-rows + grid-template-columns (W5.9).
grid_row: Option<(i16, i16)>grid-row="<start> <end>" (W5.9). (0, 0) = auto-place.
grid_column: Option<(i16, i16)>grid-column="<start> <end>" (W5.9).
align_self: Option<FlexAlign>align-self="..." (W5.9 - per-item override of container align).
justify_items: Option<FlexAlign>justify-items="..." (W5.9 - grid-only inline-axis alignment).
justify_self: Option<FlexAlign>justify-self="..." (W5.9 - per-item override of justify-items).
grow: Option<f32>grow="1" - flex-grow factor. Mirrors CSS flex-grow. Default
0 (no grow). <spacer /> sets this to 1 implicitly so it
pushes neighbouring elements to opposite edges.
align: Option<FlexAlign>align="center|start|end|stretch" - cross-axis alignment of children
(CSS align-items).
justify: Option<FlexJustify>justify="center|start|end|between|around|evenly" - main-axis
distribution of children (CSS justify-content).
text_align: Option<TextAlignSpec>text-align="start|center|end" - horizontal alignment of rendered
text inside the element’s content rectangle.
press_bg: Option<Rgba>press-bg="#color" - color shown while the entity is pressed.
hover_text_color: Option<Rgba>:hover { text-color } - text color swapped in while hovered.
active_text_color: Option<Rgba>:active { text-color } - text color while pressed.
focus_text_color: Option<Rgba>:focus { text-color } - text color while focused.
disabled_text_color: Option<Rgba>:disabled { text-color } - text color while disabled (applied
at spawn alongside the Disabled marker).
hover_opacity: Option<f32>:hover { opacity }.
active_opacity: Option<f32>:active { opacity }.
focus_opacity: Option<f32>:focus { opacity }.
disabled_opacity: Option<f32>:disabled { opacity } - e.g. adwaita’s documented 50 %-opacity
disabled controls.
hover_shadows: Option<Vec<ShadowSpec>>:hover { box-shadow } - shadow stack swapped in while hovered.
active_shadows: Option<Vec<ShadowSpec>>:active { box-shadow }.
focus_shadows: Option<Vec<ShadowSpec>>:focus { box-shadow } - e.g. the WinUI TextBox focus underline.
disabled_shadows: Option<Vec<ShadowSpec>>:disabled { box-shadow } (applied at spawn).
focus_visible_text_color: Option<Rgba>:focus-visible { text-color } - keyboard-only focus text swap.
focus_visible_opacity: Option<f32>:focus-visible { opacity }.
focus_visible_shadows: Option<Vec<ShadowSpec>>:focus-visible { box-shadow } - e.g. the inner ring of the
Windows keyboard-only double focus ring.
drag_over_bg: Option<Rgba>:drag-over { bg } - fill swapped in while an acceptable in-app
drag hovers this drop target (HTML5 dragover parity). Gated by
the runtime DropHovered marker via StateVisuals::drag_over.
drag_over_text_color: Option<Rgba>:drag-over { text-color }.
drag_over_opacity: Option<f32>:drag-over { opacity }.
drag_over_shadows: Option<Vec<ShadowSpec>>:drag-over { box-shadow } - e.g. an inset ring lighting up the
hovered drop zone.
focus_outline: Option<OutlineSpec>focus-outline="<width> <#color>" - stroke ring rendered while
the entity has focus.
focus_visible_outline: Option<OutlineSpec>:focus-visible { outline: ... } - stroke ring rendered only when
focus arrived via the keyboard (Tab / Shift-Tab), mirroring the
CSS :focus-visible heuristic. Pointer-driven focus does not
paint it. When both this and Self::focus_outline are set the
keyboard-only ring wins while the FocusVisible marker is
present.
outline_offset: Option<f32>CSS outline-offset in px - gap between the border box edge and
the focus outline. Folded into the outline specs at spawn.
knob_color: Option<Rgba>knob-color="#color" / CSS knob-color: - fill of the toggle
knob / slider thumb child. Lumen-native analog property (real
CSS has no reachable pseudo-element for it in our subset);
absent = the runtime KNOB_FILL fallback.
border_width: Option<Edges>CSS border-width (and the width part of the border
shorthand): per-side widths in px. Participates in layout per the
CSS box model and paints when Self::border_style is solid.
border_color: Option<Rgba>CSS border-color (the uniform base color for all four sides).
border_color_top: Option<Rgba>CSS border-top-color - per-side override of Self::border_color.
border_color_right: Option<Rgba>CSS border-right-color.
border_color_bottom: Option<Rgba>CSS border-bottom-color - the Windows elevation bottom edge.
border_color_left: Option<Rgba>CSS border-left-color.
border_style: Option<BorderStyleSpec>CSS border-style (none | solid). Per CSS, no style => no
border: the computed border-width is zero and nothing paints.
The border: shorthand always sets this explicitly.
box_sizing: Option<BoxSizingSpec>CSS box-sizing. None = the Lumen UA default (border-box).
hover_border: Option<BorderPaintSpec>:hover { border: ... } / hover-border: - border swapped in
while the pointer hovers the entity.
focus_border: Option<BorderPaintSpec>:focus { border: ... } / focus-border: - border swapped in
while the entity has keyboard focus. Wins over
Self::hover_border when both states are active.
shrink: Option<f32>CSS flex-shrink. None = the CSS initial value 1.
basis: Option<LengthSpec>CSS flex-basis. None = auto.
flex_wrap: Option<FlexWrapSpec>CSS flex-wrap. None = nowrap.
align_content: Option<AlignContentSpec>CSS align-content - cross-axis distribution of wrapped flex
lines / grid tracks.
z_index: Option<i32>CSS z-index - sibling paint-order override. None = auto.
checked: Option<bool>checked="true|false" on <toggle> - initial state.
autofocus: boolautofocus="true" - when the containing <dialog> opens, this
element receives initial focus (HTML autofocus / Qt
setFocus on show).
<button default="true"> - the dialog’s DEFAULT button: Enter
anywhere in the dialog (except on another button / an
Enter-consuming input) activates it, and closing through it
fires the accepted (not rejected) hook. Also appends the
default class so skins can style button.default.
indeterminate: bool<checkbox indeterminate="true"> - tri-state dash until the
first user toggle clears it (web indeterminate IDL attr / Qt
PartiallyChecked).
radio_group: Option<String><radio group="..."> - the PropertyStore global holding the
radio group’s selected value.
radio_value: Option<String><radio value="..."> - this member’s (string) value. The shared
value attribute parses as f32 for sliders/progress; radios
route it here instead.
progress_duration: Option<u32><progress duration="..."> / CSS progress-duration - the
indeterminate sweep period in ms (skin token
--lumen-progress-period).
part: Option<WidgetPart>Synthetic widget-part marker set by the parser desugars so the
spawn layer can attach the matching runtime marker component to
a child element (.checkbox-box / .radio-dot /
.progress-fill).
widget: Option<WidgetRole>The authored widget this element came out of, for the desugars that
replace a widget tag with plain boxes (WidgetRole). A surface that
can express the widget directly reads this and writes the widget back;
the runtime spawner ignores it, because the boxes beside it are already
the widget it would build.
checked_bg: Option<Rgba>:checked { bg: ... } CSS - track fill shown while a <toggle>
is checked. Absent = the built-in accent fill.
selected_bg: Option<Rgba>:selected { bg: ... } CSS - fill shown on a <tabs> strip button
while it carries the lumen_core::components::Selected marker.
Absent = the built-in accent fill (same default-skin fallback
pattern as Self::checked_bg).
disabled: booldisabled="true" - entity spawns with the Disabled marker;
input routing skips it and the default render dims it.
disabled_bg: Option<Rgba>:disabled { bg: ... } CSS - fill shown while the entity is
disabled. Absent = reduced-opacity render of the normal fill.
value: Option<f32>value="0.5" on <slider> - initial slider value.
min: Option<f32>min="0" on <slider> - lower bound.
max: Option<f32>max="1" on <slider> - upper bound.
step: Option<f32>step="0.1" on <slider> - keyboard / wheel increment.
Absent = (max - min) / 100.
bind: Option<BindSpec>bind="text:signal_name" - declarative reactive binding to a named Signals entry. Only the text: prefix is recognised.
bind_disabled: Option<String>bind-disabled="signal" - one-way binding driving the Disabled
marker from a boolean signal so scripts can enable / disable the
widget live. Stored apart from Self::bind so it can coexist
with bind-checked / bind-value / bind-text on one element.
bind_scroll: Option<String>bind-scroll="signal" on a scroll container - two-way binding
between an f32 signal (logical px) and the container’s vertical
scroll offset (W6 T6). Stored apart from Self::bind (same
coexistence rule as bind_disabled).
each: Option<String>each="rows" on <for> - name of the ArraySignals entry to
iterate. The element’s inline children are the per-item body
template; {field} placeholders inside their attrs / text get
replaced at reconcile time with the matching record field.
key: Option<String>key="id" on <for> - record field used as the stable reconciliation key. Without it the reconciler keys rows by item index.
virtualized: bool<for virtualized="true"> - spawn only rows in the visible scroll window. Requires a <scroll> ancestor for the reconciler to compute the visible band.
row_height: Option<f32><for row-height="32"> - pixel height per virtualized row.
Required when Self::virtualized is true; defaults to 32 px
at spawn when the attr is absent.
if_signal: Option<String>signal="loaded" on <if> - name of the Signals entry whose
truthiness gates the subtree. Truthy = non-empty AND not literal
"false" / "0". Toggle spawns / despawns body on next tick.
if_eq: Option<String>eq="value" on <if> - when set, the body mounts iff
Signals[if_signal] == eq. Used by <tabs> to switch the
active tab body; None falls back to truthiness.
if_mode: IfModeSpecmode="render|hide" on <if> - pick the reconciler policy.
render (default) despawns/respawns the body each toggle;
hide mounts once and flips a Visible flag, preserving focus
/ scroll / per-row signals across show-hide cycles.
text_wrap: Option<TextWrapSpec>wrap="none|word|glyph" - text wrap policy. Default is none
(overflow clips horizontally).
max_lines: Option<u32>max-lines="N" - hard cap on rendered line count for wrapped text.
text_overflow: Option<TextOverflowSpec>CSS text-overflow: ellipsis | clip (or wrap="ellipsis" in
markup). Ellipsis elides overflowing single-line text with a
trailing ...; the spawn layer lowers it onto the runtime
TextStyle as glyph-wrap + max_lines = 1 unless the author
supplied an explicit wrap / max-lines pair (multi-line clamp,
which the shaper already ellipsizes). Not inherited (CSS
text-overflow doesn’t inherit either).
position: Option<PositionSpec>position="relative|absolute" - CSS-style positioning mode.
inset: Option<Edges>inset="t r b l" (or 1/2/3-value shorthand) - offsets from each
edge for position="absolute".
min_width: Option<LengthSpec>min-width="...".
min_height: Option<LengthSpec>min-height="...".
max_width: Option<LengthSpec>max-width="...".
max_height: Option<LengthSpec>max-height="...".
aspect_ratio: Option<f32>aspect-ratio="1.5" - width / height constraint.
overflow: Option<OverflowSpec>overflow="visible|hidden|scroll" - sets both axes. Use
overflow-x / overflow-y to set per axis.
overflow_x: Option<OverflowSpec>overflow-x.
overflow_y: Option<OverflowSpec>overflow-y.
image_fit: Option<ImageFitSpec>fit="fill|cover|contain|none|scale-down" on <image> -
CSS object-fit.
bg_fit: Option<ImageFitSpec>bg-fit - how a bg: url(...) image fills the element’s box. Takes
the Self::image_fit values; None means cover.
scrollbar_color: Option<(Rgba, Option<Rgba>)>CSS scrollbar-color: <thumb> [<track>] (Scrollbars Styling
Level 1) - overlay-bar thumb + optional track fills for <scroll>
containers. None = the runtime’s ScrollbarStyle default.
scrollbar_width: Option<ScrollbarWidthSpec>CSS scrollbar-width: auto | thin | none (Scrollbars Styling
Level 1).
shadows: Vec<ShadowSpec>shadow="<x> <y> <blur> <#color>" - drop shadow.
opacity: Option<f32>opacity="0.5" - alpha multiplier in [0, 1]. Absent = 1.0.
transitions: Vec<TransitionIr>CSS transition: <property> <duration> [<easing>] [, ...] declarations. Each entry tweens the property instead of snapping when the value changes.
Animatable in v1: opacity, background-color/bg,
color/text-color, border-color. Layout properties (width,
height, …) are rejected with a warn - see TransitionPropertyIr.
transition_property: Option<Vec<TransitionPropertyIr>>CSS transition-property longhand - comma list of property
names. Combined with the duration / timing longhands by
Attributes::effective_transitions.
transition_duration: Option<Vec<u32>>CSS transition-duration longhand - comma list of durations in
ms, cycled over the property list per the CSS repeat rule.
transition_timing: Option<Vec<EasingIr>>CSS transition-timing-function longhand - comma list of easing
curves, cycled over the property list.
required: boolrequired="true" - form-field validity gate.
pattern: Option<String>pattern="<substring>" - content must contain this literal
substring to be valid. Values prefixed shape: are reserved for
the built-in structural checks the parser attaches to
<date-picker> (shape:date) and <time-picker>
(shape:time); see lumen_primitives::validation.
multiline: Option<bool>multiline="true" - text input accepts newlines. <textarea> defaults to true; <input> defaults to false.
Synthesised by the <dropdown> parser pass on the header
button. The runtime attaches a [lumen_primitives::DropdownButton]
whose click flips the open signal and whose option metadata
drives closed-combobox keyboard interaction (Up/Down value
stepping, Alt+Down open, type-ahead) before the lazily-mounted
panel body exists.
dropdown_option: Option<(String, String, String)>Synthesised per <option> inside <dropdown>: (value_signal, value, open_signal). The runtime attaches a [lumen_primitives::DropdownOptionButton] whose click writes the value and closes the panel.
Synthesised per <menuitem> inside <menu>: (open_signal, item_id). The runtime attaches a [lumen_primitives::MenuItemButton] whose click emits MenuClicked { id: item_id } and closes the menu.
popup_panel: Option<String>Synthesised on the floating panel of a <dropdown> / <menu>:
the open-state signal (__dropdown_open:* / __menu_open:*).
The runtime attaches a [lumen_primitives::PopupPanel] so the
outside-click dismissal and viewport edge-flip systems can find
the panel and its bound open signal.
dir: Option<LayoutDirection>dir="ltr|rtl|auto" - CSS Logical Properties writing direction
(W5.4). When set, the spawn layer installs a
lumen_core::components::LayoutDirection component; the
resolve_layout_direction system then stamps a
lumen_core::components::ResolvedDirection on every descendant.
Serialized through layout_direction_serde because
lumen_core::components::LayoutDirection lives in a crate that
does not depend on serde; the proxy maps the three variants onto a
stable Option<u8> so the AOT artifact stays parser-independent.
translatable: Option<String>translatable="<key>" - names the catalogue message every string
this element shows comes from. The text is the message value,
falling back to the authored text and then to the key itself;
Self::placeholder and Self::alt come from the Fluent
attributes <key>.placeholder and <key>.alt, and only when the
markup authored them. The key stops standing in for a missing text
once the element names one of those, so an <input> marked for its
placeholder does not spawn with the key as its value.
crate::translate::translate is the rule, shared by the
spawn layer and the web emitter; lumenc i18n extract collects the
keys into locale/<lang>.ftl.
format: Option<String>format="<spec>" - formats the element’s text for the app’s
locale. The spec is one of number, currency:<code>, date,
time, datetime, relative; the text it applies to is
whatever the element ended up with, whether that is the authored
text, a translated string, or the value a bind-text signal
holds. A spec the formatter does not know, or text it cannot
read as the spec’s kind, leaves the text alone.
lang: Option<String>lang="<bcp47>" - BCP-47 language tag (W5.4). When set, the
spawn layer installs a lumen_core::components::Lang component
consumed by text shaping (cosmic-text) and AccessKit. Inherited
at runtime from the nearest ancestor when absent. format reads
the app’s locale, not this tag.
bind_self_text: Option<String>bind-text="$self.<field>" - per-entity text binding. The
field name (without the $self. prefix) lands here; the
spawn layer installs a lumen_core::components::BindSelfText
marker. Mutually exclusive with Self::bind for the same
kind - the dollar-prefixed forms desugar to this field instead
of the named-signal BindSpec. (W-signal-design step 1.)
bind_self_value: Option<String>bind-value="$self.<field>" - per-entity slider-value binding.
See Self::bind_self_text.
bind_self_checked: Option<String>bind-checked="$self.<field>" - per-entity toggle binding.
See Self::bind_self_text.
bind_parent_text: Option<String>bind-text="$parent.<field>" - parent-entity text binding.
The field name (without the $parent. prefix) lands here; the
spawn layer installs a lumen_core::components::BindParentText
marker. See Self::bind_self_text.
bind_parent_value: Option<String>bind-value="$parent.<field>" - parent-entity slider-value binding.
See Self::bind_parent_text.
bind_parent_checked: Option<String>bind-checked="$parent.<field>" - parent-entity toggle binding.
See Self::bind_parent_text.
knob_inset: Option<f32>knob-inset="2" / CSS knob-inset - gap in px between the knob
child’s edge and its track parent’s edge on <toggle> /
<switch>. Lumen-native analog property (mirrors Self::knob_color
in having no real CSS pseudo-element target); absent = the
runtime’s own inset constant.
thumb_size: Option<f32>thumb-size="20" / CSS thumb-size - diameter in px of the
<slider> thumb. Lumen-native analog property; absent = the
runtime’s own thumb-size constant.
popup_gap: Option<f32>popup-gap="4" / CSS popup-gap - offset in px between a
<dropdown> / <menu> trigger and its floating panel. Absent =
the runtime’s own gap constant.
progress_chunk: Option<f32>CSS progress-chunk - fraction of the track width (0.0 to
1.0) covered by the moving chunk of an indeterminate
<progress> sweep. Absent = the runtime’s own chunk-width
constant.
disabled_opacity_default: Option<f32>CSS disabled-opacity - alpha multiplier [0, 1] applied to a
disabled entity when neither Self::disabled_bg nor an
explicit :disabled { opacity } (Self::disabled_opacity) was
authored. Distinct from disabled_opacity: that field is the
per-element state-pseudo override, this field is the CSS-authored
replacement for the runtime’s own generic dimming fallback.
caret_width: Option<f32>caret-width="2" / CSS caret-width - stroke width in px of the
text-input caret. Absent = the runtime’s own caret-width constant.
Only meaningful on <input> / <textarea>.
caret_blink_ms: Option<u32>CSS caret-blink - full on/off blink period of the text-input
caret, in milliseconds. Accepts Nms or Ns. Absent = the
runtime’s own blink-period constant. Only meaningful on
<input> / <textarea>.
password_character: Option<char>CSS password-character - the glyph substituted for every
character of a masked (type="password"-equivalent) text input.
A single Unicode scalar value; absent = the runtime’s own default
mask glyph (typically * or a bullet).
line_height: Option<LineHeightSpec>CSS line-height - see LineHeightSpec for why the unitless
and px forms are kept distinct rather than folded into one number.
Inherited like Self::font_size. Absent = the runtime’s own
line-height ratio.
scrollbar_thickness: Option<f32>CSS scrollbar-thickness - width in px of the overlay scrollbar
track/thumb on <scroll> containers at scrollbar-width: auto.
Absent = the runtime’s own thickness constant.
scrollbar_thickness_thin: Option<f32>CSS scrollbar-thickness-thin - width in px of the overlay
scrollbar at scrollbar-width: thin. Absent = the runtime’s own
thin-thickness constant.
scrollbar_margin: Option<f32>CSS scrollbar-margin - gap in px between the scrollbar and the
container’s content edge. Absent = the runtime’s own margin
constant.
scrollbar_min_thumb: Option<f32>CSS scrollbar-min-thumb - minimum thumb length in px, so a very
long scrollable area still gets a grabbable thumb. Absent = the
runtime’s own minimum constant.
scrollbar_track_hover: Option<Rgba>CSS scrollbar-track-hover - track fill shown while the pointer
hovers the scrollbar. Lumen-native named property (mirrors
Self::hover_bg in being a distinct property rather than a
:hover { ... } pseudo rule, since the hover target is the
scrollbar part, not the whole element). Absent = no track tint on
hover.
scrollbar_hover_boost: Option<f32>CSS scrollbar-hover-boost - multiplier applied to the thumb
fill’s brightness while hovered, paired with
Self::scrollbar_track_hover. Absent = the runtime’s own boost
constant.
scrollbar_fade_delay_ms: Option<u32>CSS scrollbar-fade-delay - idle time before an overlay
scrollbar starts fading out, in milliseconds. Accepts Nms or
Ns. Absent = the runtime’s own delay constant.
scrollbar_fade_duration_ms: Option<u32>CSS scrollbar-fade-duration - length of the fade-out animation
itself, in milliseconds. Accepts Nms or Ns. Absent = the
runtime’s own duration constant.
markup_styles: Vec<(String, String)>Every styling attribute the element was given in markup, as
(property, value) in the order they were written. The property is
the one spelling the cascade files it under
(crate::css::canonical_style_property); the value is the text the
author wrote, unparsed.
The fields above hold the result of the cascade and say nothing about where a value came from, so this is the record of which surface set what. It exists because the two surfaces do not rank the same way everywhere: in Lumen a styling attribute outranks any rule that targets the element, while on the web a rule outranks nothing but an inline declaration. A target with the web’s ranking replays these as inline declarations so the author’s markup keeps winning.
slot_name: Option<String>name on a <slot> inside a fragment body: which of the use site’s
children lands here. Absent on a <slot> names the default slot
(crate::fragment::DEFAULT_SLOT), and absent on anything else
means the element is not a slot at all.
deferred: Vec<DeferredAttr>Attributes whose value carries a fragment parameter, held back until a use site supplies the arguments.
Most attribute values parse into typed layout data, which a
{parameter} marker is not, so a fragment body keeps the authored
text here instead and the compiler applies it once per instantiation.
Empty on every element outside a fragment body, and emptied on the
copy that reaches the tree.
widget_attributes: Option<Vec<(String, String)>>Every attribute an element with a registered custom tag was written
with, as (name, value) in the order they were written; None on an
element whose tag is built in.
The markup vocabulary cannot say what a custom widget’s attributes
mean, so the parser keeps them as authored and the spawner hands them
to the widget registered for the tag. Some with an empty list is a
custom element written without attributes, which still gets its
widget.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn effective_border(&self) -> Option<(Edges, Rgba)>
pub fn effective_border(&self) -> Option<(Edges, Rgba)>
Resolve the accumulated border-* longhands into the effective
CSS border, following the real cascade rules:
- no
border-style(orborder-style: none) => no border - the computed width of a styleless side is0(CSS Backgrounds & Borders section 3.2), soborder-width/border-coloralone paint nothing and consume no space; border-style: solid=> widths default to3px(CSSmedium) whenborder-widthis absent, and the color falls back tocurrentColor- approximated by the element’stext-colorwhen authored, else opaque black (the CSS initialcolor).
Returns (widths, color) for the solid case; None otherwise.
The color is the uniform base - per-side overrides
(border-top-color …) are resolved by
Self::effective_border_colors.
Sourcepub fn effective_border_colors(&self, base: Rgba) -> Option<[Rgba; 4]>
pub fn effective_border_colors(&self, base: Rgba) -> Option<[Rgba; 4]>
Per-side border colors [top, right, bottom, left]: each side
takes its longhand (border-top-color …) when authored, else
the uniform base. Returns None when no side differs from the
base, so the uniform fast path stays intact downstream.
Sourcepub fn effective_transitions(&self) -> Vec<TransitionIr>
pub fn effective_transitions(&self) -> Vec<TransitionIr>
Resolve the transition shorthand + longhands into the effective per-property list.
- The
transition:shorthand, when authored, wins outright (it resets the longhands per CSS shorthand semantics). - Otherwise
transition-propertydefines the entry list, withtransition-duration/transition-timing-functionvalues cycled over it (the CSS list-repeat rule). A duration list withouttransition-propertyproduces nothing: there is no default property list, so name the properties or writeall.
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Attributes
impl Debug for Attributes
Source§impl Default for Attributes
impl Default for Attributes
Source§fn default() -> Attributes
fn default() -> Attributes
Source§impl<'de> Deserialize<'de> for Attributes
impl<'de> Deserialize<'de> for Attributes
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 From<&Attributes> for AuthoredStrings
What the markup wrote, lifted off an element’s attributes.
impl From<&Attributes> for AuthoredStrings
What the markup wrote, lifted off an element’s attributes.
This is the whole input the resolver needs, which is why the spawner keeps it on the entity: rebuilding an element’s text in another locale asks the same question of the same strings.
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
Source§impl From<&Attributes> for Option<Interaction>
None when the element opts into no interaction state (no
hover-bg, no press-bg, no focus-outline). Keeping the
component absent for non-interactive surfaces avoids one row in the
inspector and one archetype move per spawn.
impl From<&Attributes> for Option<Interaction>
None when the element opts into no interaction state (no
hover-bg, no press-bg, no focus-outline). Keeping the
component absent for non-interactive surfaces avoids one row in the
inspector and one archetype move per spawn.
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
Source§impl From<&Attributes> for Option<TextStyle>
None when the element carries no text-style overrides (no color,
no font size, no align, no wrap, no max-lines, no typography role,
no line-height, …). Absent => defaults apply at extract time -
<column> / <row> containers stay component-light.
impl From<&Attributes> for Option<TextStyle>
None when the element carries no text-style overrides (no color,
no font size, no align, no wrap, no max-lines, no typography role,
no line-height, …). Absent => defaults apply at extract time -
<column> / <row> containers stay component-light.
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
Source§impl From<&Attributes> for Option<Visuals>
None when the element carries no visible-rect inputs (no fill,
no radius, no shadow). Keeping Visuals absent for plain layout
containers preserves the “only entities that paint get a Visuals”
invariant the render extract relies on.
impl From<&Attributes> for Option<Visuals>
None when the element carries no visible-rect inputs (no fill,
no radius, no shadow). Keeping Visuals absent for plain layout
containers preserves the “only entities that paint get a Visuals”
invariant the render extract relies on.
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
Source§impl From<&Attributes> for ProgressBar
The progress bar an element’s value, max and duration describe.
impl From<&Attributes> for ProgressBar
The progress bar an element’s value, max and duration describe.
No value is an indeterminate bar, which is a bar with nothing to say
about where it is rather than one sitting at zero. A bind-value write
turns it determinate.
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
Source§impl From<&Attributes> for SliderValue
The slider an element’s min, max, value and step describe.
impl From<&Attributes> for SliderValue
The slider an element’s min, max, value and step describe.
The defaults are the range a <slider> has when the markup names none:
zero to one, starting at the bottom. They live here rather than at each
reader, because a page emitted from one set of defaults and adopted by an
app holding another shows the thumb in two places.
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
Source§impl From<&Attributes> for Style
impl From<&Attributes> for Style
Source§fn from(attrs: &Attributes) -> Self
fn from(attrs: &Attributes) -> Self
The element’s layout style from its resolved attributes: the CSS initial values, with every property the attributes set written over them.
This is the one mapping from attributes to Style. Spawning an
element and a restyle (a class change, a @media breakpoint, a
theme flip) both build the style through here from the element’s
whole resolution, so the two can never disagree about which
properties reach layout, and a property nothing sets any more is
back at its initial value.
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnsafeUnpin for Attributes
impl UnwindSafe for Attributes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.