Skip to content

Commit

Permalink
Add 'no icon' version of resource link
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde de Vries <[email protected]>
  • Loading branch information
hidde committed Aug 25, 2021
1 parent 3cec2d1 commit bae19e2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
4 changes: 4 additions & 0 deletions _components/resource-link.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@
}
.resource-link svg {
margin-right: 0.25em;
}
.resource-link--no-icon {
background-color: var(--pure-white);
padding-inline: 0.75em;
}
6 changes: 6 additions & 0 deletions _components/resource-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ Embedding your report:
label="Implementing A.3.1.1"
href="https://www.w3.org/TR/IMPLEMENTING-ATAG20/#sc_a311"
%}

{% include resource-link.html
label="Ada Lovelace"
href="#"
noicon="true"
%}
25 changes: 13 additions & 12 deletions _includes/resource-link.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

<a
href="{{ include.href }}"
class="resource-link"
class='resource-link
{% if include.noicon == "true" %} resource-link--no-icon{% endif %}
'
target="_blank"
rel="noopener roreferrer">
<svg
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
Expand All @@ -14,17 +15,17 @@
role="presentation"
>
<path
fill="currentColor"
d="M7 4.75c0-0.412 0.338-0.75 0.75-0.75h0.5c0.412 0 0.75 0.338 0.75
0.75v0.5c0 0.412-0.338 0.75-0.75 0.75h-0.5c-0.412
0-0.75-0.338-0.75-0.75v-0.5z" />
fill="currentColor"
d="M7 4.75c0-0.412 0.338-0.75 0.75-0.75h0.5c0.412 0 0.75 0.338 0.75
0.75v0.5c0 0.412-0.338 0.75-0.75 0.75h-0.5c-0.412
0-0.75-0.338-0.75-0.75v-0.5z" />
<path fill="currentColor" d="M10 12h-4v-1h1v-3h-1v-1h3v4h1z" />
<path
fill="currentColor"
d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8
14.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5 6.5 2.91 6.5 6.5-2.91
6.5-6.5 6.5z" />
</svg>
fill="currentColor"
d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8
14.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5 6.5 2.91 6.5 6.5-2.91
6.5-6.5 6.5z" />
</svg>
<span>
{{ include.label }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Large diffs are not rendered by default.

0 comments on commit bae19e2

Please sign in to comment.