@use "variables";

// Meters
// Credit: https://css-tricks.com/html5-meter-element/
.meter {
  appearance: none;
  background: variables.$bg-color;
  border: 0;
  border-radius: variables.$border-radius;
  display: block;
  width: 100%;
  height: variables.$unit-4;

  &::-webkit-meter-inner-element {
    display: block;
  }

  &::-webkit-meter-bar,
  &::-webkit-meter-optimum-value,
  &::-webkit-meter-suboptimum-value,
  &::-webkit-meter-even-less-good-value {
    border-radius: variables.$border-radius;
  }

  &::-webkit-meter-bar {
    background: variables.$bg-color;
  }

  &::-webkit-meter-optimum-value {
    background: variables.$success-color;
  }

  &::-webkit-meter-suboptimum-value {
    background: variables.$warning-color;
  }

  &::-webkit-meter-even-less-good-value {
    background: variables.$error-color;
  }

  &::-moz-meter-bar,
  &:-moz-meter-optimum,
  &:-moz-meter-sub-optimum,
  &:-moz-meter-sub-sub-optimum {
    border-radius: variables.$border-radius;
  }

  &:-moz-meter-optimum::-moz-meter-bar {
    background: variables.$success-color;
  }

  &:-moz-meter-sub-optimum::-moz-meter-bar {
    background: variables.$warning-color;
  }

  &:-moz-meter-sub-sub-optimum::-moz-meter-bar {
    background: variables.$error-color;
  }
}
