@use "../../variables/index" as *;

@use "sass:color";
@use "color-mixins";

// Contextual backgrounds
@mixin checkContrast($color) {
  @if color.lightness($color) < 50% {
    color: white;
  } @else {
    color: $text-color;
  }
}

@mixin bg-variant($color) {
  background-color: $color !important;

  @at-root {
    a#{&}:hover,
    a#{&}:focus {
      @include color-mixins.darken($color, 0.1);
    }
  }

  > a:not(.btn) {
    color: inherit;
    text-decoration: underline;
    [class^='dlt-c8y-icon-'],
    [class*=' dlt-c8y-icon-'],
    .c8y-icon {
      text-decoration: none;
    }
  }
}
