Link component

This commit is contained in:
Lea Anthony
2020-10-12 06:56:32 +11:00
parent be952ba2da
commit 39c599d2de

View File

@@ -0,0 +1,37 @@
<script>
import runtime from '@wails/runtime';
import { darkMode } from '../Store';
export let href;
$: linkclass = darkMode ? 'dark' : 'light';
function openLink() {
runtime.Browser.OpenURL(href);
}
</script>
<span class="link {linkclass}" on:click="{openLink}"><slot></slot></span>
<style>
.link {
text-decoration: underline;
cursor: pointer;
}
.link.dark:hover {
color: #ff8bfb;
}
.link.dark {
color: #ff8bfb88;
}
.link.light {
color: #5c5cff;
text-decoration: underline;
}
</style>