Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 9d6b4c4

Browse files
committed
nits card
1 parent aaa43c1 commit 9d6b4c4

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

components/src/components/Card/Card.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,36 @@ type Props = {
88
as?: BoxProps['as']
99
shadow?: boolean
1010
hover?: boolean
11-
level?: '1' | '2'
1211
borderRadius?: BoxProps['borderRadius']
1312
padding?: BoxProps['padding']
1413
width?: BoxProps['width']
14+
backgroundColor?: BoxProps['backgroundColor']
15+
color?: BoxProps['color']
1516
}
1617

1718
export const Card = ({
1819
as = 'div',
1920
children,
2021
padding,
2122
shadow,
22-
level = '1',
2323
hover,
2424
borderRadius = { xs: '2xLarge', sm: '3xLarge' },
2525
width,
26+
backgroundColor = 'background',
27+
color = 'foreground',
2628
}: React.PropsWithChildren<Props>) => {
2729
const { mode, forcedMode } = useTheme()
2830
return (
2931
<Box
3032
as={as}
33+
backgroundColor={backgroundColor}
3134
borderRadius={borderRadius}
3235
className={styles.variants({
3336
dark: (forcedMode ?? mode) === 'dark',
34-
level,
3537
shadow,
3638
hover,
3739
})}
40+
color={color}
3841
padding={padding}
3942
width={width}
4043
>

components/src/components/Card/styles.css.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const variants = recipe({
1414
transitionTimingFunction: 'inOut',
1515
}),
1616
style({
17-
transitionDuration: '150ms',
17+
transitionDuration: '125ms',
1818
selectors: {
1919
'&:hover': {
2020
boxShadow: `${vars.shadows['1']} ${vars.colors['foregroundTertiary']}`,
@@ -27,12 +27,6 @@ export const variants = recipe({
2727
]),
2828
false: {},
2929
},
30-
level: {
31-
'1': {},
32-
'2': atoms({
33-
backgroundColor: 'background',
34-
}),
35-
},
3630
dark: {
3731
true: {},
3832
false: {},
@@ -46,20 +40,10 @@ export const variants = recipe({
4640
{
4741
variants: {
4842
dark: true,
49-
level: '1',
5043
},
51-
style: atoms({
52-
backgroundColor: 'black',
53-
}),
54-
},
55-
{
56-
variants: {
57-
dark: false,
58-
level: '1',
44+
style: {
45+
border: `1px solid ${vars.colors.foregroundSecondary}`,
5946
},
60-
style: atoms({
61-
backgroundColor: 'white',
62-
}),
6347
},
6448
{
6549
variants: {

components/src/tokens/color.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ export const colors = {
3939
},
4040
light: {
4141
background: '255, 255, 255',
42-
backgroundSecondary: '247, 247, 247',
42+
backgroundSecondary: '250, 250, 250',
4343
backgroundTertiary: '247, 247, 247',
4444
foreground: '0, 0, 0',
4545
groupBackground: '255, 255, 255',
4646
groupBorder: '0, 0, 0',
4747
...accents.light,
4848
},
4949
dark: {
50-
background: '0, 0, 0',
50+
background: '5, 5, 5',
5151
backgroundSecondary: '10, 10, 10',
52-
backgroundTertiary: '20, 20, 20',
52+
backgroundTertiary: '15, 15, 15',
5353
foreground: '255, 255, 255',
5454
groupBackground: '10, 10, 10',
5555
groupBorder: '255, 255, 255',

0 commit comments

Comments
 (0)