Skip to content

Commit 7faecbf

Browse files
committed
Fix datatables background color for selected rows
The new theme doesn't use background colors for striped tables and to show selected rows. Instead, it adds box-shadow to table cells to simulate background colors. The original theme uses a opaque color and white text, breaking the Pi-hle themes. The fix replaces the original box-shadow with a semi-transparent shadow and uses the theme text color. Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
1 parent ad45791 commit 7faecbf

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

style/pi-hole.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
:root {
99
/* Datatables Select - bgcolor */
10-
--datatable-bgcolor: #e0e8ee;
10+
--datatable-selected-bg: #90b6ff;
1111

1212
/* Used in settings save button */
1313
--overlay-bgcolor: rgba(212, 220, 232, 0.55);
@@ -1243,10 +1243,12 @@ table.dataTable tr.selected th.select-checkbox::after {
12431243
}
12441244

12451245
/* Datatables Select - selected row bgcolor */
1246-
table.dataTable tbody > tr.selected,
1247-
table.dataTable tbody > tr > .selected {
1248-
background: none;
1249-
background-image: linear-gradient(var(--datatable-bgcolor), var(--datatable-bgcolor));
1246+
table.table.dataTable > tbody > tr.selected > * {
1247+
color: inherit;
1248+
box-shadow:inset 0 0 0 9999px color-mix(var(--datatable-selected-bg) 20%, transparent);
1249+
}
1250+
table.table.dataTable.table-striped > tbody > tr.selected:nth-of-type(2n+1) > * {
1251+
box-shadow:inset 0 0 0 9999px color-mix(var(--datatable-selected-bg) 40%, transparent);
12501252
}
12511253

12521254
#messagesTable pre {

style/themes/default-dark.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* https://github.com/anvyst/adminlte-skin-midnight */
1010

1111
:root {
12-
--datatable-bgcolor: rgba(64, 76, 88, 0.8);
13-
--overlay-bgcolor: var(--datatable-bgcolor);
12+
--datatable-selected-bg: rgba(60, 141, 188, 0.6);
13+
--overlay-bgcolor: rgba(64, 76, 88, 0.8);
1414

1515
/* Dashboard graphic bars */
1616
--allowed-color: #12b660;

style/themes/default-darker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ embed[type="application/pdf"] {
115115
--darkreader-neutral-text: #d8d4cf;
116116
--darkreader-selection-background: #004daa;
117117
--darkreader-selection-text: #e8e6e3;
118-
--datatable-bgcolor: rgb(35, 47, 52);
118+
--datatable-selected-bg: rgb(41, 98, 146);
119119
--overlay-bgcolor: rgba(35, 47, 52, 0.7);
120120

121121
/* Dashboard graphic bars */

style/themes/high-contrast-dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
--cached-color: #44649c;
3232
--other-color: #969798;
3333

34-
--datatable-bgcolor: rgba(18, 44, 68, 0.3);
34+
--datatable-selected-bg: rgba(13, 110, 253, 0.5);
3535
--overlay-bgcolor: rgba(24, 28, 32, 0.8);
3636
}
3737

style/themes/lcars.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
--net-recent-color: #055;
1111
--net-old-color: #125;
1212
--net-older-color: #1c2228;
13-
--datatable-bgcolor: var(--net-old-color);
1413

1514
/* Dashboard graphic bars */
1615
--allowed-color: #073;

0 commit comments

Comments
 (0)