Skip to main content

vertical-center

Vertically center an element

ParameterTypeDescription
$positionstringEither relative (default) or absolute

Example

Components/ExampleComponent/_style.scss
.m-example-component {
@include vertical-center($position: absolute);
}
dist/frontend.css
.m-example-component {
position: absolute;
top: 50%;
transform: translateY(-50%);
}