Skip to content

Commit 1138039

Browse files
authored
Fix #3130 by not applying inline margin for hypertext. (#3131)
1 parent 1f5479d commit 1138039

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

examples/Demo/Shared/Pages/Anchor/Examples/AnchorIcons.razor

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919
</FluentAnchor>
2020
</div>
2121
<h4>Hypertext appearane</h4>
22+
<p>
23+
By default, the margin between the icon and the link is equal to the margin that is used for the other
24+
appearances. If you find that margin to large, you can add the following to your CSS:<br/><br />
25+
<CodeSnippet>
26+
/* for icon at the start */
27+
fluent-anchor[appearance="hypertext"]::part(start) {
28+
margin-inline-end: calc(var(--design-unit) * 1px);
29+
}
30+
/* for icon at the end */
31+
fluent-anchor[appearance="hypertext"]::part(end) {
32+
margin-inline-start: calc(var(--design-unit) * 1px);
33+
}
34+
</CodeSnippet>
35+
<br />
36+
<em>Do not use these styles if there is no icon being displayed with a hypertext. It will cause the hypertext to get a margin at the stat/end.</em>
37+
</p>
2238
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 1em;">
2339
<FluentAnchor Appearance="@Appearance.Hypertext" Href="#" IconStart="@(new Icons.Regular.Size16.Globe())">
2440
Icon at start

src/Core/Components/Anchor/FluentAnchor.razor.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ fluent-anchor[appearance="hypertext"]::part(start) {
33
display: unset;
44
position: relative;
55
top: calc(var(--design-unit)* 1px);
6-
margin-inline-end: calc(var(--design-unit) * 1px);
76
}
87

98
fluent-anchor[appearance="hypertext"]::part(end) {
109
display: unset;
1110
position: relative;
1211
top: calc(var(--design-unit)* 1px);
13-
margin-inline-start: calc(var(--design-unit) * 1px);
1412
}

0 commit comments

Comments
 (0)