diff --git a/app/components/primer/beta/link.html.erb b/app/components/primer/beta/link.html.erb index 9d95eb0da2..25093f52b2 100644 --- a/app/components/primer/beta/link.html.erb +++ b/app/components/primer/beta/link.html.erb @@ -1,13 +1,17 @@ <%= render Primer::ConditionalWrapper.new(condition: tooltip?, trim: true, tag: :span, position: :relative) do %> <%= render(Primer::BaseComponent.new(trim: true, **@system_arguments)) do %> - <%= render(Primer::BaseComponent.new(tag: :span, classes: "Link-content", trim: true)) do %> - <% if leading_visual %> - <%= leading_visual %> + <% if leading_visual || trailing_visual %> + <%= render(Primer::BaseComponent.new(tag: :span, classes: "Link-content", trim: true)) do %> + <% if leading_visual %> + <%= leading_visual %> + <% end %> + <%= content %> + <% if trailing_visual %> + <%= trailing_visual %> + <% end %> <% end %> + <% else %> <%= content %> - <% if trailing_visual %> - <%= trailing_visual %> - <% end %> <% end %> <% end %> <%= tooltip if tooltip? %> diff --git a/static/classes.json b/static/classes.json index bcd8c93cc9..4e46c9161d 100644 --- a/static/classes.json +++ b/static/classes.json @@ -404,6 +404,9 @@ "Link--underline": [ "Primer::Beta::Link" ], + "Link-content": [ + "Primer::Beta::Link" + ], "Overlay": [ "Primer::Alpha::Dialog", "Primer::Alpha::Overlay"