fix: enable svelte a11y linting and fix violations

This commit is contained in:
2026-07-11 12:41:10 +01:00
parent d412dc3cc4
commit d172adf392
11 changed files with 57 additions and 6 deletions
@@ -727,6 +727,7 @@
{@const hasActiveFilters = Object.values(selectedFilters).some((v) => v && v !== '')}
{#if hasActiveFilters || selectedTag || selectedTags.length > 0}
<button
type="button"
class="filter-dropdown flex shrink-0 items-center justify-center"
onclick={clearFilters}
aria-label="Clear all filters"
@@ -750,6 +751,7 @@
{@const hasActiveFilter = selectedValue && selectedValue !== ''}
<div class="filter-dropdown relative shrink-0">
<button
type="button"
class="flex items-center gap-1 rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-sm transition-colors hover:bg-gray-50 {hasActiveFilter
? 'border-primary bg-primary/10'
: ''}"
@@ -781,6 +783,7 @@
style="position: fixed; left: {dropdownPosition?.x}px; top: {dropdownPosition?.y}px;"
>
<button
type="button"
class="filter-dropdown flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-fuchsia-50 {selectedValue ===
''
? 'bg-fuchsia-100 font-medium'
@@ -794,6 +797,7 @@
</button>
{#each filter.values as value (value.value)}
<button
type="button"
class="filter-dropdown flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-fuchsia-50 {selectedValue ===
value.value
? 'bg-fuchsia-100 font-medium'
@@ -827,6 +831,7 @@
{#if selectedTag || selectedTags.length > 0}
<button
type="button"
class="flex shrink-0 items-center justify-center"
onclick={clearSearch}
aria-label="Clear search tags"
@@ -852,6 +857,7 @@
<div class="grid grid-cols-3 gap-1 p-2 pt-0 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8">
{#each images as img (img.id)}
<button
type="button"
class="relative aspect-square overflow-hidden rounded-xs transition-opacity hover:opacity-90 active:opacity-75"
onclick={() => openModal(img)}
aria-label="View full size portfolio item"
@@ -970,6 +976,7 @@
</div>
<button
type="button"
bind:this={closeBtnRef}
class="absolute right-2 z-[60] rounded-full bg-black/50 p-2 text-white transition-colors hover:bg-black/70 sm:right-4"
onclick={closeModal}
@@ -987,6 +994,7 @@
{#if currentIndex > 0}
<button
type="button"
bind:this={prevButtonRef}
class="absolute top-1/2 left-2 z-[60] -translate-y-1/2 rounded-full bg-black/50 p-3 text-white transition-colors hover:bg-black/70 sm:left-4"
onclick={navigatePrev}
@@ -1005,6 +1013,7 @@
{#if currentIndex < images.length - 1}
<button
type="button"
bind:this={nextButtonRef}
class="absolute top-1/2 right-2 z-[60] -translate-y-1/2 rounded-full bg-black/50 p-3 text-white transition-colors hover:bg-black/70 sm:right-4"
onclick={navigateNext}