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 disabled = false
|
||||
export let submit = false
|
||||
export let label: string = ''
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
</script>
|
||||
@@ -21,6 +22,7 @@
|
||||
? 'opacity-50 pointer-events-none'
|
||||
: ''}"
|
||||
type={submit ? 'submit' : 'button'}
|
||||
aria-label={label}
|
||||
>
|
||||
<div
|
||||
class="flex flex-row items-center justify-center gap-2"
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<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 href = ''
|
||||
export let color: Color = Color.secondary
|
||||
export let href = ''
|
||||
export let label: string = ''
|
||||
</script>
|
||||
|
||||
<a
|
||||
{href}
|
||||
class="px-2 py-1 rounded-md {color} flex flex-row items-center
|
||||
{href}
|
||||
class="px-2 py-1 rounded-md {color} flex flex-row items-center
|
||||
justify-center text-sm transition-all"
|
||||
aria-label={label}
|
||||
>
|
||||
<slot name="icon" />
|
||||
<slot />
|
||||
<slot name="icon" />
|
||||
<slot />
|
||||
</a>
|
||||
@@ -142,7 +142,7 @@
|
||||
</span>
|
||||
</a>
|
||||
<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 />
|
||||
</Button>
|
||||
<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 SvelteMarkdown from 'svelte-markdown'
|
||||
import MarkdownList from '$lib/components/markdown/MarkdownList.svelte'
|
||||
import MarkdownImage from '$lib/components/markdown/MarkdownImage.svelte'
|
||||
|
||||
export let source: string | undefined
|
||||
</script>
|
||||
@@ -18,6 +19,7 @@
|
||||
hr: MarkdownHr,
|
||||
blockquote: MarkdownQuote,
|
||||
list: MarkdownList,
|
||||
image: MarkdownImage,
|
||||
}}
|
||||
/>
|
||||
</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>
|
||||
</div>
|
||||
<div class="flex flex-row gap-2">
|
||||
<Link href="/communities">
|
||||
<Link href="/communities" label="Communities">
|
||||
<Icon src={GlobeAlt} width={16} />
|
||||
<span class="hidden sm:inline ml-1">Communities</span>
|
||||
</Link>
|
||||
<Menu>
|
||||
<Button color={Color.accent} slot="button">
|
||||
<Button color={Color.accent} slot="button" label="Create">
|
||||
<Icon src={Plus} width={16} />
|
||||
<span class="hidden sm:inline">Create</span>
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user