Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Sep 9, 2023

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Sep 9, 2023

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.

@yhatt yhatt merged commit 2249fe4 into main Sep 9, 2023
5 checks passed
@yhatt yhatt deleted the advanced-bg-figcaption branch September 9, 2023 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No alt text for 'bg' images
1 participant