Skip to content

[Feature Proposal] Absolutely position in centre #415

@MattRogowski

Description

@MattRogowski

Forgive me if this is already in progress anywhere I've missed or is indeed already possible, however, it would be good if there were classes to position elements centrally.

I've just added this CSS to my page, trying to keep the naming convention:

.pin-c-x {
    left: 50%;
    transform: translateX(-50%);
}
.pin-c-y {
    top: 50%;
    transform: translateY(-50%);
}
.pin-c {
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
}

Using pin-x and pin-y doesn't achieve this as they "stretch" the element to the top and bottom.

I have a codepen to demonstrate here: https://codepen.io/mattrogowski/pen/LdpVNw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions