Skip to content

Commit

Permalink
feat: add external link CSS based on USWDS example, apply to footer link
Browse files Browse the repository at this point in the history
uses CSS keyword 'currentColor' to achieve hover and visited styles
  • Loading branch information
angela-tran committed Jul 17, 2023
1 parent 6d24a70 commit 179246c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benefits/core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ <h1>{{ page.headline }}</h1>
<a class="m-0 ps-5 ps-lg-0" href="{% url "core:help" %}">{% translate "core.buttons.help" %}</a>
</li>
<li>
<a class="m-0 ps-5 ps-lg-0" href="https://cdt.ca.gov/privacy-policy/" target="_blank" rel="noopener noreferrer">{% translate "core.buttons.privacy" %}</a>
<a class="m-0 ps-5 ps-lg-0 external-link" href="https://cdt.ca.gov/privacy-policy/" target="_blank" rel="noopener noreferrer">{% translate "core.buttons.privacy" %}
</a>
</li>
</ul>
</div>
Expand Down
19 changes: 19 additions & 0 deletions benefits/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,25 @@ a:visited:not(.btn) {
color: var(--selected-color);
}

.external-link::after {
content: " ";
background-color: currentColor;

mask-image: url("/static/img/external-link.svg"),
linear-gradient(transparent, transparent);
mask-position: center center;
-webkit-mask-image: url("/static/img/external-link.svg"),
linear-gradient(transparent, transparent);
-webkit-mask-position: center center;

display: inline-block;
position: relative;
width: 24px;
height: 24px;
margin-left: 2px;
vertical-align: text-bottom;
}

/* Headlines */
/* All headlines */
/* All headlines share font-weight, letter-spacing, line-height and margin */
Expand Down
11 changes: 11 additions & 0 deletions benefits/static/img/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 179246c

Please sign in to comment.