Skip to content

Commit d1845c2

Browse files
committed
feat(shiny-preset): stripes on even, fix hover/selected
Uses more BS sass vars and cleans up CSS variables
1 parent b72096b commit d1845c2

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

inst/builtin/bs5/shiny/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,5 @@ $border-radius: 3px !default;
8989
// Tables
9090
$table-striped-bg: tint-color($blue, 94%) !default;
9191
$bslib-dt-row-active-bg: $blue !default;
92+
$table-hover-bg: tint-color($blue, 90%) !default;
93+
$table-striped-order: even;

inst/builtin/bs5/shiny/tables/_rules.scss

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
:root {
22
--bslib-dt-row-selected: #{red($blue), green($blue), blue($blue)};
3-
--bslib-table-striped-bg: #{$table-striped-bg};
4-
--bslib-dt-row-striped-bg: #{$table-striped-bg};
5-
--bslib-dt-row-active-bg: #{$bslib-dt-row-active-bg};
63
}
74

85
.dataTable {
@@ -12,21 +9,32 @@
129
}
1310

1411
.table.dataTable.dataTable {
15-
&.table-striped > tbody > tr.odd:not(.active):not(.selected) > * {
16-
box-shadow: inset 0 0 0 9999px var(--bslib-dt-row-striped-bg);
12+
&.table-striped > tbody > tr.odd:not(.selected) > * {
13+
box-shadow: none;
14+
}
15+
16+
&.table-striped > tbody > tr.even:not(.selected) > * {
17+
box-shadow: inset 0 0 0 9999px var(--bs-table-striped-bg);
1718
}
1819

1920
tbody td.active,
2021
tbody tr.active td {
21-
background-color: var(--bslib-dt-row-active-bg);
22+
background-color: var(--bs-table-active-bg);
2223
}
2324

25+
&.table-hover > tbody > tr:hover:not(.selected) > * {
26+
box-shadow: inset 0 0 0 9999px var(--bs-table-hover-bg);
27+
}
2428
}
2529

2630
thead, tbody, tfoot, tr, td, th {
2731
border: none;
2832
}
2933

34+
.table > thead {
35+
border-bottom: 1px solid var(--bs-table-color);
36+
}
37+
3038
th {
3139
font-weight: 600;
3240
}

0 commit comments

Comments
 (0)