A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/w3c/csswg-drafts/issues/5927 below:

[css-ruby] visibility:collapse on ruby annotations · Issue #5927 · w3c/csswg-drafts · GitHub

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":

<ruby><rb><rb><rb><rt>こん<rt class=easy>ちゅう<rt></ruby>

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?

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 unlike display: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).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3