@@ -7,14 +7,14 @@ import { media, isLarge } from '../../utils'
77
88const HEIGHT = '382px'
99
10- const contrastStyle = ( { $backgroundColor, color } ) => css `
10+ const contrastStyle = ( { $backgroundColor, $ color } ) => css `
1111 background-color : ${ $backgroundColor } ;
12- border-color : ${ color } ;
12+ border-color : ${ $ color} ;
1313 transition-property : filter;
1414 will-change : filter;
1515
1616 & & & {
17- color : ${ color } ;
17+ color : ${ $ color} ;
1818 }
1919
2020 & : hover {
@@ -69,13 +69,13 @@ const baseStyle = css(
6969
7070const Element = styled ( 'a' ) (
7171 baseStyle ,
72- ( { $isLoading, contrast } ) => ! $isLoading && ! contrast && hoverStyle ,
72+ ( { $isLoading, $ contrast } ) => ! $isLoading && ! $ contrast && hoverStyle ,
7373 ( { $cardSize } ) => isLarge ( $cardSize ) && largeStyle ,
74- ( { direction } ) => direction === 'rtl' && rtlStyle ,
75- ( { $backgroundColor, color, contrast } ) =>
76- contrast && color && $backgroundColor && contrastStyle ,
77- ( { $backgroundColor, color, contrast } ) =>
78- contrast && ( ! color || ! $backgroundColor ) && hoverStyle
74+ ( { $ direction } ) => $ direction === 'rtl' && rtlStyle ,
75+ ( { $backgroundColor, $ color, $ contrast } ) =>
76+ $ contrast && $ color && $backgroundColor && contrastStyle ,
77+ ( { $backgroundColor, $ color, $ contrast } ) =>
78+ $ contrast && ( ! $ color || ! $backgroundColor ) && hoverStyle
7979)
8080
8181const CardWrap = forwardRef (
@@ -90,16 +90,20 @@ const CardWrap = forwardRef(
9090 ref
9191 ) => {
9292 const {
93- state : { $backgroundColor, color, title } ,
93+ state : { $backgroundColor, color : $color , title } ,
9494 props : { size : $cardSize }
9595 } = useContext ( GlobalContext )
9696
97+ const { contrast : $contrast , direction : $direction , ...props } = restProps
98+
9799 return createElement ( Element , {
98100 ...( as === 'a' ? { href, rel, target } : undefined ) ,
99- ...restProps ,
101+ ...props ,
100102 $backgroundColor,
101103 $cardSize,
102- color,
104+ $color,
105+ $contrast,
106+ $direction,
103107 ref,
104108 title
105109 } )
0 commit comments