v151 · CSS · Typography

Reading Passage

A paragraph of furigana-annotated Japanese prose — the typical use case for ruby-overhang. Switch between auto, spaces, and the legacy none alias to see how annotation overhang changes around adjacent whitespace. The zoomed comparison shows the effect clearly on three adjacent characters.

ruby-overhang: accessibility:
auto — allows UA-selected ruby overhang; matches established typographic practice
reading passage — ruby-overhang: auto
日本語にほんご文章ぶんしょう仮名がなけると、 みやすくなります。 とく子供こども日本語にほんご学習者がくしゅうしゃにとって、 漢字かんじかたしめすことは 重要じゅうようです。
auto
かん
spaces
かん
none
かん

values explained

code

/* Default: allow UA-selected overhang */
ruby { ruby-overhang: auto; }

/* Constrain overhang to adjacent spaces */
ruby { ruby-overhang: spaces; }

/* Legacy alias of spaces */
ruby { ruby-overhang: none; }

/* Typical prose setup */
.japanese-body {
  ruby-overhang: auto;
  line-height: 2.4; /* extra space for ruby annotations */
}
.japanese-body ruby rt {
  font-size: 0.5em;
  color: var(--text-muted);
}

.japanese-body.low-vision ruby rt {
  font-size: 0.72em;
  color: var(--text-black);
  font-weight: 700;
}

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗