Skip to content

Commit

Permalink
More options
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnetangsu committed Oct 11, 2023
1 parent 280c18f commit 599a8e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions components/Sidebar/SidebarCard.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import { cnb } from 'cnbuilder';

export const root = 'relative overflow-hidden';

export const content = (hasBgColor: boolean) => cnb('', {
'rs-py-1 rs-pl-1 rs-pr-3 border-l-[2rem]': hasBgColor,
export const content = (
hasBgColor?: boolean,
hasBarColor?: boolean,
barOnRight?: boolean,
) => cnb('', {
'rs-py-1': hasBgColor,
'rs-pr-1 rs-pl-3 border-r-[2rem]': hasBarColor && barOnRight,
'rs-pl-1 rs-pr-3 border-l-[2rem]': hasBarColor && !barOnRight,
'rs-px-3': !hasBarColor,
});
2 changes: 1 addition & 1 deletion components/Sidebar/SidebarCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const SidebarCard = ({
className={cnb(styles.root, accentBgColors[bgColor], className)}
{...props}
>
<div className={cnb(styles.content(!!bgColor), accentBorderColors[barColor])}>
<div className={cnb(styles.content(!!bgColor, !!barColor, barOnRight), accentBorderColors[barColor])}>
{superhead && (
<Text weight="semibold" aria-hidden>{superhead}</Text>
)}
Expand Down

0 comments on commit 599a8e0

Please sign in to comment.