monks/overflow
The overflow CSS shorthand property sets the desired behavior when content does not fit in the element’s padding box (overflows) in the horizontal and/or vertical direction.
Values
pub const auto_: #(String, String)
- : Overflow content is clipped at the element’s padding box, and overflow content can be scrolled into view using scroll bars. Unlike
scroll, user agents display scroll bars only if the content is overflowing. If content fits inside the element’s padding box, it looks the same as withvisiblebut still establishes a new formatting context. The element box is a scroll container.> [!NOTE]> The keyword valueoverlayis a legacy value alias forauto. Withoverlay, the scroll bars are drawn on top of the content instead of taking up space.
pub const clip: #(String, String)
- : Overflow content is clipped at the element’s overflow clip edge that is defined using the
overflow-clip-marginproperty. As a result, content overflows the element’s padding box by the {{cssxref(“<length>”)}} value ofoverflow-clip-marginor by0pxif not set. Overflow content outside the clipped region is not visible, user agents do not add a scroll bar, and programmatic scrolling is also not supported. No new formatting context is created. To establish a formatting context, useoverflow: clipalong with {{cssxref(“display”, “display: flow-root”, “#flow-root”)}}. The element box is not a scroll container.
pub const hidden: #(String, String)
- : Overflow content is clipped at the element’s padding box. There are no scroll bars, and the clipped content is not visible (i.e., clipped content is hidden), but the content still exists. User agents do not add scroll bars and also do not allow users to view the content outside the clipped region by actions such as dragging on a touch screen or using the scroll wheel on a mouse. The content can be scrolled programmatically (for example, by linking to anchor text, by tabbing to a hidden yet focusable element, or by setting the value of the {{domxref(“Element.scrollLeft”, “scrollLeft”)}} property or the {{domxref(“Element.scrollTo”, “scrollTo()”)}} method), in which case the element box is a scroll container.
pub const revert_layer: #(String, String)
pub const scroll: #(String, String)
- : Overflow content is clipped at the element’s padding box, and overflow content can be scrolled into view using scroll bars. User agents display scroll bars whether or not any content is overflowing, so in the horizontal and vertical directions if the value applies to both directions. The use of this keyword, therefore, can prevent scroll bars from appearing and disappearing as content changes. Printers may still print overflow content. The element box is a scroll container.
pub fn var(variable: String) -> #(String, String)
Enter a variable name to be used for overflow.
It will be wrapped in var() and have -- prepended.