Skip to content

Commit 28e3de1

Browse files
committed
fix-alerts-accordion-theme
Signed-off-by: amanycodes <amanycodes@gmail.com>
1 parent a5ffa83 commit 28e3de1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.item {
2+
background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
3+
}
4+
5+
.item[data-active] {
6+
background-color: light-dark(var(--mantine-color-body-light), var(--mantine-color-body-dark));
7+
}
8+

web/ui/mantine-ui/src/pages/AlertsPage.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { useDebouncedValue } from "@mantine/hooks";
3636
import { KVSearch } from "@nexucis/kvsearch";
3737
import { inputIconStyle } from "../styles";
3838
import CustomInfiniteScroll from "../components/CustomInfiniteScroll";
39+
import classes from "./AlertsPage.module.css";
3940

4041
type AlertsPageData = {
4142
// How many rules are in each state across all groups.
@@ -276,19 +277,10 @@ export default function AlertsPage() {
276277
<CustomInfiniteScroll
277278
allItems={g.rules}
278279
child={({ items }) => (
279-
<Accordion multiple variant="separated">
280+
<Accordion multiple variant="separated" classNames={classes}>
280281
{items.map((r, j) => {
281282
return (
282283
<Accordion.Item
283-
styles={{
284-
item: {
285-
// TODO: This transparency hack is an OK workaround to make the collapsed items
286-
// have a different background color than their surrounding group card in dark mode,
287-
// but it would be better to use CSS to override the light/dark colors for
288-
// collapsed/expanded accordion items.
289-
backgroundColor: "#c0c0c015",
290-
},
291-
}}
292284
key={j}
293285
value={j.toString()}
294286
className={

0 commit comments

Comments
 (0)