Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions packages/component-library/src/MainNavTabs/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,18 @@
&[data-selected] {
color: theme.color("button", "solid", "foreground");
pointer-events: none;
}
}

&[data-selectable] {
pointer-events: auto;

&[data-hovered] .bubble {
background-color: theme.color(
"button",
"solid",
"background",
"hover"
);
}

&[data-pressed] .bubble {
background-color: theme.color(
"button",
"solid",
"background",
"active"
);
}
}
&[data-selectable] .tab[data-selected] {
pointer-events: auto;

&[data-hovered] .bubble {
background-color: theme.color("button", "solid", "background", "hover");
}

&[data-pressed] .bubble {
background-color: theme.color("button", "solid", "background", "active");
}
}
}
4 changes: 3 additions & 1 deletion packages/component-library/src/MainNavTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const MainNavTabs = ({ className, pathname, ...props }: Props) => {
aria-label="Main Navigation"
className={clsx(styles.mainNavTabs, className)}
dependencies={[pathname]}
data-selectable={
props.items.every((tab) => tab.href !== pathname) ? "" : undefined
}
{...props}
>
{({ className: tabClassName, children, ...tab }) => (
Expand All @@ -29,7 +32,6 @@ export const MainNavTabs = ({ className, pathname, ...props }: Props) => {
data-size="sm"
data-variant="ghost"
data-rounded
data-selectable={pathname === tab.href ? undefined : ""}
{...tab}
>
{(args) => (
Expand Down
Loading