Chocobozzz/PeerTube

View on GitHub
client/src/sass/include/_icons.scss

Summary

Maintainability
Test Coverage
@use '_variables' as *;

@mixin chevron ($size, $border-width) {
  border-style: solid;
  border-width: $border-width $border-width 0 0;
  content: '';
  display: inline-block;
  transform: rotate(-45deg);
  height: $size;
  width: $size;
  position: relative;
}

@mixin chevron-right ($size, $border-width) {
  left: 0;

  @include chevron($size, $border-width);

  & {
    transform: rotate(45deg);
  }
}

@mixin chevron-right-default {
  margin: 0 8px;

  @include chevron-right(0.55rem, 0.15rem);
}

@mixin chevron-down ($size, $border-width) {
  bottom: 0.15em;

  @include chevron($size, $border-width);

  & {
    transform: rotate(135deg);
  }
}

@mixin chevron-down-default {
  margin: 0 8px;

  @include chevron-down(0.55rem, 0.15rem);
}

@mixin chevron-up ($size, $border-width) {
  top: 0.15em;

  @include chevron($size, $border-width);

  & {
    transform: rotate(-45deg);
  }
}

@mixin chevron-up-default {
  margin: 0 8px;

  @include chevron-up(0.55rem, 0.15rem);
}

@mixin chevron-left ($size, $border-width) {
  left: 0.25em;

  @include chevron($size, $border-width);

  & {
    transform: rotate(-135deg);
  }
}

@mixin chevron-left-default {
  margin: 0 8px;

  @include chevron-left(0.55rem, 0.15rem);
}

// ---------------------------------------------------------------------------

@mixin arrow-up ($size) {
  width: 0;
  height: 0;
  border-left: $size solid transparent;
  border-right: $size solid transparent;
  border-bottom: $size solid pvar(--mainForegroundColor);
}

@mixin arrow-down ($size) {
  width: 0;
  height: 0;
  border-left: $size solid transparent;
  border-right: $size solid transparent;
  border-top: $size solid pvar(--mainForegroundColor);
}