Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(card): add card component + extend tailwind instead of overwrite #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/common/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const Card: React.FC<{}> = ({ children }) => {
return <div className="inline-block bg-light shadow-lg overflow-hidden sm:rounded-lg">{children}</div>;
};

export default Card;
7 changes: 7 additions & 0 deletions src/components/common/Card/CardBody.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const CardBody: React.FC<{}> = ({ children }) => {
return <div className="px-4 py-5 sm:px-6">{children}</div>;
};

export default CardBody;
7 changes: 7 additions & 0 deletions src/components/common/Card/CardFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const CardFooter: React.FC<{}> = ({ children }) => {
return <div className="px-4 py-3 bg-gray-50 text-right sm:px-6">{children}</div>;
};

export default CardFooter;
7 changes: 7 additions & 0 deletions src/components/common/Card/CardHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const CardHeader: React.FC<{}> = ({ children }) => {
return <div className="mx-4 px-4 py-3 text-left text-2xl border-b border-gray-200">{children}</div>;
};

export default CardHeader;
4 changes: 4 additions & 0 deletions src/components/common/Card/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as Card } from './Card';
export { default as CardBody } from './CardBody';
export { default as CardFooter } from './CardFooter';
export { default as CardHeader } from './CardHeader';
34 changes: 18 additions & 16 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
module.exports = {
theme: {
colors: {
primary: {
DEFAULT: 'var(--color-primary)',
light: 'var(--color-primary-light)',
extend: {
colors: {
primary: {
DEFAULT: 'var(--color-primary)',
light: 'var(--color-primary-light)',
},
secondary: {
DEFAULT: 'var(--color-secondary)',
light: 'var(--color-secondary-light)',
lightest: 'var(--color-secondary-lightest)',
darkest: 'var(--color-secondary-darkest)',
},
dark: 'var(--color-dark)',
light: 'var(--color-light)',
},
secondary: {
DEFAULT: 'var(--color-secondary)',
light: 'var(--color-secondary-light)',
lightest: 'var(--color-secondary-lightest)',
darkest: 'var(--color-secondary-darkest)',
fontFamily: {
sans: ['Poppins'],
serif: ['Georgia'],
mono: ['Roboto'],
},
dark: 'var(--color-dark)',
light: 'var(--color-light)',
},
fontFamily: {
sans: ['Poppins'],
serif: ['Georgia'],
mono: ['Roboto'],
},
},
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
Expand Down