pinafore/routes/_components/ExternalLink.html

31 lines
793 B
HTML
Raw Normal View History

2018-01-29 05:07:31 +00:00
<a rel="nofollow noopener"
target="_blank"
href="{{href}}"
2018-02-10 22:35:21 +00:00
class="{{className || ''}} {{showIcon ? 'external-link-with-icon' : ''}} {{normalIconColor ? 'normal-icon-color' : ''}}">
2018-03-07 07:27:36 +00:00
<slot></slot>{{#if showIcon}}
2018-01-29 05:07:31 +00:00
<svg>
<use xlink:href="#fa-external-link" />
</svg>
2018-03-07 07:27:36 +00:00
{{/if}}</a>
2018-01-29 03:01:51 +00:00
<style>
2018-01-29 05:07:31 +00:00
.external-link-with-icon {
2018-01-29 03:01:51 +00:00
display: inline-flex;
align-items: center;
}
2018-01-29 05:07:31 +00:00
.external-link-with-icon svg {
2018-01-29 03:01:51 +00:00
margin-left: 4px;
width: 14px;
height: 14px;
fill: var(--deemphasized-text-color);
}
2018-02-10 22:35:21 +00:00
.external-link-with-icon.normal-icon-color svg {
fill: var(--body-text-color);
}
2018-01-29 05:07:31 +00:00
</style>
<script>
export default {
oncreate() {
this.set({className: this.get('class')}) // workaround for "class" property name bug in svelte
}
}
</script>