Skip to content

Commit

Permalink
Use design system link styles in documentation (#252)
Browse files Browse the repository at this point in the history
* Use design system link styles in documentation

**Why**: Because a design system's documentation should ideally leverage said design system's own link styles.

* Fix typo in component external link
  • Loading branch information
aduth authored Sep 22, 2021
1 parent 606d2cd commit 54c752b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
8 changes: 2 additions & 6 deletions docs/_includes/helpers/base-component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
{% assign uswds_url = include.component | append: '/' | prepend: 'https://designsystem.digital.gov/components/' %}
{% assign sass_url = stylesheet | append: '.scss' | prepend: 'https://github.com/18F/identity-style-guide/blob/main/src/scss/components/_' %}

<a href="{{ uswds_url }}" class="usa-link usa-link--external margin-bottom-2">
View USWDS component
</a>
[View USWDS component]({{ uswds_url }}){: .usa-link--external}

<a href="{{ sass_url }}" class="usa-link usa-link--external">
View Login.gov SCSS on GitHub
</a>
[View Login.gov SCSS on GitHub]({{ sass_url }}){: .usa-link--external}
12 changes: 12 additions & 0 deletions docs/_plugins/content_typography.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Kramdown
module Parser
class Kramdown
prepend(Module.new do
def add_link(el, *args)
el.attr['class'] = [*el.attr['class'], 'usa-link'].join(' ') if el.type == :a
super(el, *args)
end
end)
end
end
end
2 changes: 1 addition & 1 deletion docs/_utilities/color.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The color codes listed beneath each name indicate what names can be used with th
This element has classes <code>bg-primary-lighter</code> and <code>text-primary-dark</code>.
</div>

Read more about <a href="https://v2.designsystem.digital.gov/utilities/color/" target="_blank">the U.S. Web Design System’s color utility classes</a>.
Read more about [the U.S. Web Design System’s color utility classes](https://designsystem.digital.gov/utilities/color/).

## Featured palette
<div class="border-top">
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Install images, stylesheets, and script files in both their original and compile

# Built with USWDS

The {{ site.title }} is built using the <a href="https://v2.designsystem.digital.gov/" target="_blank">U.S. Web Design System</a> for a consistent appearance across government sites.
The {{ site.title }} is built using the [U.S. Web Design System](https://designsystem.digital.gov/) for a consistent appearance across government sites.

</div>
</div>
Expand All @@ -46,7 +46,7 @@ The {{ site.title }} is built using the <a href="https://v2.designsystem.digital

# A work in progress

The latest version is <strong class="text-no-wrap">{{ site.package_json.this_version }}</strong> which uses <strong class="text-no-wrap">uswds@{{ site.package_json.uswds_version }}</strong>. Spot an issue? We’d love to hear about it <a href="https://github.com/18F/identity-style-guide/issues" target="_blank">on GitHub</a>.
The latest version is <strong class="text-no-wrap">{{ site.package_json.this_version }}</strong> which uses <strong class="text-no-wrap">uswds@{{ site.package_json.uswds_version }}</strong>. Spot an issue? We’d love to hear about it [on GitHub](https://github.com/18F/identity-style-guide/issues).

</div>
</div>
Expand Down

0 comments on commit 54c752b

Please sign in to comment.