Skip to content

Commit

Permalink
Fixing tab styles, especially in darkmode.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjones committed Oct 4, 2023
1 parent c98b494 commit 8abea22
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
23 changes: 16 additions & 7 deletions src/components/Tabs/Tabs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tabs } from "@/components";
import { Spacer, Tabs, Text } from "@/components";
import type { StoryObj } from "@storybook/react";

export default {
Expand All @@ -21,24 +21,33 @@ export const Playground: Story = {
value="tab1"
key="tab1"
>
tab1
Tab 1
</Tabs.Trigger>
<Tabs.Trigger
value="tab2"
key="tab2"
>
tab2
Tab 2
</Tabs.Trigger>
<Tabs.Trigger
value="tab3"
key="tab3"
>
tab3
Tab 3
</Tabs.Trigger>
</Tabs.TriggersList>
<Tabs.Content value="tab1">Tab 1 content</Tabs.Content>
<Tabs.Content value="tab2">Tab 2 content</Tabs.Content>
<Tabs.Content value="tab3">Tab 3 content</Tabs.Content>
<Tabs.Content value="tab1">
<Spacer />
<Text>Tab 1 content</Text>
</Tabs.Content>
<Tabs.Content value="tab2">
<Spacer />
<Text>Tab 2 content</Text>
</Tabs.Content>
<Tabs.Content value="tab3">
<Spacer />
<Text>Tab 3 content</Text>
</Tabs.Content>
</>
),
},
Expand Down
22 changes: 11 additions & 11 deletions src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down

0 comments on commit 8abea22

Please sign in to comment.