Skip to content

Commit 355a981

Browse files
committed
Refine Navigation Styling with Subtle Underline Effects and Active State
- Simplify navigation link styles with clean, minimalist approach - Implement gradient underline hover and active states - Adjust spacing and typography for improved readability - Add dark mode enhancements for header branding - Optimize mobile navigation responsiveness
1 parent 8b5e32c commit 355a981

2 files changed

Lines changed: 49 additions & 77 deletions

File tree

css/style.css

Lines changed: 48 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ nav {
186186

187187
nav ul {
188188
display: flex;
189-
gap: 1rem;
189+
gap: 2rem;
190190
list-style: none;
191191
padding: 0;
192192
margin: 0;
@@ -200,57 +200,34 @@ nav a {
200200
color: var(--primary-color);
201201
text-decoration: none;
202202
font-weight: 500;
203-
font-size: 1rem;
204-
padding: 0.75rem 1.25rem;
205-
border-radius: 2rem;
206-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
203+
font-size: 0.95rem;
204+
letter-spacing: 0.01em;
205+
padding: 0.5rem 0;
206+
transition: color 0.2s ease;
207207
position: relative;
208208
display: inline-block;
209-
background: transparent;
210-
z-index: 1;
211209
}
212210

213-
nav a::before {
211+
nav a::after {
214212
content: '';
215213
position: absolute;
216-
inset: 0;
217-
background: linear-gradient(
218-
to right,
219-
rgba(var(--secondary-color-rgb), 0.1),
220-
rgba(var(--accent-color-rgb), 0.1)
221-
);
222-
border-radius: 2rem;
223-
z-index: -1;
224-
opacity: 0;
225-
transform: scale(0.85);
226-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
214+
bottom: 0;
215+
left: 0;
216+
width: 100%;
217+
height: 2px;
218+
background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
219+
transform: scaleX(0);
220+
transform-origin: right;
221+
transition: transform 0.3s ease;
227222
}
228223

229224
nav a:hover {
230225
color: var(--secondary-color);
231-
transform: translateY(-2px);
232-
}
233-
234-
nav a:hover::before {
235-
opacity: 1;
236-
transform: scale(1);
237-
}
238-
239-
nav a::after {
240-
content: '';
241-
position: absolute;
242-
bottom: 0.5rem;
243-
left: 50%;
244-
width: 0.25rem;
245-
height: 0.25rem;
246-
background: var(--secondary-color);
247-
border-radius: 50%;
248-
transform: translateX(-50%) scale(0);
249-
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
250226
}
251227

252228
nav a:hover::after {
253-
transform: translateX(-50%) scale(1);
229+
transform: scaleX(1);
230+
transform-origin: left;
254231
}
255232

256233
/* Active nav state */
@@ -260,25 +237,15 @@ nav a.active {
260237
}
261238

262239
nav a.active::after {
263-
transform: translateX(-50%) scale(1);
264-
width: 0.3rem;
265-
height: 0.3rem;
266-
background: var(--accent-color);
240+
transform: scaleX(1);
241+
opacity: 1;
267242
}
268243

269244
/* Dark mode navigation */
270245
[data-theme="dark"] nav a {
271246
color: var(--gray-300);
272247
}
273248

274-
[data-theme="dark"] nav a::before {
275-
background: linear-gradient(
276-
to right,
277-
rgba(var(--secondary-color-rgb), 0.15),
278-
rgba(var(--accent-color-rgb), 0.15)
279-
);
280-
}
281-
282249
[data-theme="dark"] nav a:hover {
283250
color: white;
284251
}
@@ -287,10 +254,6 @@ nav a.active::after {
287254
color: white;
288255
}
289256

290-
[data-theme="dark"] nav a::after {
291-
background: var(--accent-color);
292-
}
293-
294257
/* Mobile Menu */
295258
.menu-button {
296259
display: none;
@@ -299,34 +262,20 @@ nav a.active::after {
299262
color: var(--primary-color);
300263
font-size: 1.5rem;
301264
cursor: pointer;
302-
padding: 0.75rem;
303-
border-radius: 50%;
304-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
305-
aspect-ratio: 1;
306-
line-height: 1;
265+
padding: 0.5rem;
266+
transition: color 0.2s ease;
307267
}
308268

309269
.menu-button:hover {
310-
background: linear-gradient(
311-
to right,
312-
rgba(var(--secondary-color-rgb), 0.1),
313-
rgba(var(--accent-color-rgb), 0.1)
314-
);
315270
color: var(--secondary-color);
316-
transform: translateY(-2px);
317271
}
318272

319273
[data-theme="dark"] .menu-button {
320274
color: var(--gray-300);
321275
}
322276

323277
[data-theme="dark"] .menu-button:hover {
324-
background: linear-gradient(
325-
to right,
326-
rgba(var(--secondary-color-rgb), 0.15),
327-
rgba(var(--accent-color-rgb), 0.15)
328-
);
329-
color: white;
278+
color: var(--accent-color);
330279
}
331280

332281
/* Responsive Design */
@@ -388,18 +337,36 @@ nav a.active::after {
388337
}
389338

390339
nav a {
391-
font-size: 1.25rem;
392-
padding: 1rem 2rem;
340+
font-size: 1.125rem;
341+
padding: 0.5rem 0;
393342
display: block;
394343
text-align: center;
395344
}
396345

346+
nav a::after {
347+
left: 25%;
348+
width: 50%;
349+
}
350+
397351
[data-theme="dark"] nav {
398352
background: var(--gray-900);
399353
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
400354
}
401355
}
402356

357+
/* Add header branding dark mode styles */
358+
[data-theme="dark"] .site-header .brand-primary {
359+
color: white;
360+
}
361+
362+
[data-theme="dark"] .site-header .brand-secondary {
363+
background: linear-gradient(to right, #60a5fa, #38bdf8);
364+
-webkit-background-clip: text;
365+
background-clip: text;
366+
-webkit-text-fill-color: transparent;
367+
filter: brightness(1.25) contrast(1.1);
368+
}
369+
403370
/* Hero Section */
404371
.hero {
405372
contain: content;
@@ -1115,12 +1082,17 @@ textarea:focus {
11151082
}
11161083

11171084
nav a {
1118-
font-size: 1.25rem;
1119-
padding: 1rem 2rem;
1085+
font-size: 1.125rem;
1086+
padding: 0.5rem 0;
11201087
display: block;
11211088
text-align: center;
11221089
}
11231090

1091+
nav a::after {
1092+
left: 25%;
1093+
width: 50%;
1094+
}
1095+
11241096
[data-theme="dark"] nav {
11251097
background: var(--gray-900);
11261098
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.15);

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h1><span class="brand-primary">TMHS</span><span class="brand-secondary">Digital
7676
<i class="fas fa-bars"></i>
7777
</button>
7878
<ul>
79-
<li><a href="#home">Home</a></li>
79+
<li><a href="#home" class="active">Home</a></li>
8080
<li><a href="#features">Features</a></li>
8181
<li><a href="#about">About</a></li>
8282
<li><a href="#animation-showcase">Animations</a></li>

0 commit comments

Comments
 (0)