2014-03-10 07:18:48 +01:00
|
|
|
// Tables
|
|
|
|
|
2018-10-20 10:21:31 +02:00
|
|
|
@mixin table-row-variant($state, $background, $border: null) {
|
2014-03-10 07:18:48 +01:00
|
|
|
// Exact selectors below required to override `.table-striped` and prevent
|
|
|
|
// inheritance to nested tables.
|
2015-03-31 03:08:01 +02:00
|
|
|
.table-#{$state} {
|
|
|
|
&,
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-02 23:02:35 +01:00
|
|
|
background-color: $background;
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
2018-10-20 10:21:31 +02:00
|
|
|
|
|
|
|
@if $border != null {
|
|
|
|
th,
|
|
|
|
td,
|
|
|
|
thead th,
|
|
|
|
tbody + tbody {
|
|
|
|
border-color: $border;
|
|
|
|
}
|
|
|
|
}
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hover states for `.table-hover`
|
|
|
|
// Note: this is not available for cells or rows within `thead` or `tfoot`.
|
2015-03-31 03:08:01 +02:00
|
|
|
.table-hover {
|
2015-01-01 10:05:01 +01:00
|
|
|
$hover-background: darken($background, 5%);
|
|
|
|
|
2015-03-31 03:08:01 +02:00
|
|
|
.table-#{$state} {
|
2019-07-24 09:53:13 +02:00
|
|
|
@include hover() {
|
2015-01-01 10:05:01 +01:00
|
|
|
background-color: $hover-background;
|
2015-03-31 03:08:01 +02:00
|
|
|
|
2015-01-01 10:05:01 +01:00
|
|
|
> td,
|
|
|
|
> th {
|
|
|
|
background-color: $hover-background;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-03-10 07:18:48 +01:00
|
|
|
}
|
|
|
|
}
|