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%);
}