web/Omnibox: clean up input link icon code

This commit is contained in:
wukko 2024-08-16 01:44:13 +06:00
parent 478dd6e515
commit b9fabdc327
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -132,11 +132,13 @@
class:focused={isFocused} class:focused={isFocused}
class:downloadable={validLink($link)} class:downloadable={validLink($link)}
> >
{#if isDisabled} <div id="input-link-icon" class:loading={isDisabled}>
<IconLoader2 id="input-link-icon" class="loading" /> {#if isDisabled}
{:else} <IconLoader2 />
<IconLink id="input-link-icon" /> {:else}
{/if} <IconLink />
{/if}
</div>
<input <input
id="link-area" id="link-area"
@ -232,14 +234,18 @@
outline: var(--secondary) 0.5px solid; outline: var(--secondary) 0.5px solid;
} }
:global(#input-link-icon) { #input-link-icon {
display: flex;
}
#input-link-icon :global(svg) {
stroke: var(--gray); stroke: var(--gray);
width: 18px; width: 18px;
height: 18px; height: 18px;
stroke-width: 2px; stroke-width: 2px;
} }
:global(#input-link-icon.loading) { #input-link-icon.loading :global(svg) {
animation: spin 0.7s infinite linear; animation: spin 0.7s infinite linear;
} }
@ -252,11 +258,11 @@
} }
} }
#input-container.focused :global(#input-link-icon) { #input-container.focused #input-link-icon :global(svg) {
stroke: var(--secondary); stroke: var(--secondary);
} }
#input-container.downloadable :global(#input-link-icon) { #input-container.downloadable #input-link-icon :global(svg) {
stroke: var(--secondary); stroke: var(--secondary);
} }