Skip to content

Commit

Permalink
[FE] issue319: 테마 리팩토링 (#321)
Browse files Browse the repository at this point in the history
* feat: theme 수정

screens, fontSize, fontWeight, radius 추가

* refactor: fontSize, fontWeight theme 사용

* refactor: radius theme 적용

* fix: theme 오류 수정

* fix: theme 오류 수정

* refactor: lint 적용
  • Loading branch information
nan-noo authored Sep 12, 2022
1 parent 0207c3a commit 61af388
Show file tree
Hide file tree
Showing 75 changed files with 493 additions and 471 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/arrow-button/ArrowButton.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Button = styled.button`
text-align: center;
background-color: ${theme.colors.secondary.light};
border: 1px solid ${theme.colors.secondary.base};
border-radius: 50%;
border-radius: ${theme.radius.circle};
transition: transform 0.2s ease;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/avatar/Avatar.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const Avatar = styled.div`
width: 36px;
min-width: 36px;
height: 36px;
border-radius: 50%;
border-radius: ${theme.radius.circle};
box-shadow: 0 1px 5px 0 ${theme.colors.secondary.dark};
overflow: hidden;
transition: opacity 0.2s ease;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/button/Button.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export const Button = styled.button<ButtonProps>`
min-height: 30px;
text-align: center;
font-size: 20px;
font-size: ${theme.fontSize.lg};
color: ${theme.colors.white};
border: none;
border-radius: 10px;
border-radius: ${theme.radius.sm};
background-color: ${theme.colors.primary.base};
white-space: nowrap;
Expand Down
24 changes: 15 additions & 9 deletions frontend/src/components/card/Card.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const Card = styled.div`
overflow: hidden;
border: 3px solid ${theme.colors.primary.base};
border-radius: 25px;
border-radius: ${theme.radius.xl};
box-shadow: 8px 8px 0 0 ${theme.colors.secondary.dark};
:hover {
Expand Down Expand Up @@ -41,20 +41,26 @@ const onelineEllipsis = css`
`;

export const Title = styled.h4`
margin-bottom: 20px;
${({ theme }) => css`
margin-bottom: 20px;
font-size: ${theme.fontSize.xl};
font-weight: ${theme.fontWeight.bold};
line-height: 24px;
`}
font-size: 24px;
font-weight: 700;
line-height: 24px;
${onelineEllipsis};
`;

export const Excerpt = styled.p`
width: 100%;
margin-bottom: 20px;
${({ theme }) => css`
width: 100%;
margin-bottom: 20px;
font-size: ${theme.fontSize.lg};
line-height: 20px;
`}
font-size: 20px;
line-height: 20px;
${onelineEllipsis};
`;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/chip/Chip.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const Chip = styled.span<ChipProps>`
padding: 8px 12.8px;
text-align: center;
border-radius: 16px;
border-radius: ${theme.radius.md};
color: ${disabled ? theme.colors.black : theme.colors.white};
background-color: ${disabled ? theme.colors.secondary.base : theme.colors.primary.base};
`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const DropDownBox = styled.div<Pick<DropDownBoxProps, 'top' | 'bottom' |
white-space: nowrap;
border: 1px solid ${theme.colors.secondary.dark};
border-radius: 5px;
border-radius: ${theme.radius.xs};
background-color: ${theme.colors.secondary.light};
transform-origin: top;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/input/Input.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type InputProps = {

export const Input = styled.input<InputProps>`
${({ theme, isValid }) => css`
border-radius: 5px;
border-radius: ${theme.radius.xs};
border: 1px solid ${theme.colors.secondary.base};
background-color: ${theme.colors.white};
padding: 4px 8px;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/kebab-menu/KebabMenu.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const KebabMenu = styled.ul`
li {
width: 4px;
height: 4px;
border-radius: 50%;
border-radius: ${theme.radius.circle};
background-color: ${theme.colors.secondary.dark};
}
`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from '@emotion/styled';

export const LetterCounter = styled.div`
${({ theme }) => css`
font-size: 12px;
font-size: ${theme.fontSize.sm};
color: ${theme.colors.secondary.dark};
& > span {
color: ${theme.colors.secondary.dark};
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/tag-chip/TagChip.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export const TagChip = styled.div`
min-width: 92px;
padding: 6px 8px;
font-size: 16px;
font-size: ${theme.fontSize.md};
line-height: 18px;
text-align: center;
color: ${theme.colors.primary.base};
border-radius: 25px;
border-radius: ${theme.radius.xl};
border: 2px solid ${theme.colors.primary.base};
background-color: ${theme.colors.white};
`}
Expand Down
9 changes: 0 additions & 9 deletions frontend/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ export const DEFAULT_LINK_QUERY_PARAM = {
export const DEFAULT_VISIBLE_STUDY_MEMBER_CARD_COUNT = 6;
export const DEFAULT_LOAD_STUDY_REVIEW_COUNT = 6;

export const BREAK_POINTS = {
xs: 0,
sm: 576,
md: 768,
lg: 992,
xl: 1280,
xxl: 1400,
};

export const EXCERPT_LENGTH = {
MIN: {
VALUE: 1,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/layout/header/components/logo/Logo.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const ImageContainer = styled.div`
export const BorderText = styled.h1`
${({ theme }) => css`
color: ${theme.colors.primary.base};
font-size: 40px;
font-weight: 800;
font-size: ${theme.fontSize.xxxl};
font-weight: ${theme.fontWeight.bolder};
-webkit-text-stroke: 1px ${theme.colors.primary.dark};
${mqDown('lg')} {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const Input = styled.input`
padding: 8px 40px;
overflow: hidden;
font-size: 20px;
border-radius: 20px;
font-size: ${theme.fontSize.lg};
border-radius: ${theme.radius.lg};
border: 3px solid ${theme.colors.primary.base};
text-align: center;
Expand All @@ -29,10 +29,10 @@ export const Input = styled.input`
}
${mqDown('md')} {
font-size: 18px;
font-size: ${theme.fontSize.lg};
}
${mqDown('sm')} {
font-size: 16px;
font-size: ${theme.fontSize.md};
}
`}
`;
Expand All @@ -48,7 +48,7 @@ export const Button = styled.button`
bottom: 0;
padding-right: 20px;
font-size: 20px;
font-size: ${theme.fontSize.lg};
background: transparent;
border: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import styled from '@emotion/styled';

import { mqDown } from '@utils';
Expand All @@ -12,10 +13,12 @@ export const CreateStudyPage = styled.div``;
export const Form = styled.form``;

export const PageTitle = styled.h1`
margin-bottom: 20px;
${({ theme }) => css`
margin-bottom: 20px;
font-size: 32px;
font-weight: 700;
font-size: ${theme.fontSize.xxl};
font-weight: ${theme.fontWeight.bold};
`}
`;

export const DescriptionTab = styled(OriginalDesriptionTab)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Textarea as OriginalTextArea } from '@create-study-page/components/text

export const DescriptionTab = styled.div`
${({ theme }) => css`
border-radius: 6px;
border-radius: ${theme.radius.xs};
border: 1px solid ${theme.colors.secondary.dark};
overflow: hidden;
Expand Down Expand Up @@ -45,7 +45,7 @@ export const TabItemButton = styled.button<TabItemButtonProps>`
${({ theme, isActive }) => css`
border: none;
line-height: 24px;
font-weight: 600;
font-weight: ${theme.fontWeight.bold};
padding: 8px 16px;
transition: color 0.2s cubic-bezier(0.3, 0, 0.5, 1);
background-color: inherit;
Expand Down Expand Up @@ -74,10 +74,10 @@ export const Textarea = styled(OriginalTextArea)`
height: 100%;
padding: 12px;
border-radius: 6px;
border-radius: ${theme.radius.xs};
background-color: ${theme.colors.secondary.light};
border: 1px solid ${theme.colors.secondary.dark};
font-size: 16px;
font-size: ${theme.fontSize.md};
&:focus {
background-color: ${theme.colors.white};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import styled from '@emotion/styled';

import { Textarea as OriginalTextarea } from '@create-study-page/components/textarea/Textarea.style';
Expand Down Expand Up @@ -27,8 +28,11 @@ export const LetterCounterContainer = styled.div`
`;

export const Textarea = styled(OriginalTextarea)`
display: block;
min-height: 50px;
width: 100%;
font-size: 16px;
${({ theme }) => css`
display: block;
min-height: 50px;
width: 100%;
font-size: ${theme.fontSize.md};
`}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export const MetaBox = styled.div`
min-width: 255px;
border: 1px solid ${theme.colors.secondary.dark};
box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
border-radius: 6px;
border-radius: ${theme.radius.xs};
`}
`;

export const Title = styled.h2`
${({ theme }) => css`
font-size: 16px;
font-size: ${theme.fontSize.md};
padding: 8px 12px;
margin: 0;
line-height: 1.4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Select = styled(Input.withComponent('select'))`
line-height: 2;
border-color: ${theme.colors.secondary.base};
box-shadow: none;
border-radius: 3px;
border-radius: ${theme.radius.xs};
padding: 0 24px 0 8px;
min-height: 30px;
max-width: 25rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const Input = styled(OriginalInput)`
${({ theme }) => css`
display: block;
width: 100%;
font-size: 24px;
font-size: ${theme.fontSize.xl};
line-height: 24px;
border-radius: 4px;
border-radius: ${theme.radius.xs};
border: 1px solid ${theme.colors.secondary.dark};
background-color: ${theme.colors.white};
color: ${theme.colors.black};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/detail-page/DetailPage.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ export const MarkDownContainer = styled.section`
padding: 16px;
background-color: ${theme.colors.white};
border-radius: 15px;
border-radius: ${theme.radius.md};
`}
`;
28 changes: 17 additions & 11 deletions frontend/src/pages/detail-page/components/head/Head.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export const Title = styled.div`
`;

export const StudyTitle = styled.h2`
font-size: 40px;
font-weight: 700;
${({ theme }) => css`
font-size: ${theme.fontSize.xxxl};
font-weight: ${theme.fontWeight.bold};
`}
`;

export const ButtonsContainer = styled.div``;
Expand All @@ -30,12 +32,12 @@ export const Button = styled.button`
margin-left: 8px;
padding: 8px;
font-size: 20px;
font-weight: 600;
font-size: ${theme.fontSize.lg};
font-weight: ${theme.fontWeight.bold};
color: ${theme.colors.secondary.dark};
background-color: transparent;
border: none;
border-radius: 5px;
border-radius: ${theme.radius.xs};
transition: color 0.1s ease;
&:hover,
Expand All @@ -46,17 +48,21 @@ export const Button = styled.button`
`;

export const ExtraInfoContainer = styled.div`
display: flex;
align-items: center;
column-gap: 16px;
${({ theme }) => css`
display: flex;
align-items: center;
column-gap: 16px;
font-weight: 300;
font-weight: ${theme.fontWeight.light};
`}
`;

export const Excerpt = styled.p`
padding: 8px 0 16px;
${({ theme }) => css`
padding: 8px 0 16px;
font-size: 28px;
font-size: ${theme.fontSize.xl};
`}
`;

export const TagContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { css } from '@emotion/react';
import styled from '@emotion/styled';

export const MoreButton = styled.button`
background-color: transparent;
border: none;
font-size: 16px;
${({ theme }) => css`
background-color: transparent;
border: none;
font-size: ${theme.fontSize.md};
`}
`;
Loading

0 comments on commit 61af388

Please sign in to comment.