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] 디자인 시스템 구현 #27

Merged
merged 31 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0867c90
[chore] 윈도우에서 cr prettier와 eslint 충돌 오류 해결
Kimsj912 Dec 3, 2022
d62b620
fix: fix window eslint error
Kimsj912 Dec 5, 2022
6e56aad
feat: Add GlobalStyle
Kimsj912 Dec 5, 2022
8a54370
feat: Add global theme
Kimsj912 Dec 5, 2022
5ac80e4
feat: Add theme
Kimsj912 Dec 5, 2022
cd77a79
feat: Add Example Component
Kimsj912 Dec 5, 2022
69f1851
feat: Remove GlobalStyle
Kimsj912 Dec 5, 2022
eb91bd5
fix: Image src missing 오류 해결
Kimsj912 Dec 6, 2022
349542c
refactor: eslint ban-ts-comment 제거
Kimsj912 Dec 6, 2022
c6022b7
refactor: change theme fontsize small name into sm
Kimsj912 Dec 6, 2022
b7595e0
refactor: Remove Example from _app.page.tsx
Kimsj912 Dec 7, 2022
5db0a66
props 제거
Kimsj912 Dec 25, 2022
e03dab3
Example Style Update
Kimsj912 Dec 25, 2022
8af1870
design system upgrade
Kimsj912 Dec 25, 2022
68113ed
common.css로 파일 분리
Kimsj912 Dec 31, 2022
315e093
theme 변경
Kimsj912 Jan 1, 2023
eb988a4
div 대신 <> 를 사용하도록 수정
Kimsj912 Jan 1, 2023
30fcdf1
inerface 명 ~~Props 방식으로 사용하도록 변경
Kimsj912 Jan 1, 2023
b0b9ff0
Merge branch 'develop' of https://github.com/YAPP-Github/21st-Web-Tea…
Kimsj912 Jan 1, 2023
485d6ff
package-lock.json 머지 오류 해결
Kimsj912 Jan 1, 2023
3b16da8
Example.tsx 괄호 정리
Kimsj912 Jan 1, 2023
b3cb6aa
border-radius 제거
Kimsj912 Jan 1, 2023
928bb4a
app_page.tsx 제거 및 style import 피드백 반영
Kimsj912 Jan 1, 2023
11bc8a1
절대 경로로 이동후 app.page.tsx로 이동
Kimsj912 Jan 1, 2023
b0cd9cc
Merge
Kimsj912 Jan 1, 2023
b501ae9
reset이 common보다 먼저오도록 수정
Kimsj912 Jan 1, 2023
e01dde0
chore: storybook-addon-next-router 추가
hwookim Jan 2, 2023
d34bcbb
refactor: _app.page.tsx -> _app.tsx
hwookim Jan 2, 2023
8199460
fix: borderRadius 삭제
hwookim Jan 2, 2023
9d0a6e9
fix: common, reset css 순서 변경
hwookim Jan 2, 2023
fbe0a74
chore: 코드 오너 수정
hwookim Jan 2, 2023
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
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
trailingComma: 'all',
printWidth: 120,
arrowParens: 'always',
importOrder: ['^@mocks/(.*)$', '^@src/(.*)$', '^[./]'],
importOrder: ['^@mocks/(.*)$', '@src/styles/reset.css', '@src/styles/common.css', '^@src/(.*)$', '^[./]'],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
};
5 changes: 4 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { initialize, mswDecorator } from 'msw-storybook-addon';
import { RouterContext } from 'next/dist/shared/lib/router-context';
import * as NextImage from 'next/image';

import '@src/styles/reset.css';

import '@src/styles/common.css';

import mockApis from '../__mocks__/apis';
import '../src/styles/reset.css';

initialize();

Expand Down
44 changes: 44 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"msw-storybook-addon": "^1.6.3",
"prettier": "^2.7.1",
"start-server-and-test": "^1.14.0",
"storybook-addon-next-router": "^4.0.2",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typescript": "4.8.4"
},
Expand Down
16 changes: 16 additions & 0 deletions src/components/Example/Example.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ComponentStory } from '@storybook/react';
import React from 'react';

import Example from '.';

export default {
component: Example,
title: 'Components/Example',
};

const Template: ComponentStory<typeof Example> = (args) => <Example {...args} />;

export const Default = Template.bind({});
Default.args = {
title: 'Example Word',
};
24 changes: 24 additions & 0 deletions src/components/Example/Example.style.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import styled from '@emotion/styled';

import theme from '../../styles/theme';

const StyledButton = styled.button`
background-color: ${theme.color.G8};
color: ${theme.color.Primary1};
border: 1px solid ${theme.color.borderPrimary};
padding: 8px 16px;
line-height: ${theme.lineHeight.B};
font-size: ${theme.textSize.B2};
font-weight: ${theme.fontWeight.bold};
font-family: ${theme.fontFamily.mainTitle};
cursor: pointer;
transition: all 0.2s ease-in-out;
margin: 10px;

&:hover {
background-color: ${theme.color.Primary2};
color: ${theme.color.G8};
}
`;

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

import StyledButton from './Example.style';

interface MyButtonProps {
title: string;
}

const MyButton = ({ title }: MyButtonProps) => {
return <StyledButton>{title}</StyledButton>;
};

export default MyButton;
1 change: 1 addition & 0 deletions src/components/Example/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Example';
5 changes: 4 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import type { AppProps } from 'next/app';
import { RecoilRoot } from 'recoil';

import '@src/styles/reset.css';

import '@src/styles/common.css';

import queryClient from '../configs/queryClient';
import '../styles/reset.css';

if (process.env.NODE_ENV === 'development') {
if (typeof window === 'undefined') {
Expand Down
46 changes: 46 additions & 0 deletions src/styles/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@font-face {
font-family: 'Pretendard-Regular';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
body {
line-height: 1;
background-color: #101012;
color: #f1f3f5;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
h1 {
font-size: 20pt;
font-weight: bold;
}
h2 {
font-size: 18pt;
font-weight: medium;
}
h3 {
font-size: 16pt;
font-weight: regular;
}
p {
font-size: 14pt;
font-weight: regular;
}
23 changes: 1 addition & 22 deletions src/styles/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ video {
border: 0;
font-size: 100%;
font: inherit;
font-family: 'Pretendard-Regular', 'Noto Sans CJK KR', syne;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
Expand All @@ -105,25 +106,3 @@ nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
57 changes: 57 additions & 0 deletions src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const theme = {
color: {
// common color
G8: '#F8F9FA',
G7: '#9C9EA7',
G6: '#6E7178',
G5: '#4E5259',
G4: '#373a40',
G3: '#1E1D23',
G2: '#141517',
G1: '#101012',
Primary1: '#D2FA64',
Primary2: '#b2dd3c',
Secondary1: '#ff3d60',
Secondary2: '#e02d4d',
// specialized color
topicPrimary: '#ff7991',
topicSecondary: '#aef19d',
txtPrimary: '#f1f3f5',
txtSecondary: '#6E7178',
txtDanger: '#ff0000',
borderPrimary: '#f8f9fa',
},
fontFamily: {
basic: 'Pretendard',
mainTitle: 'Syne',
},
fontWeight: {
light: 300,
regular: 400,
bold: 700,
},
textSize: {
H1: '40px',
H2: '24px',
H3: '20px',
T1: '18px',
T2: '16px', // B1과 동일
T3: '15px',
B2: '14px',
B3: '12px',
B4: '8px',
code: '16px',
},
lineHeight: {
H: '130%',
B: '150%',
},
// TODO: 반응형 도입시 재정의 필요. (임시로 기준값 설정한 상태)
responsive: {
sm: '480px',
md: '768px',
lg: '1024px',
},
} as const;

export default theme;