transform-center

Positions the element in the center of the parent element via transform property.

Don't forget to set the parent position property other than static .

Arguments

Example

@use 'more-sass' as more;

.element {
    @include more.transform-center;
}
.element {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
Edit this page on GitHub Updated at Mon, Jan 30, 2023