malept/gmusicprocurator

View on GitHub
gmusicprocurator/static/scss/include/_mixins.scss

Summary

Maintainability
Test Coverage
@mixin flexify {
  @include display(flex);
  @include flex(1);
}

@mixin overflow-ellipsis {
  overflow-x: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@mixin scrollable-flexbox-container {
  @include display(flex);

  > div {
    @include display(flex);
    @include flex-direction(column);
    width: 100%;
  }
}

@mixin text-outline($color, $size: 1px) {
  // Based on https://stackoverflow.com/a/4919231
  $nsize: -$size;
  text-shadow: $nsize $nsize 0 $color,
               $size $nsize 0 $color,
               $nsize $size 0 $color,
               $size $size 0 $color;
}

@mixin prefixer($property, $value, $prefixes, $spec: true) {
  // Originally based on bourbon's prefixer mixin,
  // plus https://github.com/thoughtbot/bourbon/issues/230
  @each $prefix in $prefixes {
    -#{$prefix}-#{$property}: #{$value};
  }
  @if $spec {
    #{$property}: $value;
  }
}

@mixin value-prefixer($property, $value, $prefixes, $spec: true) {
  // Originally based on bourbon's prefixer mixin,
  // plus https://github.com/thoughtbot/bourbon/issues/230
  @each $prefix in $prefixes {
    #{$property}: -#{$prefix}-#{$value};
  }
  @if $spec {
    #{$property}: $value;
  }
}