Skip to content

Commit

Permalink
fix(link): add missing icon for help link variant (#1943)
Browse files Browse the repository at this point in the history
* fix(link): added missing icon for help variant

* docs(link): add missing help link examples

* style(link): hello linter my old friend
  • Loading branch information
pixelflips authored Aug 9, 2024
1 parent 4c869f3 commit f3be8b7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/app/views/examples/components/link/_preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,22 @@ Neutral links live in items with non-white backgrounds, such as Banner and Toast
}
}
} %>

<h3 class="t-sage-heading-6">Help Link</h3>

<div>
<%= sage_component SageLink, {
url: "https://example.com",
label: "External link",
help_link: true,
show_label: false
} %>
</div>
<div>
<%= sage_component SageLink, {
url: "https://example.com",
label: "Help link label",
help_link: true,
show_label: true,
} %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ html_attributes[:class] = css_classes
.squish
%>
<%= link_to component.url, html_attributes do %>
<% if component.icon %>
<% if component.icon && !component.help_link %>
<pds-icon name="<%= component.icon[:name] %>" class="sage-link__icon"></pds-icon>
<% end %>
<% if component.help_link && !component.icon %>
<pds-icon name="question-circle" class="sage-link__icon"></pds-icon>
<% end %>
<%= label %>
<% end %>
2 changes: 2 additions & 0 deletions packages/sage-assets/lib/stylesheets/components/_link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ $-link-base-styles: (
.sage-link--help-icon-only {
position: relative;
text-decoration: none;
color: inherit;

&::before,
pds-icon {
Expand All @@ -178,6 +179,7 @@ $-link-base-styles: (
&:hover,
&:active,
&:focus {
color: inherit;
outline: 0;

pds-icon {
Expand Down

0 comments on commit f3be8b7

Please sign in to comment.