Sign in

    mizchi/crater/style does not have a README file

    BorderCollapse

    pub(all) enum BorderCollapse {
    Separate
    Collapse
    }

    CSS border-collapse property (for tables)

    CaptionSide

    pub(all) enum CaptionSide {
    Top
    Bottom
    }

    CSS caption-side property (for table captions)
    impl Eq for CaptionSide
    impl Show for CaptionSide

    Contain

    pub(all) struct Contain {
    size : Bool
    inline_size : Bool
    layout : Bool
    paint : Bool
    style : Bool
    }

    CSS contain property - uses flags since multiple values can be combined e.g., "contain: layout paint" or "contain: strict"
    impl Eq for Contain
    impl Show for Contain

    Contain::content

    fn Contain::content() -> Contain

    content = layout + paint + style (no size)

    Contain::has_containment

    fn Contain::has_containment(self : Contain) -> Bool

    Contain::none

    fn Contain::none() -> Contain

    Contain::strict

    fn Contain::strict() -> Contain

    strict = size + layout + paint + style

    Style

    pub(all) struct Style {
    display :
    Display

    position :
    Position

    float :
    Float

    clear :
    Clear

    box_sizing :
    BoxSizing

    overflow_x :
    Overflow

    overflow_y :
    Overflow

    width :
    Dimension

    height :
    Dimension

    min_width :
    Dimension

    min_height :
    Dimension

    max_width :
    Dimension

    max_height :
    Dimension

    margin :
    Rect
    [
    Dimension
    ]
    padding :
    Rect
    [
    Dimension
    ]
    border :
    Rect
    [
    Dimension
    ]
    flex_direction :
    FlexDirection

    flex_wrap :
    FlexWrap

    justify_content :
    Alignment

    align_items :
    Alignment

    align_content :
    Alignment

    align_self :
    AlignSelf

    flex_grow : Double
    flex_shrink : Double
    flex_basis :
    Dimension

    order : Int
    row_gap :
    Dimension

    column_gap :
    Dimension

    aspect_ratio : Double?
    inset :
    Rect
    [
    Dimension
    ]
    grid_template_rows : Array[
    TrackSizingFunction
    ]
    grid_template_columns : Array[
    TrackSizingFunction
    ]
    grid_auto_rows : Array[
    TrackSizingFunction
    ]
    grid_auto_columns : Array[
    TrackSizingFunction
    ]
    grid_auto_flow :
    GridAutoFlow

    grid_template_areas : Array[String]
    grid_row :
    GridLine

    grid_column :
    GridLine

    grid_area : String?
    justify_items :
    Alignment

    justify_self :
    AlignSelf

    font_size : Double
    line_height : Double
    vertical_align : VerticalAlign
    clip :
    ClipRect

    visibility : Visibility
    z_index : ZIndex
    opacity : Double
    color :
    Color

    background_color :
    Color

    contain : Contain
    transform : Transform
    border_spacing : Double
    border_collapse : BorderCollapse
    table_layout : TableLayout
    caption_side : CaptionSide
    rowspan : Int
    colspan : Int
    }

    CSS Style definition for layout computation All fields are mutable to support Yoga-like setter API

    Style::default

    fn Style::default() -> Style

    TableLayout

    pub(all) enum TableLayout {
    Auto
    Fixed
    }

    Table layout algorithm
    impl Eq for TableLayout
    impl Show for TableLayout

    Transform

    pub(all) struct Transform {
    translate_x : TranslateValue
    translate_y : TranslateValue
    }

    CSS transform property - list of transform functions Currently supports translate only for layout purposes
    impl Eq for Transform
    impl Show for Transform

    Transform::compute_translate_x

    fn Transform::compute_translate_x(self : Transform, element_width : Double) -> Double

    Compute translate X offset given element width

    Transform::compute_translate_y

    fn Transform::compute_translate_y(self : Transform, element_height : Double) -> Double

    Compute translate Y offset given element height

    Transform::is_none

    fn Transform::is_none(self : Transform) -> Bool

    Check if transform is identity (no visual change)

    Transform::none

    fn Transform::none() -> Transform

    Create a none/identity transform

    TranslateValue

    pub(all) enum TranslateValue {
    Length(Double)
    Percent(Double)
    }

    CSS transform translate value (can be length or percent)

    VerticalAlign

    pub(all) enum VerticalAlign {
    Baseline
    Top
    Middle
    Bottom
    TextTop
    TextBottom
    Sub
    Super
    }

    Vertical alignment for inline elements
    impl Eq for VerticalAlign

    Visibility

    pub(all) enum Visibility {
    Visible
    Hidden
    Collapse
    }

    CSS visibility property
    impl Eq for Visibility
    impl Show for Visibility

    ZIndex

    pub(all) enum ZIndex {
    Auto
    Value(Int)
    }

    CSS z-index property
    impl Eq for ZIndex
    impl Show for ZIndex

    Source Files