|
35 | 35 | } |
36 | 36 | } |
37 | 37 |
|
| 38 | + // Re-declare `table-active` class here so that it can take |
| 39 | + // precedence over row variants when used on selectable rows |
| 40 | + // Class can only be applied to rows and not individual cells |
| 41 | + > tbody > .table-active { |
| 42 | + &, |
| 43 | + > th, |
| 44 | + > td { |
| 45 | + background-color: $table-active-bg; |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + // Add special hover styling for `table-active` row variant |
| 50 | + &.table-hover > tbody > tr.table-active:hover { |
| 51 | + td, |
| 52 | + th { |
| 53 | + color: $table-hover-color; |
| 54 | + // `$table-hover-bg` default is a very transparent black |
| 55 | + // We overlay it over the background color to achieve the |
| 56 | + // same color effect while keeping the background solid |
| 57 | + background-image: linear-gradient($table-hover-bg, $table-hover-bg); |
| 58 | + background-repeat: no-repeat; |
| 59 | + } |
| 60 | + } |
| 61 | + |
38 | 62 | // Add in missing `bg-active` class for table tbody rows |
39 | 63 | // Bootstrap v4.3 is missing this for dark tables |
40 | 64 | // `bg-active` class cannot be applied to individual cells |
41 | 65 | > tbody > .bg-active { |
42 | 66 | &, |
43 | 67 | > th, |
44 | 68 | > td { |
45 | | - background-color: $table-dark-active-bg; |
| 69 | + // Important is needed to override the standard `bg-variants` |
| 70 | + // as the also use `!important` |
| 71 | + background-color: $table-dark-active-bg !important; |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | + // Add special hover styling for `bg-active` row variant (dark tables) |
| 76 | + &.table-hover.table-dark > tbody > tr.bg-active:hover { |
| 77 | + td, |
| 78 | + th { |
| 79 | + color: $table-dark-hover-color; |
| 80 | + // `$table-dark-hover-bg` default is a very transparent white |
| 81 | + // We overlay it over the background color to achieve the |
| 82 | + // same color effect while keeping the background solid |
| 83 | + background-image: linear-gradient($table-dark-hover-bg, $table-dark-hover-bg); |
| 84 | + background-repeat: no-repeat; |
46 | 85 | } |
47 | 86 | } |
48 | 87 | } |
|
0 commit comments