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-
Visible
overflow is0
rather than being content based Overflow::Scroll
nodes have space in the layout reserved for a scrollbar (width controlled by thescrollbar_width
property)
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.
Trait Implementations§
impl Copy for Overflow
impl Eq for Overflow
impl StructuralPartialEq for Overflow
Auto Trait Implementations§
impl Freeze for Overflow
impl RefUnwindSafe for Overflow
impl Send for Overflow
impl Sync for Overflow
impl Unpin for Overflow
impl UnwindSafe for Overflow
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)