1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

Support links without URLs provided

This commit is contained in:
2024-07-07 02:43:26 +04:00
parent 7eab8d633f
commit eae5016daa
2 changed files with 11 additions and 13 deletions

View File

@@ -9,11 +9,11 @@
display: flex;
flex-direction: column;
& > :global(a) {
& > :global(.menu-link) {
padding: 5px 24px;
}
:global(a) {
:global(.menu-link) {
color: colors.$text;
&:hover {

View File

@@ -1,8 +1,8 @@
<script>
/**
* @type {string}
* @type {string|null}
*/
export let href;
export let href = null;
/**
* @type {"tag"|"paint-brush"|"arrow-left"|"info-circle"|"wrench"|"globe"|"plus"|null}
@@ -15,19 +15,17 @@
export let target = undefined;
</script>
{#if href}
<a {href} {target} on:click>
{#if icon}
<i class="icon icon-{icon}"></i>
{/if}
<slot></slot>
</a>
{/if}
<svelte:element this="{href ? 'a': 'span'}" class="menu-link" {href} {target} on:click role="link" tabindex="0">
{#if icon}
<i class="icon icon-{icon}"></i>
{/if}
<slot></slot>
</svelte:element>
<style lang="scss">
@use '../../../styles/colors';
a {
.menu-link {
display: flex;
align-items: center;