Skip to content

Commit 102439c

Browse files
fix: notion link hover+focus underline animation
1 parent c9e7a4d commit 102439c

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

styles/notion.css

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -217,33 +217,25 @@
217217
position: relative;
218218
transition: unset;
219219
opacity: 1;
220-
border-bottom-width: 0.08rem;
220+
border-bottom-width: 0.1rem;
221+
background: transparent;
222+
background-origin: border-box;
223+
background-repeat: no-repeat;
224+
background-position: 50% 100%;
225+
background-size: 0 0.1rem;
221226
}
222227

223228
.notion-link:focus,
224229
.notion-link:hover {
225-
border-bottom-style: none;
226-
}
230+
border-bottom-color: transparent;
227231

228-
.notion-link:focus::after,
229-
.notion-link:hover::after {
230-
visibility: visible;
231-
width: 100%;
232-
left: 0;
233-
}
232+
background-image: linear-gradient(90.68deg, #b439df 0.26%, #e5337e 102.37%);
233+
background-repeat: no-repeat;
234+
background-position: 0 100%;
235+
background-size: 100% 0.1rem;
234236

235-
.notion-link::after {
236-
content: '';
237-
position: absolute;
238-
bottom: -0.1rem;
239-
left: 50%;
240-
width: 0;
241-
height: 0.1rem;
242-
transform: scaleX(1);
243-
transition-property: width, left;
237+
transition-property: background-position, background-size;
244238
transition-duration: 300ms;
245-
visibility: hidden;
246-
background: linear-gradient(90.68deg, #b439df 0.26%, #e5337e 102.37%);
247239
}
248240

249241
.notion-red_background,

0 commit comments

Comments
 (0)