/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiRangeLevels {
  display: flex;
  justify-content: stretch;
  position: absolute;
  left: 0;
  right: 0;
  top: calc($ouiFormControlHeight / 2) + 2px;

  &--hasTicks {
    top: calc($ouiFormControlHeight / 4) + 2px;
  }

  &--compressed {
    top: calc($ouiFormControlCompressedHeight / 2) + 2px;

    &.ouiRangeLevels--hasTicks {
      top: calc($ouiFormControlCompressedHeight / 4) + 2px;
    }
  }
}

.ouiRangeLevel {
  display: block;
  height: 6px;
  border-radius: 6px;
  margin: 2px;
}

// Modifier naming and colors.
$ouiRangeLevelColors: (
  primary: $ouiColorPrimary,
  success: $ouiColorSuccess,
  warning: $ouiColorWarning,
  danger: $ouiColorDanger,
);

// Create level modifiers based upon the map.
@each $name, $color in $ouiRangeLevelColors {
  .ouiRangeLevel--#{$name} {
    background-color: transparentize($color, .7);
  }
}


/* OUI -> EUI Aliases */
$euiRangeLevelColors: $ouiRangeLevelColors;
/* End of Aliases */
