omena-cascade 0.3.0

Cascade-formal substrate for Omena CSS
Documentation
//! Shorthand family authority consumed by the longhand-merge cascade passes.

pub const LONGHAND_MERGE_SHORTHAND_FAMILIES_V0: [&str; 38] = [
    "animation",
    "background",
    "background-position",
    "border",
    "border-block",
    "border-block-end",
    "border-block-start",
    "border-bottom",
    "border-color",
    "border-image",
    "border-inline",
    "border-inline-end",
    "border-inline-start",
    "border-left",
    "border-radius",
    "border-right",
    "border-style",
    "border-top",
    "border-width",
    "column-rule",
    "flex",
    "flex-flow",
    "font",
    "gap",
    "inset",
    "list-style",
    "margin",
    "outline",
    "overflow",
    "padding",
    "place-content",
    "place-items",
    "place-self",
    "scroll-margin",
    "scroll-padding",
    "text-decoration",
    "text-emphasis",
    "transition",
];

pub const BOX_LONGHAND_MERGE_SHORTHAND_FAMILIES_V0: [&str; 7] = [
    "margin",
    "padding",
    "border-color",
    "border-style",
    "border-width",
    "scroll-margin",
    "scroll-padding",
];

pub fn box_shorthand_longhands_v0(shorthand_property: &str) -> Option<[&'static str; 4]> {
    match shorthand_property {
        "margin" => Some(["margin-top", "margin-right", "margin-bottom", "margin-left"]),
        "padding" => Some([
            "padding-top",
            "padding-right",
            "padding-bottom",
            "padding-left",
        ]),
        "border-color" => Some([
            "border-top-color",
            "border-right-color",
            "border-bottom-color",
            "border-left-color",
        ]),
        "border-style" => Some([
            "border-top-style",
            "border-right-style",
            "border-bottom-style",
            "border-left-style",
        ]),
        "border-width" => Some([
            "border-top-width",
            "border-right-width",
            "border-bottom-width",
            "border-left-width",
        ]),
        "scroll-margin" => Some([
            "scroll-margin-top",
            "scroll-margin-right",
            "scroll-margin-bottom",
            "scroll-margin-left",
        ]),
        "scroll-padding" => Some([
            "scroll-padding-top",
            "scroll-padding-right",
            "scroll-padding-bottom",
            "scroll-padding-left",
        ]),
        _ => None,
    }
}