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

lightHouse 웹 접근성 93점을 98점으로 올렸음 #701

Merged
merged 6 commits into from
Oct 3, 2023
Merged

Conversation

Gilpop8663
Copy link
Collaborator

🔥 연관 이슈

close: #700

📝 작업 요약

라이트 하우스 웹 접근성 점수를93점에서 98점으로 올림

⏰ 소요 시간

1시간

🔎 작업 상세 설명

  • forwardRef로 Post에서 ref를 받도록 하여 기존에 div -> li로 사용하던 코드 삭제
  • 스타일드 컴포넌트 props에서 $를 안붙히고 사용하던 코드 수정
image

이전의 점수 기록은 해당 이슈에 정리 해놓았습니다

#700

🌟 논의 사항

웹 접근성에서 우리 색이 자꾸 대비가 낮다고 하는데 저는 무시하고 싶어요 얘네들이 권장하는 색까지 대비를 해보았더니 너무 안이쁘더라구요

대비 색 해볼수 있는 사이트

https://dequeuniversity.com/rules/axe/4.7/color-contrast

image

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

⚡️ Lighthouse report!

Category Score
🟠 Performance 57
🟠 Accessibilty 89
🟢 SEO 100
🟠 PWA 89
Category Score
🟢 First Contentful Paint 0.7 s
🟠 Largest Contentful Paint 3.9 s
🔴 Total Blocking Time 3,810 ms
🟢 Cumulative Layout Shift 0
🟠 Speed Index 3.7 s

Copy link
Member

@inyeong-kang inyeong-kang left a comment

Choose a reason for hiding this comment

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

와 우스 굉장히 유의미한 개선이네요!!
우리 팀이 웹접근성에도 신경을 많이 쓰는 점이 정말 좋아요🙂
forwardRef 로 컴포넌트에 ref를 전달하는 것도 👍입니다

border-radius: 4px;

width: ${({ progress }) => `${progress}%`};
width: ${({ $progress }) => `${$progress}%`};
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -61,3 +51,8 @@ export const HiddenButton = styled.button`
export const HiddenLink = styled(Link)`
position: absolute;
`;

export const HiddenList = styled.li`
Copy link
Member

Choose a reason for hiding this comment

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

오 이거 혹시 어디에 쓰이는 코드인가요??

export default memo(function Post({ postInfo, isPreview }: PostProps) {
const Post = forwardRef(function Post(
{ postInfo, isPreview }: PostProps,
ref: ForwardedRef<HTMLLIElement>
Copy link
Member

Choose a reason for hiding this comment

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

ForwardRef 라는 타입이 따로 있군요👍

@@ -29,7 +29,10 @@ interface PostProps {
isPreview: boolean;
}

export default memo(function Post({ postInfo, isPreview }: PostProps) {
const Post = forwardRef(function Post(
Copy link
Member

Choose a reason for hiding this comment

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

forwardRef 가 이런식으로 사용하는거군요!
react는 흥미로운 메서드가 정말 많네요🤔
새롭게 알아갑니다👍😃

(아래는 공식문서로 찾아본 내용)

DOM 노드를 상위 구성 요소에 노출
기본적으로 각 구성 요소의 DOM 노드는 비공개입니다. 그러나 때로는 DOM 노드를 상위 노드에 노출하는 것이 유용할 때도 있습니다. 예를 들어 DOM 노드에 초점을 맞추도록 허용하는 것입니다.

@inyeong-kang
Copy link
Member

inyeong-kang commented Oct 3, 2023

웹 접근성에서 우리 색이 자꾸 대비가 낮다고 하는데 저는 무시하고 싶어요 얘네들이 권장하는 색까지 대비를 해보았더니 너무 안이쁘더라구요

저도 동의합니다,, 최소 기준치를 넘은거 정도도 괜찮다고 생각해요. 사실 대비가 명확한 UI는 계속 보면 눈이 피로해지더라구요.. 권장 기준을 반드시 준수하지는 않아도 될 것 같습니다!

fe-리뷰완

Copy link
Collaborator

@chsua chsua left a comment

Choose a reason for hiding this comment

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

꼼꼼한 최적화 좋아요.
대단합니다!

<Post isPreview={true} postInfo={post} />
</div>
);
return <Post key={post.postId} ref={targetRef} isPreview={true} postInfo={post} />;
Copy link
Collaborator

Choose a reason for hiding this comment

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

코드도 훨씬 깔끔하네요

<S.HiddenButton
onClick={focusTopContent}
aria-label="스크롤 맨 위로가기"
></S.HiddenButton>
Copy link
Collaborator

Choose a reason for hiding this comment

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

사소한 부분이지만 아래처럼 self-closing tag로 작성해도 좋을 것 같아요!

<S.HiddenButton
                onClick={focusTopContent}
                aria-label="스크롤 맨 위로가기"
              / >

border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

> li {
Copy link
Collaborator

Choose a reason for hiding this comment

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

사용처로 코드를 이동시키니 이해가 훨씬 잘 되네요bb

@Gilpop8663 Gilpop8663 merged commit 36a74f3 into dev Oct 3, 2023
1 check passed
@Gilpop8663 Gilpop8663 deleted the feat/#700 branch October 3, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lightHouse 웹 접근성 93점을 100점으로 올리기
3 participants