Skip to content

Commit aa8635b

Browse files
committed
feat: improve header accessibility and styling for navigation links
1 parent 21bef41 commit aa8635b

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/components/Header.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ const Header: React.FC = () => {
114114
>
115115
{/* 네비게이션 링크 */}
116116
<nav className="hidden md:flex space-x-4 lg:space-x-8 pe-2 md:pe-5">
117-
<a href="#about" className="hover:no-underline text-sm md:text-base">
117+
<a href="#about" className="hover:no-underline text-sm md:text-base flex items-center h-6">
118118
About
119119
</a>
120-
<a href="#experience" className="hover:no-underline text-sm md:text-base">
120+
<a href="#experience" className="hover:no-underline text-sm md:text-base flex items-center h-6">
121121
Experience
122122
</a>
123-
<a href="#projects" className="hover:no-underline text-sm md:text-base">
123+
<a href="#projects" className="hover:no-underline text-sm md:text-base flex items-center h-6">
124124
Projects
125125
</a>
126126
</nav>
@@ -129,7 +129,7 @@ const Header: React.FC = () => {
129129
<div className="relative">
130130
<button
131131
onClick={() => setShowLanguageMenu(!showLanguageMenu)}
132-
className="p-0 m-0 border-none bg-transparent"
132+
className="p-0 m-0 border-none bg-transparent flex items-center h-6"
133133
aria-label="Select language"
134134
aria-expanded={showLanguageMenu}
135135
aria-haspopup="true"
@@ -168,7 +168,7 @@ const Header: React.FC = () => {
168168
{/* 다크모드 */}
169169
<button
170170
onClick={toggleDarkMode}
171-
className="p-0 m-0 border-none bg-transparent"
171+
className="p-0 m-0 border-none bg-transparent flex items-center h-6"
172172
aria-label={darkMode ? "Switch to light mode" : "Switch to dark mode"}
173173
>
174174
{darkMode ? <Sun aria-hidden="true" /> : <Moon aria-hidden="true" />}
@@ -177,7 +177,7 @@ const Header: React.FC = () => {
177177
{/* BGM 선택 */}
178178
<button
179179
onClick={() => setShowAudioPopup(true)}
180-
className="p-0 m-0 border-none bg-transparent"
180+
className="p-0 m-0 border-none bg-transparent flex items-center h-6"
181181
aria-label="Open audio player"
182182
>
183183
<Speaker aria-hidden="true" />

src/components/SkipLink.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
/* Screen reader only utility, but visible on focus */
22
.skip-link {
33
position: absolute;
4-
top: -40px;
5-
left: 0; background: #0056b3; /* WCAG AAA compliant contrast ratio */
4+
top: -100px; /* 화면 밖으로 완전히 숨김 */
5+
left: 50%;
6+
transform: translateX(-50%);
7+
background: #0056b3; /* WCAG AAA compliant contrast ratio */
68
color: white;
79
padding: 10px 20px;
810
text-decoration: none;
9-
border-radius: 0 0 4px 0;
11+
border-radius: 0 0 4px 4px;
1012
z-index: 10000;
1113
font-weight: 700;
1214
transition: top 0.2s ease;
1315
border: 2px solid white;
1416
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
17+
white-space: nowrap; /* 텍스트 줄바꿈 방지 */
1518
}
1619

1720
.skip-link:focus,

0 commit comments

Comments
 (0)