// Tables

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

  // Hover states for `.table-hover`
  // Note: this is not available for cells or rows within `thead` or `tfoot`.
  .#{$class-prefix}-table-hover > .#{$class-prefix}-html-tbody > .#{$class-prefix}-html-tr {
    > .#{$class-prefix}-html-td.#{$state}:hover,
    > .#{$class-prefix}-html-th.#{$state}:hover,
    &.#{$state}:hover > .#{$class-prefix}-html-td,
    &:hover > .#{$state},
    &.#{$state}:hover > .#{$class-prefix}-html-th {
      background-color: darken($background, 5%);
    }
  }
}
