Skip to content

Commit 03b50c2

Browse files
committed
♿️ Improve overall a11
1 parent cc9567b commit 03b50c2

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

src/components/CopySaveActions.svelte

+15-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
export let onSave
99
1010
const VALIDATION_ANIMATION_DURATION = 700
11+
const DOWNLOAD_MINIFIED_CSS = "Download minified css"
12+
const COPY_MINIFIED_CSS = "Copy minified css to clipboard"
13+
1114
let isSavedToClipboard = false
1215
let isSaved = false
1316
@@ -31,10 +34,20 @@
3134
</script>
3235

3336
<div class={`d-flex ${className} copy-save-actions`}>
34-
<button class="btn btn-link p-1" on:click={saveToClipboard}>
37+
<button
38+
class="btn btn-link p-1"
39+
title={COPY_MINIFIED_CSS}
40+
aria-label={COPY_MINIFIED_CSS}
41+
on:click={saveToClipboard}
42+
>
3543
<Icon name={isSavedToClipboard ? 'check' : 'clipboard'}/>
3644
</button>
37-
<button class="btn btn-link p-1 ms-1" on:click={save}>
45+
<button
46+
class="btn btn-link p-1 ms-1"
47+
title={DOWNLOAD_MINIFIED_CSS}
48+
aria-label={DOWNLOAD_MINIFIED_CSS}
49+
on:click={save}
50+
>
3851
<Icon name={isSaved ? 'check' : 'download'}/>
3952
</button>
4053
</div>

src/components/SavedSizeBadge.svelte

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
export { className as class }
55
</script>
66

7-
<span class={`fw-lighter fst-italic ${className}`}> - saved {size / 1000} kB</span>
7+
<span
8+
class={`fw-lighter fst-italic ${className}`}
9+
aria-live="polite"
10+
>
11+
- saved {size / 1000} kB
12+
</span>

src/components/Textarea.svelte

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@
4646
</button>
4747

4848
<div id="result" class="position-relative ms-2 flex-grow-1 d-flex p-0 align-items-center" style="width: 0;">
49-
<input class="form-control" type="text" disabled={optimizedInput === undefined} bind:value={optimizedInput}>
49+
<input
50+
type="text"
51+
class="form-control"
52+
aria-hidden={true}
53+
disabled={optimizedInput === undefined}
54+
bind:value={optimizedInput}
55+
>
5056
{#if optimizedInput !== undefined}
5157
<SavedSizeBadge size={savedSize} class="text-nowrap ms-2" />
5258
<CopySaveActions

0 commit comments

Comments
 (0)