pub enum Overflow {
Visible,
Clip,
Hidden,
Scroll,
}Expand description
How children overflowing their container should affect layout
In CSS the primary effect of this property is to control whether contents of a parent container that overflow that container should be displayed anyway, be clipped, or trigger the container to become a scroll container. However it also has secondary effects on layout, the main ones being:
- The automatic minimum size Flexbox/CSS Grid items with non-
Visibleoverflow is0rather than being content based Overflow::Scrollnodes have space in the layout reserved for a scrollbar (width controlled by thescrollbar_widthproperty)
In Taffy, we only implement the layout related secondary effects as we are not concerned with drawing/painting. The amount of space reserved for
a scrollbar is controlled by the scrollbar_width property. If this is 0 then Scroll behaves identically to Hidden.
Variants§
Visible
The automatic minimum size of this node as a flexbox/grid item should be based on the size of its content. Content that overflows this node should contribute to the scroll region of its parent.
Clip
The automatic minimum size of this node as a flexbox/grid item should be based on the size of its content. Content that overflows this node should not contribute to the scroll region of its parent.
Hidden
The automatic minimum size of this node as a flexbox/grid item should be 0.
Content that overflows this node should not contribute to the scroll region of its parent.
Scroll
The automatic minimum size of this node as a flexbox/grid item should be 0. Additionally, space should be reserved
for a scrollbar. The amount of space reserved is controlled by the scrollbar_width property.
Content that overflows this node should not contribute to the scroll region of its parent.