Skip to content

Commit 15cc5aa

Browse files
authored
Replaced all the css into tailwind css on Card component (#1762)
1 parent b995c61 commit 15cc5aa

File tree

3 files changed

+10
-35
lines changed

3 files changed

+10
-35
lines changed

components/Cards/Card/Card.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { bool, node, string } from 'prop-types';
22
import classNames from 'classnames';
33
import { getDataAttributes } from 'common/utils/prop-utils';
4-
import styles from './Card.module.css';
54

65
Card.propTypes = {
76
children: node.isRequired,
@@ -19,7 +18,14 @@ function Card({ children, className, hasAnimationOnHover, ...props }) {
1918

2019
return (
2120
<article
22-
className={classNames(styles.Card, className, { [styles.animatedCard]: hasAnimationOnHover })}
21+
className={classNames(
22+
'items-center bg-white [&_svg]:fill-secondary text-secondary flex flex-col flex-nowrap justify-around m-4 min-h-[100px] min-w-[100px] p-6 shadow-md focus-visible:outline-none',
23+
className,
24+
{
25+
'shadow-sm transition-shadow duration-200 ease-linear hover:shadow-lg focus-visible:shadow-lg':
26+
hasAnimationOnHover,
27+
},
28+
)}
2329
{...customDataAttributes}
2430
>
2531
{children}

components/Cards/Card/Card.module.css

Lines changed: 0 additions & 31 deletions
This file was deleted.

components/Cards/Card/__tests__/__snapshots__/Card.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
exports[`Card should render with many props assigned 1`] = `
44
<article
5-
className="Card test-class animatedCard"
5+
className="items-center bg-white [&_svg]:fill-secondary text-secondary flex flex-col flex-nowrap justify-around m-4 min-h-[100px] min-w-[100px] p-6 shadow-md focus-visible:outline-none test-class shadow-sm transition-shadow duration-200 ease-linear hover:shadow-lg focus-visible:shadow-lg"
66
>
77
Test
88
</article>
99
`;
1010

1111
exports[`Card should render with required props 1`] = `
1212
<article
13-
className="Card"
13+
className="items-center bg-white [&_svg]:fill-secondary text-secondary flex flex-col flex-nowrap justify-around m-4 min-h-[100px] min-w-[100px] p-6 shadow-md focus-visible:outline-none"
1414
>
1515
Test
1616
</article>

0 commit comments

Comments
 (0)