@import "settings";
@import "foundation-sites/scss/components/table";

$bonsai-include-tables: $bonsai-include-components !default;

/* -- Bonsai Variables -- */

/// Set the background color of the table header
/// @type Color
$bonsai-table-head-background: $bonsai-white !default;

/// Set to true to alternate background color per row
/// @type Bool
$bonsai-table-is-striped: false;

/* -- Foundation Configuration -- */
$table-is-striped: $bonsai-table-is-striped;
$table-head-background: $bonsai-table-head-background;
$table-border: 0;

/* -- Mixins -- */

/// Add top and bottom borders to style the table header
@mixin table-head-styling {
  border-top: $bonsai-standard-border;
  border-bottom: $bonsai-standard-border;
}

/// Add bottom border to table body
@mixin table-styling {
  @include table; // Foundation include

  border-bottom: $bonsai-standard-border;
}

/// Applies general 'table' styling to table and table header
@mixin bonsai-table {
  @if $bonsai-include-tables {
    table {
      @include table-styling;
    }

    thead {
      @include table-head-styling;
    }
  }
}
