From 8abea22562ddfb12d88011a7eac7e44a96048557 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 4 Oct 2023 16:18:19 +0200 Subject: [PATCH] Fixing tab styles, especially in darkmode. --- src/components/Tabs/Tabs.stories.tsx | 23 ++++++++++++++++------- src/components/Tabs/Tabs.tsx | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/components/Tabs/Tabs.stories.tsx b/src/components/Tabs/Tabs.stories.tsx index 730d7364..42aca91e 100644 --- a/src/components/Tabs/Tabs.stories.tsx +++ b/src/components/Tabs/Tabs.stories.tsx @@ -1,4 +1,4 @@ -import { Tabs } from "@/components"; +import { Spacer, Tabs, Text } from "@/components"; import type { StoryObj } from "@storybook/react"; export default { @@ -21,24 +21,33 @@ export const Playground: Story = { value="tab1" key="tab1" > - tab1 + Tab 1 - tab2 + Tab 2 - tab3 + Tab 3 - Tab 1 content - Tab 2 content - Tab 3 content + + + Tab 1 content + + + + Tab 2 content + + + + Tab 3 content + ), }, diff --git a/src/components/Tabs/Tabs.tsx b/src/components/Tabs/Tabs.tsx index 391d851b..545c3d6b 100644 --- a/src/components/Tabs/Tabs.tsx +++ b/src/components/Tabs/Tabs.tsx @@ -22,38 +22,38 @@ const Trigger = styled(RadixTabs.Trigger)` border-top-left-radius: ${props => props.theme.click.tabs.radii.all}; border-top-right-radius: ${props => props.theme.click.tabs.radii.all}; - border-bottom: ${props => props.theme.click.tabs.basic.stroke.default}; - background-color: ${props => - props.theme.click.tabs.basic.color.background.default}; + border-bottom: 2px solid ${props => props.theme.click.tabs.basic.stroke.default}; + background-color: ${props => props.theme.click.tabs.basic.color.background.default}; color: ${props => props.theme.click.tabs.basic.color.text.default}; font: ${props => props.theme.click.tabs.typography.label.default}; cursor: pointer; &[data-state="active"] { - border-bottom: ${props => props.theme.click.tabs.basic.stroke.active}; - background-color: ${props => - props.theme.click.tabs.basic.color.background.active}; + border-bottom: 2px solid ${props => props.theme.click.tabs.basic.color.stroke.active}; + background-color: ${props => props.theme.click.tabs.basic.color.background.active}; color: ${props => props.theme.click.tabs.basic.color.text.active}; font: ${props => props.theme.click.tabs.typography.label.active}; + &:hover { + font: ${props => props.theme.click.tabs.typography.label.active}; + } } &:hover { - border-bottom: ${props => props.theme.click.tabs.basic.stroke.hover}; - background-color: ${props => - props.theme.click.tabs.basic.color.background.hover}; + border-bottom: 2px solid ${props => props.theme.click.tabs.basic.stroke.hover}; + background-color: ${props => props.theme.click.tabs.basic.color.background.hover}; color: ${props => props.theme.click.tabs.basic.color.text.hover}; font: ${props => props.theme.click.tabs.typography.label.hover}; } &:hover[data-state="active"] { - border-bottom: ${props => props.theme.click.tabs.basic.stroke.active}; + border-bottom: 1px solid ${props => props.theme.click.tabs.basic.stroke.active}; } `; const Content = styled(RadixTabs.Content)``; const TriggersList = styled(RadixTabs.List)` - border-bottom: ${props => props.theme.click.tabs.basic.stroke.global}; + border-bottom: 1px solid ${props => props.theme.click.global.color.stroke.default}; `; const Tabs = ({