 // Tables

@mixin table-row-variant($state, $background, $color: false) {
  // Exact selectors below required to override `.table-striped` and prevent
  // inheritance to nested tables.
  .table tr {
    td.#{$state},
    th.#{$state},
    &.#{$state} {
      background-color: $background;
      @if $color {
        color: $color;
      }
    }
  }

  // Hover states for `.table-hover`
  // Note: this is not available for cells or rows within `thead` or `tfoot`.
  .table-hover tbody tr {
    // scss-lint:disable SelectorDepth
    td.#{$state}:hover,
    th.#{$state}:hover,
    &.#{$state}:hover,
    &:hover > .#{$state} {
      background-color: opacify($background, .1);
    }
  }
}
