/*
 * Copyright (c) 2019-present Sonatype, Inc.
 * This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License 2.0 which accompanies this
 * distribution and is available at https://www.eclipse.org/legal/epl-2.0/.
 */
@use "sass:math";
@use '../../scss-shared/nx-text-helpers';

$-height: 16px;

.nx-meter {
  width: 150px;
  margin: 0 var(--nx-spacing-6x);
  vertical-align: -0.125em;

  &, &::-webkit-meter-bar {
    background: var(--nx-color-progress-background);
    border: none;
    border-radius: math.div($-height, 2);
    height: $-height;
    overflow: hidden
  }

  &::-webkit-meter-optimum-value,
  &::-webkit-meter-suboptimum-value,
  &::-webkit-meter-even-less-good-value {
    background: var(--nx-color-progress-fill);
  }

  // Note: Firefox and Chrome psuedo-elements must be in separate declarations, as the browser invalidates the
  // entire thing if it doesn't recognize one psuedo-element
  &::-moz-meter-bar {
    background: var(--nx-color-progress-fill);
  }

  &__content {
    @include nx-text-helpers.visually-hidden;
  }
}
