Expand description
Layout attributes: Length, ItemStyle and ContainerStyle.
These are the types every element accepts as layout props. They exist so
that rsx! can hand string literals (justify="space-between") and numbers
(gap={8}) straight to a setter, and so that the conversion to
[taffy::Style] lives in one place.
How a box looks rides along in the same prop: ItemStyle::paint is a
PaintStyle, with forwarding setters (bg, border, radius, …), so
no element signature changes to gain a background. Only the border reaches
taffy — the layout has to reserve the width of the stroke — and the engine
paints the rest once the layout is solved.
Re-exports§
pub use crate::paint::PaintStyle;
Structs§
- Container
Style - The layout attributes of a container (
<View>), as a flex/grid parent. - Gap
- The
gapprop of a container: one value for both axes, or one per axis. - Item
Style - The layout attributes every element accepts, as a flex/grid item.
Enums§
- Align
align-items/align-self.Normalleaves it unset.- Direction
flex-direction.- Display
display.- Justify
justify-content/align-content.Normalleaves it unset.- Length
- A length in a layout attribute.
Functions§
- root_
style - The taffy style of the root container: a column that fills the window.
Type Aliases§
- Align
Self align-self, which taffy spells with the same type asalign-items.