mirror of
https://github.com/danbulant/design
synced 2026-07-08 12:31:06 +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>
|
<script>
|
||||||
import Described from "./described.svelte";
|
|
||||||
|
|
||||||
export var src;
|
export var src;
|
||||||
export var alt;
|
export var alt;
|
||||||
export var title;
|
export var title;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Described>
|
<figure>
|
||||||
<img {src} {alt} {title} name="content">
|
<img {src} {alt} {title} name="content">
|
||||||
<slot />
|
<figcaption>
|
||||||
</Described>
|
<slot />
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
img {
|
img {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
figcaption {
|
||||||
|
text-align: center;
|
||||||
|
color: gray;
|
||||||
|
width: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in a new issue