Closed jdan closed 8 years ago
In your response you outlined the following strategy for generating the tooltip text:
- If only
data-hint
present, usedata-hint
- If only
aria-label
present, usearia-label
- If both
data-hint
andaria-label
present, usearia-label
Do you know if it's possible to do this with content
/attr
alone?
:+1:
This would be really helpful to get merged in, any progress on this @chinchang?
@jdan I have some theories in mind. Will try implementing them if they work out.
@danlopez Will spend time on this the coming weekend.
Merging this branch into the a11y WIP branch to take it forward.
Excellent, keep me posted! Happy to contribute in any capacity.
Hey @chinchang - any updates on the timeline to get this work merged back into master?
I went through the specs for css3-content
property: https://www.w3.org/TR/css3-content/
Though they seem to have a provision for fallback syntax in attr
like so:
figure[alt] { content: attr(href, url), attr(alt); }
it doesn't look like its implemented in browsers yet!
So that means handling aria-label
and data-hint
attributes probably won't be possible by a single file. That leaves us to having a separate version of hint.css with a11y features, say hint-a11y.css (just like we have hint-base.css now).
How does that sound? Comments, suggestions?
My suggestion is to use aria-label
instead of data-hint
completely as a breaking change :) I'm biased though.
Separating them into two files sounds fine, just hoping folks will use it!
We'd definitely use hint-a11y.css if it were provided.
@jdan @danlopez :) You guys are a11y supporters! Though I am also running a poll to get more inputs: https://twitter.com/hint_css/status/722155293518376961
BTW, good news is that I have been able to provide support for both aria-label
and data-hint
attributes just using CSS using @tfoxy code in the associated issue: https://github.com/chinchang/hint.css/issues/81#issuecomment-186471802 👍
Have opened a PR against dev
with my changes.
Would be great if you guys can review #137
Hi @chinchang!
Copying some notes from my original issue comment:
You'll see that using
aria-label
instead ofdata-hint
has the same results:But the tooltip's contents are now accessible to screen-readers:
These changes follow the assumption that the tooltip is labeling the element it is annotating. This means that screen-readers will not read off the actual content of the element itself, but only its tooltip.
Consider the following:
In the above scenario, "Checkout" will be omitted in favor of "You will be charged $5.00" by the screen-reader.