]> git.ipfire.org Git - thirdparty/bootstrap.git/commit
SVG accessibility fixes (#27826)
authorPatrick H. Lauke <redux@splintered.co.uk>
Thu, 13 Dec 2018 13:09:47 +0000 (13:09 +0000)
committerGitHub <noreply@github.com>
Thu, 13 Dec 2018 13:09:47 +0000 (13:09 +0000)
commitc031584bcde710841ef4324558f40242080c53a9
tree1865cb50c383a8100606b4ade7cecfc87ac9aba8
parent375d137561999346d5a0ac0c6d8f72bf9dff82b1
SVG accessibility fixes (#27826)

* SVG accessibility fixes

- add `focusable="false"` to all SVGs, to stop IE from including the `<svg>` in its default focus cycle
- completely hide decorative SVGs using `aria-hidden="true"`
- add `role="img"` to meaningful/"content" SVGs, ensure they have an appropriate `<title>` and/or `aria-label`
- simplify placeholder default title

* Simplify usage of placeholder.svg in the docs

- in most cases, no need for separate/redundant text and title (now that we make text itself part of the alternative text explicitly)
- no need (expect in rare cirumstances) to describe the placeholder image (unless the look of the image is important/the actual content, as is the case with the image thumbnail class)

* Simplify example.html rewriting of <svg> to <img> code sample

- as the `alt` for the placeholder isn't really important, just add an ellipsis instead (otherwise, to be correct, we'd have to construct the whole "title+text" construct like we do now in the
placeholder.svg itself

* Change svgo configuration to retain role attribute and add/force focusable=false

- regarding `focusable=false`, see https://github.com/svg/svgo/issues/1011 (which would be the "proper" SVGO fix) and the (hacky) solution https://github.com/svg/svgo/pull/817
25 files changed:
build/svgo.yml
site/_includes/example.html
site/_includes/icons/bootstrap-stack.svg
site/_includes/icons/bootstrap.svg
site/_includes/icons/download.svg
site/_includes/icons/github.svg
site/_includes/icons/import.svg
site/_includes/icons/lightning.svg
site/_includes/icons/menu.svg
site/_includes/icons/placeholder.svg
site/_includes/icons/slack.svg
site/_includes/icons/twitter.svg
site/docs/4.1/assets/brand/bootstrap-outline.svg
site/docs/4.1/assets/brand/bootstrap-punchout.svg
site/docs/4.1/assets/brand/bootstrap-solid.svg
site/docs/4.1/components/card.md
site/docs/4.1/components/carousel.md
site/docs/4.1/components/media-object.md
site/docs/4.1/content/figures.md
site/docs/4.1/content/images.md
site/docs/4.1/examples/album/index.html
site/docs/4.1/examples/blog/index.html
site/docs/4.1/examples/carousel/index.html
site/docs/4.1/examples/product/index.html
site/docs/4.1/utilities/sizing.md