Layout and paint
Size and position boxes in logical pixels and use a consistent stacking order for drawing and picking.
Sizes and positions
size(160.0, 48.0) and QSS width: 160px; height: 48px describe the content box by default. Eight pixels of padding on all sides produce a 176 × 64 outer box. Use border_box() or box-sizing: border-box to include padding and borders in the specified size. The resolved bounds delivered to the host describe the border box.
row and column lay children out in order. gap separates adjacent items. This toolbar uses action names as IDs, so each name supplied by its caller must be unique.
Rustuse quaui::prelude::*;fn toolbar(names: &[&str]) -> Result<Surface, LayoutError> { row("tools") .size(320.0, 64.0) .border_box() .padding(8.0) .gap(6.0) .children(names.iter().map(|&name| { button(name, name).size(72.0, 36.0).on_click(name) })) .compile(320.0, 64.0)}
absolute(left, top) positions the element against the containing padding box. For grid tracks, percentages or individual insets, edit Element.layout using Taffy types from quaui::author::taffy. The backend maps logical coordinates onto the screen.
Visibility and stacking
A hidden node can keep its place in a layout. To remove it from flow, use QSS display: none or set layout.display to Display::None in Rust.
z_index(0) explicitly establishes a stacking context. A neutral parent lets descendants participate in its surrounding context. Negative descendants paint above their context's background. Use the same paint ranks for input picking, so the topmost interactive element receives the click.
QSS coverage
QuaUI implements a subset of CSS by property and value. Check rules with analyzeQssSource and verify layout and painting on your target backend. Consult the QSS registry and acceptance cases for supported and rejected declarations.