Skip to content

Commit b605035

Browse files
committed
[css-ruby-1] Switch to fullwidth parens, add rule for the basic rt-only case. #762
1 parent a724d38 commit b605035

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

css-ruby-1/Overview.bs

+24-9
Original file line numberDiff line numberDiff line change
@@ -1572,24 +1572,39 @@ Appendix A: Default Style Sheet</h2>
15721572

15731573
Unfortunately, because Selectors cannot match against text nodes,
15741574
it's not possible with CSS to express rules that will automatically and correctly
1575-
add parentheses to unparenthesized ruby annotations in HTML.
1576-
(This is because HTML ruby allows implying the [=ruby base=] from raw text, without a corresponding element.)
1577-
However, these rules will handle cases where either <code>&lt;rb&gt;</code>
1578-
or <code>&lt;rtc&gt;</code> is used rigorously.
1575+
add parentheses to unparenthesized ruby annotations
1576+
for all possible ruby markup patterns in HTML.
1577+
(This is because HTML ruby allows implying the [=ruby base=] from raw text
1578+
without a corresponding element.)
1579+
1580+
However, these rules will add parentheses around each annotation sequence
1581+
in cases where either <code>&lt;rb&gt;</code>
1582+
or <code>&lt;rtc&gt;</code> is used rigorously:
15791583

15801584
<pre highlight=css>
15811585
/* Parens around &lt;rtc> */
1582-
rtc::before { content: "("; }
1583-
rtc::after { content: ")"; }
1586+
rtc::before { content: ""; }
1587+
rtc::after { content: ""; }
15841588

15851589
/* Parens before first &lt;rt> not inside &lt;rtc> */
15861590
rb + rt::before,
1587-
rtc + rt::before { content: "("; }
1591+
rtc + rt::before { content: ""; }
15881592

15891593
/* Parens after &lt;rt> not inside &lt;rtc> */
15901594
rb ~ rt:last-child::after,
1591-
rt + rb::before { content: ")"; }
1592-
rt + rtc::before { content: ")("; }</pre>
1595+
rt + rb::before { content: ")"; }
1596+
rt + rtc::before { content: ")("; }</pre>
1597+
1598+
Alternatively, if it is known that a purely alternating style of markup is used
1599+
(<code>&lt;ruby>A<rt>a</rt>B<rt>b</rt>C<rt>c</rt>&lt;ruby></code>)
1600+
where there are no adjacent ruby annotations,
1601+
the following rules will add parentheses around each annotation:
1602+
1603+
<pre highlight=css>
1604+
/* Parens around each &lt;rt> */
1605+
rt::before { content: "("; }
1606+
rt::after { content: ")"; }
1607+
</pre>
15931608

15941609
<h2 id="glossary">
15951610
Glossary</h2>

0 commit comments

Comments
 (0)