Skip to content

Commit 68b02cd

Browse files
committed
Use CSS3 transform instead of change in width for masthead menu underline effect
1 parent 213e2fe commit 68b02cd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

assets/_scss/_navigation.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,17 @@
227227
&:before {
228228
content: "";
229229
position: absolute;
230+
left: 0;
230231
bottom: 0;
231232
height: 4px;
232233
background: mix(#fff, $primary-color, 50%);
233-
width: 0;
234+
width: 100%;
234235
transition: $global-transition;
236+
transform: scaleX(0); // hide
235237
}
236238

237-
&:hover {
238-
&:before {
239-
width: 100%;
240-
}
239+
&:hover:before {
240+
transform: scaleX(1); // reveal
241241
}
242242
}
243243
}

0 commit comments

Comments
 (0)