-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add badge code and guidance #81
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: Badges | ||
lead: > | ||
Badges are used to encourage user behavior throughout the site. | ||
--- | ||
|
||
Badges can help signal to the user that they had completed a workflow desired by Login.gov. Primarily, these are used on our user account page to encourage more secure practices. | ||
|
||
Badges are comprised with a div using the `lg-verification-badge` class and a small SVG image alongside a `span` of text. | ||
|
||
## An unphishable badge example | ||
|
||
The unphishable badge is used to indicate that an account is only using security keys as its MFA method. | ||
|
||
{% capture example %} | ||
<div class="lg-verification-badge"> | ||
<img src="{{ site.baseurl }}/assets/img/alerts/unphishable.svg" width="16" height="16" class="text-middle" alt="unphishable icon" id="unphishable_badge" /> | ||
<span>Unphishable</span> | ||
</div> | ||
{% endcapture %} | ||
{% include helpers/code-example.html code=example %} | ||
|
||
## A verified account badge example | ||
|
||
A verfied account badge is used to indicate that an account has completed the identity verification process. | ||
|
||
{% capture example %} | ||
<div class="lg-verification-badge"> | ||
<img src="{{ site.baseurl }}/assets/img/alerts/success-badge.svg" width="16" height="16" class="text-middle" alt="verification icon" id="verified_account_badge" /> | ||
<span>Verified Account</span> | ||
</div> | ||
{% endcapture %} | ||
{% include helpers/code-example.html code=example %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.lg-verification-badge { | ||
|
||
background-color: map-get($site-palette, 'site-white'); | ||
border: units(1px) solid map-get($site-palette, 'site-green'); | ||
border-radius: $theme-border-radius-xxl; | ||
box-sizing: border-box; | ||
display: inline-block; | ||
padding: units(1) units(2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. USWDS has some globally available spacing units so I swapped the space variables to these. https://v2.designsystem.digital.gov/design-tokens/spacing-units/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah nice! |
||
white-space: nowrap; | ||
|
||
img { | ||
margin-right: units(1); | ||
} | ||
|
||
span { | ||
vertical-align: text-top; | ||
} | ||
} | ||
|
||
@media #{$theme-site-margins-breakpoint} { | ||
.lg-verification-badge { | ||
margin: units(-1) 0 0; | ||
position: static; | ||
text-align: right; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I restructured this to be an img and span inside a div to make it easier to use the
vertical-alignment
controls.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that makes sense