/*doc
---
title: Progress Bars
name: progress
category: Components - Progress Bars
---

A simple progress bar. Current percentage has to applied as inline style (width: xx%)

```htmlexample
<div class="progress">
    <div class="progress-bar" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
        20%
    </div>
</div>
```

*/

@keyframes progress-looper{0%{left:-100%}to{left:100%}}

.progress {
  position:relative;
  border: 1px solid $primary;
  height: 30px;

  div {
    position: absolute;
    height: 30px;
  }

  .progress-bar-white-bg {
    background: white;
    width: 100%;
    z-index: 1;
  }

  .progress-bar {
    background: black;
    width: 50%;
    z-index: 2;
  }

  .percentage {
    @include flex-center();
    inset: 0;
    width: 100%;
    font-weight: 600;
    mix-blend-mode: difference;
    color: $white;
    z-index: 3;
  }

  .progress-bar-primary-bg {
    background-color: $primary;
    mix-blend-mode: screen;
    width: 100%;
    z-index: 4;
  }

  &.loop{
    margin: 0.35em 0;

    &::after {
      -webkit-animation: 2s ease-in-out infinite progress-looper;
      animation: 2s ease-in-out infinite progress-looper;
      content: " ";
      top: 0;
      bottom: 0;
      left: 0;
      position: absolute;
      display: block;
      background-color: $primary;
      width: 75%;
    }
  }
}
