marp-team / marpit

The skinny framework for creating slide deck from Markdown
https://marpit.marp.app/
MIT License
964 stars 46 forks source link

Advanced background: Render the image's alt text to <figcaption> #371

Closed yhatt closed 1 year ago

yhatt commented 1 year ago

For accessibility improvement, when defined the alternative text for Marpit's background image ![bg](), <figure> element becomes to have a text label by <figcaption>.

![bg Alternative text](https://example.com/background.jpg)
<figure style="background-image:url('https://example.com/background.jpg');">
  <figcaption>Alternative text</figcaption>
</figure>

Also added the style for <figcaption>. It hides the caption text from screen, but keeps readable by screen readers.

Resolve #368.