misc: Improve accessibility
This commit is contained in:
1 parent
ce19dd3a17
commit
0cd8fb1165
6 files changed
+28
-10
No files matched your search
@@ -8,6 +8,7 @@
|
|||||||
export let large = false
|
export let large = false
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let submit = false
|
export let submit = false
|
||||||
|
export let label: string = ''
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
</script>
|
</script>
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
? 'opacity-50 pointer-events-none'
|
? 'opacity-50 pointer-events-none'
|
||||||
: ''}"
|
: ''}"
|
||||||
type={submit ? 'submit' : 'button'}
|
type={submit ? 'submit' : 'button'}
|
||||||
|
aria-label={label}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="flex flex-row items-center justify-center gap-2"
|
class="flex flex-row items-center justify-center gap-2"
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Color } from '$lib/ui/colors.js'
|
import { Color } from '$lib/ui/colors.js'
|
||||||
|
|
||||||
export let color: Color = Color.secondary
|
export let color: Color = Color.secondary
|
||||||
export let href = ''
|
export let href = ''
|
||||||
|
export let label: string = ''
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
{href}
|
{href}
|
||||||
class="px-2 py-1 rounded-md {color} flex flex-row items-center
|
class="px-2 py-1 rounded-md {color} flex flex-row items-center
|
||||||
justify-center text-sm transition-all"
|
justify-center text-sm transition-all"
|
||||||
|
aria-label={label}
|
||||||
>
|
>
|
||||||
<slot name="icon" />
|
<slot name="icon" />
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<Menu top absolute class="bottom-0 right-0 m-5 z-10">
|
<Menu top absolute class="bottom-0 right-0 m-5 z-10">
|
||||||
<Button slot="button">
|
<Button slot="button" label="Post actions">
|
||||||
<Icon src={EllipsisHorizontal} width={16} mini />
|
<Icon src={EllipsisHorizontal} width={16} mini />
|
||||||
</Button>
|
</Button>
|
||||||
<span class="mx-4 text-xs opacity-80 text-left my-2">Post Actions</span>
|
<span class="mx-4 text-xs opacity-80 text-left my-2">Post Actions</span>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
import MarkdownQuote from '$lib/components/markdown/MarkdownQuote.svelte'
|
import MarkdownQuote from '$lib/components/markdown/MarkdownQuote.svelte'
|
||||||
import SvelteMarkdown from 'svelte-markdown'
|
import SvelteMarkdown from 'svelte-markdown'
|
||||||
import MarkdownList from '$lib/components/markdown/MarkdownList.svelte'
|
import MarkdownList from '$lib/components/markdown/MarkdownList.svelte'
|
||||||
|
import MarkdownImage from '$lib/components/markdown/MarkdownImage.svelte'
|
||||||
|
|
||||||
export let source: string | undefined
|
export let source: string | undefined
|
||||||
</script>
|
</script>
|
||||||
@@ -18,6 +19,7 @@
|
|||||||
hr: MarkdownHr,
|
hr: MarkdownHr,
|
||||||
blockquote: MarkdownQuote,
|
blockquote: MarkdownQuote,
|
||||||
list: MarkdownList,
|
list: MarkdownList,
|
||||||
|
image: MarkdownImage,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let href: string = ''
|
||||||
|
export let title: string | undefined = undefined
|
||||||
|
export let text: string = ''
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<img
|
||||||
|
src={href}
|
||||||
|
{title}
|
||||||
|
alt={text}
|
||||||
|
class="max-h-[40vh] border rounded-md border-slate-200 dark:border-zinc-800"
|
||||||
|
/>
|
||||||
@@ -51,12 +51,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row gap-2">
|
<div class="flex flex-row gap-2">
|
||||||
<Link href="/communities">
|
<Link href="/communities" label="Communities">
|
||||||
<Icon src={GlobeAlt} width={16} />
|
<Icon src={GlobeAlt} width={16} />
|
||||||
<span class="hidden sm:inline ml-1">Communities</span>
|
<span class="hidden sm:inline ml-1">Communities</span>
|
||||||
</Link>
|
</Link>
|
||||||
<Menu>
|
<Menu>
|
||||||
<Button color={Color.accent} slot="button">
|
<Button color={Color.accent} slot="button" label="Create">
|
||||||
<Icon src={Plus} width={16} />
|
<Icon src={Plus} width={16} />
|
||||||
<span class="hidden sm:inline">Create</span>
|
<span class="hidden sm:inline">Create</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in new issue
Block a user