pub enum Display {
None,
Block,
Inline,
InlineBlock,
Flex,
Grid,
Table,
Var(CssVar),
}Expand description
Represents CSS display property values that control how elements are rendered.
The display property is one of the most important CSS properties for controlling layout.
It determines how an element is treated in the layout flow and how its children are laid out.
§Examples
use mew_css::style;
use mew_css::values::Display;
// Hide an element
let css1 = style().display(Display::None).apply();
// Block-level element (takes up full width)
let css2 = style().display(Display::Block).apply();
// Inline element (flows with text)
let css3 = style().display(Display::Inline).apply();
// Flexbox layout
let css4 = style().display(Display::Flex).apply();
// Grid layout
let css5 = style().display(Display::Grid).apply();Variants§
None
Removes the element from the document flow (element is not displayed)
Block
Element generates a block-level box (takes up full width available)
Inline
Element generates an inline box (flows with text)
InlineBlock
Element generates a block-level box that flows with text
Flex
Element becomes a flex container (enables flexbox layout)
Grid
Element becomes a grid container (enables grid layout)
Table
Element is displayed as a table
Var(CssVar)
CSS variable reference
Trait Implementations§
impl StructuralPartialEq for Display
Auto Trait Implementations§
impl Freeze for Display
impl RefUnwindSafe for Display
impl Send for Display
impl Sync for Display
impl Unpin for Display
impl UnwindSafe for Display
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
Mutably borrows from an owned value. Read more