pinafore/routes/_components/ExternalLink.html

32 lines
804 B
HTML
Raw Normal View History

2018-01-29 06:07:31 +01:00
<a rel="nofollow noopener"
target="_blank"
:href
aria-label={{ariaLabel || ''}}
2018-02-10 23:35:21 +01:00
class="{{className || ''}} {{showIcon ? 'external-link-with-icon' : ''}} {{normalIconColor ? 'normal-icon-color' : ''}}">
2018-03-07 08:27:36 +01:00
<slot></slot>{{#if showIcon}}
<svg class="external-link-svg">
2018-01-29 06:07:31 +01:00
<use xlink:href="#fa-external-link" />
</svg>
2018-03-07 08:27:36 +01:00
{{/if}}</a>
2018-01-29 04:01:51 +01:00
<style>
2018-01-29 06:07:31 +01:00
.external-link-with-icon {
2018-01-29 04:01:51 +01:00
display: inline-flex;
align-items: center;
}
.external-link-with-icon .external-link-svg {
2018-01-29 04:01:51 +01:00
margin-left: 4px;
width: 14px;
height: 14px;
fill: var(--deemphasized-text-color);
}
.external-link-with-icon.normal-icon-color .external-link-svg {
2018-02-10 23:35:21 +01:00
fill: var(--body-text-color);
}
</style>
<script>
export default {
data: () => ({
normalIconColor: false
})
}
</script>