Skip to content

Commit

Permalink
Fix tabs styling in settings dialog
Browse files Browse the repository at this point in the history
Custom styling should only apply to server tabs and details tabs

Issue #188
  • Loading branch information
qu1ck committed Apr 20, 2024
1 parent 5ed72be commit 674a005
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
14 changes: 13 additions & 1 deletion src/components/details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,19 @@ function Details(props: DetailsProps) {

return (
<Tabs variant="outline" defaultValue={defaultTab} keepMounted={false}
h="100%" w="100%" sx={{ display: "flex", flexDirection: "column" }}>
h="100%" w="100%"
styles={((theme) => ({
root: {
display: "flex",
flexDirection: "column",
},
tab: {
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2],
"&[data-active]": {
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[5],
},
},
}))}>
<Tabs.List px="sm" pt="xs" onContextMenu={handler}>
<MemoSectionsContextMenu
sections={tabs} setSections={setTabs}
Expand Down
10 changes: 0 additions & 10 deletions src/components/mantinetheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ const Theme: (colorScheme: ColorScheme, font?: string) => MantineThemeOverride =
},
},
},
Tabs: {
styles: (theme) => ({
tab: {
borderColor: colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2],
"&[data-active]": {
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[5],
},
},
}),
},
Checkbox: {
styles: {
input: {
Expand Down
4 changes: 4 additions & 0 deletions src/components/servertabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ export const ServerTabs = React.forwardRef<ServerTabsRef, ServerTabsProps>(funct
tab: {
flexBasis: "12rem",
flexShrink: 1,
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2],
"&[data-active]": {
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[5],
},
},
tabLabel: {
marginInline: "auto",
Expand Down

0 comments on commit 674a005

Please sign in to comment.