Skip to content

Commit a359ebf

Browse files
fix(ui5-link): enable overstyling (#5366)
fixes: #5267 #5218
1 parent 72b0c9f commit a359ebf

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

packages/main/src/themes/Link.css

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,14 @@
5555
word-wrap: normal;
5656
outline: none;
5757
text-decoration: inherit;
58+
color: inherit;
5859
}
5960

6061
:host(:active) .ui5-link-root {
6162
color: var(--sapLink_Active_Color);
6263
text-decoration: var(--_ui5_link_active_text_decoration);
6364
}
6465

65-
.ui5-link-root:visited {
66-
color: var(--sapLink_Visited_Color);
67-
}
68-
6966
:host .ui5-link-root {
7067
border: var(--_ui5_link_border);
7168
border-radius: var(--_ui5_link_focus_border-radius);
@@ -81,14 +78,15 @@
8178
text-shadow: none;
8279
}
8380

84-
:host(:hover),
85-
:host(:hover) .ui5-link-root {
81+
:host(:hover) {
8682
color: var(--sapLink_Hover_Color);
8783
text-decoration: var(--_ui5_link_hover_text_decoration);
8884
}
8985

90-
:host([focused]:hover),
86+
:host([focused]:hover) {
87+
text-decoration: var(--_ui5_link_focused_hover_text_decoration);
88+
}
89+
9190
:host([focused]:hover) .ui5-link-root {
9291
color: var(--_ui5_link_focused_hover_text_color);
93-
text-decoration: var(--_ui5_link_focused_hover_text_decoration);
9492
}

packages/main/test/pages/Link.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ <h2>prevent-default</h2>
4949
<ui5-link href="https://www.google.com" target="_self" id="link-click-prevent-default">link click default prevented</ui5-link><span>native span</span>
5050
</section>
5151

52+
<section class="group">
53+
<h2>overstyle-link</h2>
54+
<ui5-link href="https://www.google.com" target="_self" style="color: pink">link with different color</ui5-link><span>native span</span>
55+
</section>
56+
5257
<section class="group">
5358
<h2>Disabled link</h2>
5459
<ui5-link href="https://www.google.com" target="_blank" id="disabled-link" disabled>Disabled link</ui5-link>

0 commit comments

Comments
 (0)