Skip to content

Commit

Permalink
Replaced all the css into tailwind css on Card component (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
subhajit20 authored Nov 6, 2023
1 parent b995c61 commit 15cc5aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 35 deletions.
10 changes: 8 additions & 2 deletions components/Cards/Card/Card.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { bool, node, string } from 'prop-types';
import classNames from 'classnames';
import { getDataAttributes } from 'common/utils/prop-utils';
import styles from './Card.module.css';

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

return (
<article
className={classNames(styles.Card, className, { [styles.animatedCard]: hasAnimationOnHover })}
className={classNames(
'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',
className,
{
'shadow-sm transition-shadow duration-200 ease-linear hover:shadow-lg focus-visible:shadow-lg':
hasAnimationOnHover,
},
)}
{...customDataAttributes}
>
{children}
Expand Down
31 changes: 0 additions & 31 deletions components/Cards/Card/Card.module.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

exports[`Card should render with many props assigned 1`] = `
<article
className="Card test-class animatedCard"
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"
>
Test
</article>
`;

exports[`Card should render with required props 1`] = `
<article
className="Card"
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
</article>
Expand Down

2 comments on commit 15cc5aa

@vercel
Copy link

@vercel vercel bot commented on 15cc5aa Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 15cc5aa Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.