Skip to content

Commit

Permalink
fix(mantine, tabs): vertical tabs look and small style improvements (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
GermainBergeron authored Aug 9, 2024
1 parent 68d6059 commit 8abb114
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
46 changes: 10 additions & 36 deletions packages/mantine/src/styles/Tabs.module.css
Original file line number Diff line number Diff line change
@@ -1,45 +1,19 @@
.list {
&[data-orientation='horizontal'] {
&::before {
border-style: none;
.root {
&[data-variant='default'] {
@mixin light {
--tab-hover-color: var(--mantine-color-gray-1);
}

border-bottom: rem(1) solid var(--mantine-color-gray-3);
}
--tabs-list-border-width: 1px;

&[data-orientation='vertical'] {
&::before {
border-style: none;
&[data-orientation='horizontal'] {
.list {
margin-bottom: calc(-1 * var(--tabs-list-border-width));
}
}

border-right: rem(1) solid var(--mantine-color-gray-3);
}
}

.tab {
&[data-orientation='horizontal'] {
border-bottom: rem(1) solid transparent;
margin-bottom: rem(-1);

&[data-active] {
border-bottom: rem(1) solid var(--mantine-primary-color-6);
}
}

&[data-orientation='vertical'] {
border-right: rem(1) solid transparent;
margin-right: rem(-1);

&[data-active] {
border-bottom: rem(1) solid var(--mantine-primary-color-6);
}
}

& :hover {
background-color: var(--mantine-color-gray-0);
}

&:not([data-active]):hover {
border-color: var(--mantine-color-gray-3);
}
line-height: 1.5;
}
7 changes: 6 additions & 1 deletion packages/mantine/src/theme/Theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ export const plasmaTheme: MantineThemeOverride = createTheme({
},
}),
Tabs: Tabs.extend({
classNames: {list: TabsClasses.list, tab: TabsClasses.tab},
classNames: TabsClasses,
}),
TabsTab: Tabs.Tab.extend({
defaultProps: {
px: 'sm',
},
}),
Text: Text.extend({
classNames: TextClasses,
Expand Down

0 comments on commit 8abb114

Please sign in to comment.