margin

Shorthand for set nullable* margin properties.

*Some values can be omitted using null (preferable) or its alias n .

Arguments

NameTypeDefaultDescription
$values *listMargin values list in default order (top-right-bottom-left).

Example

@use 'more-sass' as more;

.element-one {
  @include more.margin(10px);
}

.element-two {
  @include more.margin(10px 20px 30px 40px); // or: @include more.margin(10px, 20px, 30px, 40px);
}

.element-three {
  @include more.margin(null auto);
}
.element-one {
  margin-top: 10px;
  margin-right: 10px;
  margin-bottom: 10px;
  margin-left: 10px;
}

.element-two {
  margin-top: 10px;
  margin-right: 20px;
  margin-bottom: 30px;
  margin-left: 40px;
}

.element-three {
  margin-right: auto;
  margin-left: auto;
}
Edit this page on GitHub Updated at Tue, Jun 24, 2025