Skip to content

Feature Request - the following functions would be useful: top(), bottom(), left(), right() #1100

Closed
@scottrippey

Description

@scottrippey

An example says it best:

@margin: 1px 2px 3px;
.ruleset {
    margin-top: top(@margin); // Outputs "1px"
    margin-right: right(@margin); // Outputs "2px"
    margin-left: left(@margin); // Outputs "2px"
}

When I have a variable that holds a margin (in shorthand syntax), I would like to be able to extract the top/bottom/left/right values.
I have several mixins that require @Margin and @padding as parameters, but I need to break it down into -top, -bottom, -left, and -right. Currently, I have 8 separate variables, which makes the mixin much harder to use and way too verbose.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions