Skip to content

Commit 689c595

Browse files
committed
fix: multiline link underline animation
1 parent 308d135 commit 689c595

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

crates/rostra-web-ui/assets/style.css

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -266,36 +266,24 @@ textarea:-moz-autofill {
266266
a {
267267
color: var(--color-link);
268268
text-decoration: none;
269-
position: relative;
270-
transition: color 0.2s;
271-
}
272-
273-
a::after {
274-
content: '';
275-
position: absolute;
276-
width: 100%;
277-
height: 1px;
278-
bottom: -2px;
279-
left: 0;
280-
background-color: currentColor;
281-
transform: scaleX(0);
282-
transition: transform 0.2s;
269+
transition: color 0.2s, background-size 0.2s;
270+
background-image: linear-gradient(currentColor, currentColor);
271+
background-position: 0% 100%;
272+
background-repeat: no-repeat;
273+
background-size: 0% 1px;
274+
-webkit-box-decoration-break: clone;
275+
box-decoration-break: clone;
283276
}
284277

285278
a:hover {
286279
color: var(--color-link-hover);
287-
/* Darker blue */
288-
}
289-
290-
a:hover::after {
291-
transform: scaleX(1);
280+
background-size: 100% 1px;
292281
}
293282

294283

295284
/* Active/clicked state */
296285
a:active {
297-
color: red;
298-
/* Very dark blue */
286+
color: var(--color-link-hover);
299287
}
300288

301289
img {
@@ -743,7 +731,7 @@ emoji-picker {
743731
}
744732

745733
.m-rostraMedia__download:hover {
746-
/* Underline handled by global a::after */
734+
/* Underline handled by global link styles */
747735
}
748736

749737
.m-rostraMedia__downloadIcon {
@@ -869,8 +857,8 @@ emoji-picker {
869857
background: var(--color-button-bg-hover);
870858
}
871859

872-
.m-postView__actionMenuItem::after {
873-
display: none;
860+
.m-postView__actionMenuItem {
861+
background-image: none;
874862
}
875863

876864
/* Style forms inside dropdown to not add extra space */
@@ -1952,7 +1940,7 @@ input:checked+.slider:before {
19521940
}
19531941

19541942
.m-followeeList__name:hover {
1955-
/* Underline handled by global a::after */
1943+
/* Underline handled by global link styles */
19561944
}
19571945

19581946
.m-followeeList__actions {
@@ -2112,7 +2100,7 @@ input:checked+.slider:before {
21122100
}
21132101

21142102
.m-eventExplorer__parentLink:hover {
2115-
/* Underline handled by global a::after */
2103+
/* Underline handled by global link styles */
21162104
color: var(--color-link-hover);
21172105
}
21182106

@@ -2340,8 +2328,8 @@ input:checked+.slider:before {
23402328
background: var(--color-button-bg-hover);
23412329
}
23422330

2343-
.o-welcomePage__button::after {
2344-
display: none; /* Remove link underline animation */
2331+
.o-welcomePage__button {
2332+
background-image: none; /* Remove link underline animation */
23452333
}
23462334

23472335
.o-welcomePage__footer {

0 commit comments

Comments
 (0)