mirror of
https://github.com/danbulant/design
synced 2026-06-20 14:51:13 +00:00
improve accessibility for image captions
This commit is contained in:
parent
b1967f5db1
commit
c14e6e1074
1 changed files with 11 additions and 5 deletions
|
|
@ -1,18 +1,24 @@
|
|||
<script>
|
||||
import Described from "./described.svelte";
|
||||
|
||||
export var src;
|
||||
export var alt;
|
||||
export var title;
|
||||
</script>
|
||||
|
||||
<Described>
|
||||
<figure>
|
||||
<img {src} {alt} {title} name="content">
|
||||
<slot />
|
||||
</Described>
|
||||
<figcaption>
|
||||
<slot />
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
<style>
|
||||
img {
|
||||
border-radius: 5px;
|
||||
}
|
||||
figcaption {
|
||||
text-align: center;
|
||||
color: gray;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in a new issue