@use 'functions/color' as *;
@use 'functions/get-var' as *;
@use 'variables' as *;

// Tables
.table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  @if $rtl == true {
    text-align: right;
  } @else {
    text-align: left;
  }

  &.table-striped {
    tbody {
      tr:nth-of-type(odd) {
        // background: $bg-color; // old spectre.css
        background: color('bg-color');
      }
    }
  }

  &,
  &.table-striped {
    tbody {
      tr {
        &.active {
          // background: $bg-color-dark; // old spectre.css
          background: color('bg-color-dark');
        }
      }
    }
  }

  &.table-hover {
    tbody {
      tr {
        &:hover {
          // background: $bg-color-dark; // old spectre.css
          background: color('bg-color-dark');
        }
      }
    }
  }

  // Scollable tables
  &.table-scroll {
    display: block;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    white-space: nowrap;
  }

  td,
  th {
    // border-bottom: $border-width solid $border-color; // old spectre.css
    border-bottom: get-var('border-width') solid color('border-color');
    // padding: $unit-3 $unit-2; // old spectre.css
    padding: get-var('unit-3') get-var('unit-2');
  }
  th {
    // border-bottom-width: $border-width-lg; // old spectre.css
    border-bottom-width: get-var('border-width', $suffix: 'lg');
  }
}
