-
Notifications
You must be signed in to change notification settings - Fork 719
[css-ruby] visibility:collapse on ruby annotations #5927
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
Comments
The CSS Working Group just discussed The full IRC log of that discussion |
Note: implementation wise, this ought to be pretty simple: both the syntax ( |
More use-cases that would be addressed by this were previously raised in https://lists.w3.org/Archives/Public/www-style/2016Dec/0108.html |
Since an email I authored was cited, it's probably worth noting the use case: I had a list of official song titles in English for many songs that had lyrics and titles in other languages, particularly Japanese. As ruby annotations, I provided the official song title in the native language of the song on a word for word and punctuation for punctuation basis. However, this would cause autohiding (i.e., text equivalency) problems because, for example:
Also keep in mind that these were official titles being documented, so changing the punctuation to match in a way that worked better inter-language by, for example, omitting spaces in one of the matching titles wasn't acceptable. Additionally, I later wrote a polyfill script that would auto-merge annotations (a feature currently missing from browser implementations), so simply omitting the punctuation from the annotations was out of the question since this punctuation would need to magically reappear when ruby bases and annotations were merged. Obviously, this solution doesn't address all of these cases, though I can see how removing noise by hiding punctuation in annotations could be useful. For example, for the Japanese song title "✱〜アスタリスク〜", one might just want to use the English word "Asterisk" as an annotation without the punctuation while fully annotating the text as (*I had to mark this song title as code since GitHub apparently uses tildes to invoke the strikethrough text style.) |
Hello CSS WG, The Accessible Platform Architecture (APA) WG have discussed this, and have a few comments to offer: Toggling: While the requested feature has value to users with disabilities, there will need to be a simple toggling feature to 'collapse' or 'expand' the Ruby annotation (think Details & Summary), ideally authored on the page, or provided via a clear and easy to access toggle in the browser UI. While applying this in a fashion similar to 'prefers-reduced-motion' and using browser-based user-settings is useful, we anticipate a more time-sensitive context of application by some users (i.e. the 'toggling' need). Relationship to Personalization TF activities: Currently the Personalization Task Force has some draft ideas around a similar use-case, which may work either as an alternative-to, or possibly in concert with this CSS proposal. Relevant information can be found at: https://www.w3.org/TR/personalization-semantics-content-1.0/#simplification-explanation (NOTE: The Task Force welcomes the CSS WG's feedback on this, or other aspects of our Draft Spec.) |
The CSS Working Group just discussed
The full IRC log of that discussion |
@johnfoliot Wrt toggling, I think that has to be handled by either the UA or the page because it requires some kind of UI affordance. The proposal here however enables the ruby layout support that such an affordance would require. Wrt data simplification, it might be relevant to remove some annotations in response to that, but removing annotations generally (particularly those required as a pronunciation aid) does not seem appropriate. |
APA is ok with the disposition but wants to see test results demonstrating keyboard accessible collapse / expand. |
I'm only just now reading this, and surprised that the CSS can't simply be |
TL;DR:
visibility:collapse
could serve a very useful role in ruby.Ruby, in its standard use as a pronounciation aid, is at its core an accessibilty tool: it enables readers with different levels of proficiency to read the same text. But while ruby on characters that someone doesn't know how to read is very helpful, more ruby isn't always better, otherwise, all Japanese texts would be full of ruby, and they're not. To readers who already know the reading of the annotated character, ruby can be distracting. In learning situations, it can also be desirable to hide the annotations over the characters that you're supposed to know to make sure you actually practice reading them. For some people with dislexia, ruby can even make text harder to read.
In printed materials, you get what the author prepared for you, and that's that. But in digital formats, being able to customize how much ruby you see is highly desirable. Marking up a piece of text with full ruby annotations, and then providing controls to hide away some of it depending on the wants and abilities of the reader is a very friendly thing to do.
But what is the best way to achieve that?
Let's say we have this markup, where all kanji are annotated, and the middle one which is taught in first grade, is annotated as "easy":
Default styling shows the fully annotated text (colors added in to help non readers of Japanese to track the various parts):
But how should you go about hiding the annotation on the easy one?
rt.easy { display: none; }
doesn't work, as it messes up the pairingrt.easy { visibility: hidden; }
will sort of work, but unecessary spacing is added around the second character to make room for it's (invisible) annotation. That's not only ugly, it can also impair readability, as adding spaces in the middle of words for no app arent reason can conf use people into thin king they're looking at separ ate words. (See what I did there?)rt.easy { visibility: hidden; font-size: 1px; border:none; margin:0; padding:0;}
or something like that would likely work, but it's clearly a cumbersome hack.There's currently no reliable and clean way to do it, but we could very easily add one through existing syntax that's pretty much made for this:
rt.easy { visibility: collapse; }
A rather simple way to specify it would be that an annotation with
visibility: collapse
does generate a ruby annotation box (so unlikedisplay:none
it won't mess up the pairing`), but for layout and painting purposes, that box is rendered the same as auto-hidden annotations (thus providing an explicit way to get the same effect).The text was updated successfully, but these errors were encountered: