본문으로 건너뛰기
Skillpedia
인터페이스 (UI/UX)75k · #2852

focus-styles

하는 일

이 스킬은 키보드 사용자가 컨트롤 사이를 이동할 때 사이트가 보이는 윤곽선을 보여 주는지 확인합니다. 접근성 있는 스타일을 원하는 디자이너와 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓CSS가 버튼이나 링크의 기본 윤곽선을 제거했을 때.
  • ✓키보드 사용자가 어떤 컨트롤이 선택되었는지 볼 수 없을 때.
  • ✓사용자 정의 버튼이나 링크 스타일을 디자인할 때.

스킬 링크

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/focus-styles/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/focus-styles/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“키보드로 이동할 때 버튼에 뚜렷한 윤곽선이 보이도록 해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 스타일시트에서 제거된 윤곽선을 찾고, 그 자리에 보이는 대체 스타일이 있는지 확인합니다. 충분한 대비와 명확한 간격을 가진 focus-visible 스타일을 제안합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Provide visible custom focus indicators

Users who navigate by keyboard (people with motor disabilities, power users, people in assistive technology contexts) rely entirely on focus indicators to know where they are on the page. Removing outlines without replacement makes an entire site unusable for keyboard users. WCAG 2.4.7 requires a visible focus indicator, and WCAG 2.4.13 defines a stronger size-and-contrast target for custom indicators.

Quick Reference

  • Never use outline: none or outline: 0 without a visible :focus-visible replacement
  • Use :focus-visible instead of :focus to show indicators only during keyboard navigation
  • Focus indicators must have 3:1 contrast ratio against adjacent colors (WCAG 2.2)
  • Provide at least 2px solid outline with an offset for a high-quality focus ring
  • If a focus ring is drawn with pseudo-elements, verify it is anchored to the correct positioned element and not clipped by overflow: hidden
  • If the component uses a stretched-link pattern, verify the visible focus ring follows the actual interactive element rather than a parent wrapper by accident

Check

Find all instances of outline: none, outline: 0, or :focus { outline: none } in this CSS. Check if they provide an alternative visible focus indicator. If the replacement uses pseudo-elements, also verify the ring cannot be clipped or misplaced by overflow or missing positioning context.

Fix

Replace outline: none on :focus with :focus-visible styles that provide a clearly visible custom focus ring with appropriate contrast.

Explain

Explain the difference between :focus and :focus-visible, why focus styles matter for accessibility, and how to design an accessible focus ring.

Code Review

Review stylesheets, component styles, and responsive states related to Provide visible custom focus indicators. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/css/focus-styles

자주 묻는 질문

윤곽선을 그냥 없애면 안 되나요?

키보드 사용자는 윤곽선으로 현재 위치를 알기 때문에, 없애면 사이트를 쓰기 어려워집니다.

focus-visible이란 무엇인가요?

주로 키보드 탐색 중에 초점 스타일을 보여 주고, 마우스 클릭 뒤에는 보이지 않게 하는 CSS 선택자입니다.

어떤 대비가 필요한가요?

이 스킬은 초점 표시가 주변 색과 3대 1 이상의 대비를 가져야 한다고 말합니다.

상세 정보

작성자의 원본 설명

Use when reviewing stylesheets, component styles, and responsive behavior related to Provide visible custom focus indicators. Check the rendered layout across breakpoints and interaction states before proposing a fix.

repo: thedaviddias/Front-End-Checklist

인기도

GitHub 스타
75k
순위
#2852
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬