Skip to content

Commit d01a503

Browse files
committed
Implement P0 enterprise accessibility fixes
✅ WCAG 2.1 Compliance: - Added focus indicators for all interactive elements - Skip navigation link for keyboard users - ARIA labels and roles for navigation - Consistent navigation pattern across breakpoints - Improved form focus states with proper contrast ✅ Enterprise Standards: - Proper outline styles with offset - Semantic HTML with roles - Keyboard navigation support - Screen reader friendly emoji handling
1 parent a9628cf commit d01a503

File tree

2 files changed

+64
-20
lines changed

2 files changed

+64
-20
lines changed

portfolio/themes/basic/layouts/_default/baseof.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,24 @@
1515
<link rel="stylesheet" href="{{ "css/minimal.css" | relURL }}">
1616
</head>
1717
<body>
18-
<nav>
18+
<a href="#main-content" class="skip-nav">Skip to main content</a>
19+
20+
<nav role="navigation" aria-label="Main navigation">
1921
<div class="nav-brand">{{ .Site.Params.author }}</div>
2022
<ul>
21-
<li><a href="{{ "/" | relURL }}"><span class="emoji">🏠</span> Home</a></li>
22-
<li><a href="{{ "/projects" | relURL }}"><span class="emoji">🛠️</span> Projects</a></li>
23-
<li><a href="{{ "/opensource" | relURL }}"><span class="emoji">🌍</span> Community</a></li>
24-
<li><a href="{{ "/contact" | relURL }}"><span class="emoji">📧</span> Connect</a></li>
23+
<li><a href="{{ "/" | relURL }}"><span class="emoji" aria-hidden="true">🏠</span> Home</a></li>
24+
<li><a href="{{ "/projects" | relURL }}"><span class="emoji" aria-hidden="true">🛠️</span> Projects</a></li>
25+
<li><a href="{{ "/opensource" | relURL }}"><span class="emoji" aria-hidden="true">🌍</span> Community</a></li>
26+
<li><a href="{{ "/contact" | relURL }}"><span class="emoji" aria-hidden="true">📧</span> Connect</a></li>
2527
</ul>
2628
</nav>
2729

28-
<main>
30+
<main id="main-content" role="main">
2931
{{ block "main" . }}{{ end }}
3032
</main>
3133

32-
<footer>
33-
<p><span class="emoji">👨💻</span> {{ .Site.Params.author }} | {{ .Site.Params.role }}</p>
34+
<footer role="contentinfo">
35+
<p><span class="emoji" aria-hidden="true">👨💻</span> {{ .Site.Params.author }} | {{ .Site.Params.role }}</p>
3436
</footer>
3537
</body>
3638
</html>

portfolio/themes/basic/static/css/minimal.css

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@
1111
--warm-beige: #E8DDD4;
1212
}
1313

14+
/* Skip Navigation */
15+
.skip-nav {
16+
position: absolute;
17+
top: -40px;
18+
left: 6px;
19+
background: var(--deep-purple);
20+
color: var(--light-gray);
21+
padding: 8px;
22+
text-decoration: none;
23+
border-radius: 4px;
24+
z-index: 1000;
25+
}
26+
27+
.skip-nav:focus {
28+
top: 6px;
29+
outline: 2px solid var(--warm-peach);
30+
}
31+
1432
/* Base Mobile Styles */
1533
* {
1634
margin: 0;
@@ -63,6 +81,12 @@ a:hover {
6381
padding: 2px 4px;
6482
}
6583

84+
a:focus {
85+
outline: 2px solid var(--rust-terracotta);
86+
outline-offset: 2px;
87+
background: var(--light-lavender);
88+
}
89+
6690
/* Navigation - Mobile First */
6791
nav {
6892
background: var(--deep-purple);
@@ -98,6 +122,13 @@ nav a:hover {
98122
color: var(--charcoal);
99123
}
100124

125+
nav a:focus {
126+
outline: 2px solid var(--warm-peach);
127+
outline-offset: 2px;
128+
background: var(--sage-green);
129+
color: var(--charcoal);
130+
}
131+
101132
/* Lists */
102133
ul, ol {
103134
margin: 1rem 0;
@@ -141,6 +172,12 @@ input, textarea {
141172
border-radius: 4px;
142173
}
143174

175+
input:focus, textarea:focus {
176+
outline: 2px solid var(--rust-terracotta);
177+
outline-offset: 2px;
178+
border-color: var(--deep-purple);
179+
}
180+
144181
button {
145182
background: var(--rust-terracotta);
146183
color: var(--light-gray);
@@ -156,6 +193,12 @@ button:hover {
156193
background: var(--deep-purple);
157194
}
158195

196+
button:focus {
197+
outline: 2px solid var(--warm-peach);
198+
outline-offset: 2px;
199+
background: var(--deep-purple);
200+
}
201+
159202
/* Footer */
160203
footer {
161204
margin-top: 3rem;
@@ -184,7 +227,7 @@ footer {
184227

185228
nav ul {
186229
display: flex;
187-
gap: 2rem;
230+
gap: 1rem;
188231
justify-content: center;
189232
}
190233

@@ -193,7 +236,7 @@ footer {
193236
}
194237

195238
nav a {
196-
display: inline;
239+
display: inline-block;
197240
padding: 0.5rem 1rem;
198241
}
199242

@@ -213,19 +256,18 @@ footer {
213256

214257
/* Desktop Enhancement */
215258
@media (min-width: 1024px) {
216-
nav {
217-
background: transparent;
218-
border-bottom: 1px solid var(--sage-green);
219-
padding: 1rem 0;
259+
nav ul {
260+
gap: 2rem;
220261
}
221262

222-
nav a {
223-
color: var(--steel-blue);
224-
background: none;
263+
nav a:hover {
264+
background: var(--light-lavender);
265+
color: var(--deep-purple);
225266
}
226267

227-
nav a:hover {
228-
color: var(--rust-terracotta);
229-
background: none;
268+
nav a:focus {
269+
outline: 2px solid var(--rust-terracotta);
270+
background: var(--light-lavender);
271+
color: var(--deep-purple);
230272
}
231273
}

0 commit comments

Comments
 (0)