Answers for "using mixins in scss javascript"

CSS
0

scss mixin

@mixin reset-list {    // Mixin without arguments
  margin: 0;
  padding: 0;
  list-style: none;
}

@mixin horizontal-list {
  @include reset-list;

  li {
    display: inline-block;
    margin: {
      left: -2px;
      right: 2em;
    }
  }
}

nav ul {
  @include horizontal-list;
}
Posted by: Guest on April-16-2022
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