Answers for "sass mixin or function"

CSS
14

sass mixin

@mixin transform($property) {
  -webkit-transform: $property;
  -ms-transform: $property;
  transform: $property;
}
.box { @include transform(rotate(30deg)); }
Posted by: Guest on May-29-2020
0

scss mixin

@mixin rtl($property, $ltr-value, $rtl-value) { // with argumens
  #{$property}: $ltr-value;

  [dir=rtl] & {
    #{$property}: $rtl-value;
  }
}

.sidebar {
  @include rtl(float, left, right);
}
Posted by: Guest on April-16-2022

Browse Popular Code Answers by Language