Skip to content

Commit 75847e2

Browse files
committed
focus ring on links
1 parent d9cb37a commit 75847e2

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

apps/svelte.dev/src/routes/packages/PackageCard.svelte

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,22 @@
8282
href="https://npmjs.org/package/{pkg.name}"
8383
target="_blank"
8484
rel="noreferrer"
85-
data-icon="npm"
8685
aria-label="View on npm"
8786
onclick={(e) => e.stopPropagation()}
88-
></a>
87+
>
88+
<span data-icon="npm"></span>
89+
</a>
8990

9091
{#if pkg.repo_url}
9192
<a
9293
href={pkg.repo_url}
9394
target="_blank"
9495
rel="noreferrer"
95-
data-icon="github"
9696
aria-label="View on GitHub"
9797
onclick={(e) => e.stopPropagation()}
98-
></a>
98+
>
99+
<span data-icon="github"></span>
100+
</a>
99101
{/if}
100102
</span>
101103
</div>
@@ -158,6 +160,15 @@
158160
position: absolute;
159161
right: 1rem;
160162
bottom: 1rem;
163+
164+
a {
165+
width: 1.4rem;
166+
height: 1.4rem;
167+
}
168+
169+
a:focus-visible {
170+
outline: 2px solid var(--sk-fg-accent);
171+
}
161172
}
162173
163174
a {
@@ -175,11 +186,6 @@
175186
mask: no-repeat 50% 50%;
176187
mask-size: contain;
177188
178-
&:focus {
179-
/* TODO use a focus ring instead (right now the mask breaks it) */
180-
background: var(--sk-fg-accent);
181-
}
182-
183189
&[data-icon='star'] {
184190
mask-image: url(icons/star);
185191
}

0 commit comments

Comments
 (0)