Skip to content

Commit 2ef0b08

Browse files
authored
반응형웹 적용 (#18)
* Design: media theme 생성 * Design: media의 breakpoints에 xLarge속성 추가 xLarge: 1360 * Design: 반응형웹에서 사용할 css variable 설정 * Design: markdownStyle 스타일 수정 * Design: About페이지 css variable적용 * Design: 404페이지 css variable적용 * Design: Layout페이지 css variable적용 * Design: PostList페이지에 css variable적용 * Rename: PostDetail관련 스타일 파일 합치기 PostHeader, PostBody, PostFooter .style -> PostDetail.style * Design: Bio컴포넌트 css variable적용 * Design: CategoryHeader컴포넌트 css variable적용 * Design: Footer컴포넌트에 css variable적용 * Chore: MainInfo컴포넌트 제거 * Design: GNB컴포넌트에 css variable적용 * Fix: Image 컴포넌트 이미지가 찌그러지는 버그 수정 * Fix: Bio 이미지 사이즈, description의 간격 수정 * Design: Image컴포넌트에 css variable적용 * Chore: media theme 사용법 주석 작성 * Feat: viewport 메타 태그 설정 * Docs: 리드미 최신화
1 parent 5b7f1e5 commit 2ef0b08

File tree

28 files changed

+251
-224
lines changed

28 files changed

+251
-224
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
### 추가
2222

23-
- [ ] : 반응형 웹
23+
- [x] : 반응형 웹
2424
- [x] : read time
2525
- [ ] : 반응 및 조회수 표시
2626
- [ ] : 검색 기능
27-
- [ ] : 카테고리 검색
27+
- [x] : 카테고리 검색
2828
- [ ] : 시리즈 검색
2929
- [ ] : 이전 포스트 , 다음 포스트, 최신포스트
3030
- [x] : 맞춤법 검사 자동화 -> vscode-hanspell extension으로 필요할 때마다 사용

src/Layout/Layout.style.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import styled from '@emotion/styled'
33
export const Container = styled.div`
44
display: flex;
55
flex-direction: column;
6-
padding-top: 100px;
6+
width: 100%;
7+
padding-top: var(--padding-xl);
78
color: var(--color-text);
89
background-color: var(--color-background);
910
`

src/components/Bio/Bio.style.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export const Info = styled.div`
1515

1616
export const Author = styled.h3``
1717

18-
export const Desc = styled.div``
18+
export const Desc = styled.div`
19+
${({ theme: { typography } }) => typography.textBase}
20+
line-height: 1.4;
21+
`
1922

2023
export const Socials = styled.ul`
2124
display: flex;
@@ -31,7 +34,7 @@ export const Socials = styled.ul`
3134
}
3235
}
3336
a > svg {
34-
width: 18px;
35-
height: 18px;
37+
width: var(--icon-small);
38+
height: var(--icon-small);
3639
}
3740
`

src/components/Bio/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const Bio = () => {
1414
}
1515
return (
1616
<S.Container>
17-
<Image src="profile-image.png" isCircle />
17+
<Image src="profile-image.png" isCircle size="l" />
1818
<S.Info>
1919
<S.Author>{author}</S.Author>
2020
<S.Desc>{description}</S.Desc>

src/components/CategoryHeader/CategoryHeader.style.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Link } from 'gatsby'
33
import { ReactNode } from 'react'
44

55
export const Container = styled.div`
6-
width: 768px;
6+
width: var(--main-content-width);
77
padding: 1rem;
88
margin: 0 auto;
99
color: var(--color-heading-text);
@@ -27,13 +27,13 @@ interface GatsbyLinkProps extends CategoryItemProps {
2727
export const CategoryList = styled.div`
2828
display: flex;
2929
flex-wrap: wrap;
30+
gap: var(--space-m);
3031
`
3132

3233
export const CategoryItem = styled(({ active, ...props }: GatsbyLinkProps) => <Link {...props} />)`
3334
cursor: pointer;
34-
margin-right: 12px;
3535
border-radius: 8px;
36-
padding: 0 6px;
36+
padding: 0 var(--space-s);
3737
${({ theme: { typography } }) => typography.linkSmall}
3838
3939
color: var(--color-text);

src/components/Common/Image/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { useMemo } from 'react'
66
import { GatsbyImageDataType } from '@/types/gatsby.type'
77

88
const ImageSizeMap = {
9-
s: '32px',
10-
m: '64px',
11-
l: ' 128px',
9+
s: 'var(--icon-medium)',
10+
m: 'var(--icon-large)',
11+
l: 'var(--icon-xLarge)',
1212
}
1313

1414
type ImageSize = keyof typeof ImageSizeMap
@@ -65,6 +65,7 @@ const SImage = styled((props: GatsbyImgProps) => <GatsbyImage {...props} />)`
6565
border-radius: ${({ isCircle }) => isCircle && '50%'};
6666
&.gatsby-image-wrapper {
6767
z-index: 0; // IOS에서 border-radius 적용안되는 버그 해결
68+
min-width: ${({ size }) => size && ImageSizeMap[size]};
6869
}
6970
`
7071

src/components/Footer/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ const Footer = () => {
77
export default Footer
88

99
const Container = styled.footer`
10-
margin-top: 32px;
11-
padding: 40px 0;
10+
margin-top: var(--padding-s);
11+
padding: var(--padding-s) 0;
1212
text-align: center;
13-
font-size: 11pt;
13+
border-top: 1px solid var(--color-background-secondary);
14+
${({ theme: { typography } }) => typography.textBase}
1415
`

src/components/GlobalNavigation/GlobalNavigation.style.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from '@emotion/styled'
22
import { Link } from 'gatsby'
33

44
export const Container = styled.header<{ isHidden: boolean }>`
5+
width: 100%;
56
display: flex;
67
align-items: center;
78
justify-content: space-between;
@@ -13,8 +14,8 @@ export const Container = styled.header<{ isHidden: boolean }>`
1314
padding: 1rem 2rem;
1415
backdrop-filter: blur(5px);
1516
transition: top 0.5s, opacity 0.5s;
16-
z-index: 999;
17-
width: 100vw;
17+
z-index: var(--z-index-top);
18+
1819
${({ theme: { typography } }) => typography.linkMedium};
1920
2021
color: var(--color-text);
@@ -36,8 +37,8 @@ export const NavLinks = styled.nav`
3637
export const NavLink = styled(Link)``
3738

3839
export const ThemeSwitchButton = styled.button`
39-
width: 24px;
40-
height: 24px;
40+
width: var(--icon-medium);
41+
height: var(--icon-medium);
4142
> svg {
4243
width: 100%;
4344
height: 100%;

src/components/MainInfo/MainInfo.style.ts

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

src/components/MainInfo/index.tsx

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

0 commit comments

Comments
 (0)