Replies: 7 comments
-
I wonder whether it makes sense to use the It's shorter than |
Beta Was this translation helpful? Give feedback.
-
FWIW, I think the validator is wrong. I can't find any reference that says aria attributes are not allowed on svg elements. Where the issue comes up, e.g., SVG Accessibility/ARIA roles for charts, it strongly suggests that these attributes are allowed. I'm searching through issues in both validators |
Beta Was this translation helpful? Give feedback.
-
According to this article - https://www.deque.com/blog/creating-accessible-svgs/ - the |
Beta Was this translation helpful? Give feedback.
-
I read that as suggesting that |
Beta Was this translation helpful? Give feedback.
-
Why not use |
Beta Was this translation helpful? Give feedback.
-
The
|
Beta Was this translation helpful? Give feedback.
-
IMHO: I think of aria-* attributes as a polyfill to add accessibility where there is no appropriate element. Unfortunately, I see it being used to replace obviously appropriate markup, or duplicating info for no apparent reason. In Creating Accessible SVGs (mentioned by @edent in #481 (comment)), the author includes as one possible pattern
I don't want to trash |
Beta Was this translation helpful? Give feedback.
-
As @btrem said in #471, the
aria-label
attribute (which is still invalid on SVGs according to the W3C validator) could be replace by a<title>
element as first child of the<svg>
.here's some research I did on the subject :
According to this document from the w3c about svg accessibility, both
aria-label
andtitle
are as good for accessibility purpose. (There is a TL;DR; in the green box at the end of the section)The differences are :
<title>
is recognised as the tab name on browser whilearia-label
doesn't.<title>
is used as a tooltip for the svg.The difference in size is 1 more byte for the
<title>
, there are currently 3 SVGs with a size of 1023 bytes where 1 additionnal byte makes it go past the 1kb limit, but they can be optimized :scale(-1 1)
for the symmetryfill
attribute on the<svg>
element (every child as it's ownfill
)Beta Was this translation helpful? Give feedback.
All reactions