Skip to content

Commit 4f88e9b

Browse files
committed
[css-inline-3] Editorial cleanup on 'initial-letter' section.
1 parent 5c450e0 commit 4f88e9b

2 files changed

Lines changed: 36 additions & 25 deletions

File tree

css-inline-3/Overview.bs

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,19 @@ Creating Initial Letters: the 'initial-letters' property</h3>
628628
ISSUE: Renaming this property (and the others in this section)
629629
is currently <a href="https://github.com/w3c/csswg-drafts/issues/2950">under discussion</a>.
630630

631-
This property specifies styling for dropped, raised, and sunken initial letters
632-
by specifying their <a lt="initial letter size">size</a> and <a lt="initial letter sink">sink</a>.
631+
This property specifies
632+
the <a lt="initial letter size">size</a> and <a lt="initial letter sink">sink</a>
633+
for dropped, raised, and sunken initial letters
634+
as the number of lines spanned.
635+
636+
<div class="example">
637+
For example, the following code will create
638+
a 2-line dropped initial letter
639+
at the beginning of each paragraph
640+
that immediately follows a second-level heading:
641+
<pre>h2 + p::first-letter { initial-letters: 2; }</pre>
642+
</div>
643+
633644
It takes the following values:
634645

635646
<dl dfn-for=initial-letters dfn-type=value>
@@ -667,10 +678,11 @@ Creating Initial Letters: the 'initial-letters' property</h3>
667678
If the <a>initial letter sink</a> value is omitted,
668679
''drop'' is assumed.
669680

670-
An <dfn lt="initial letter | initial letter box">initial letter</dfn> is
671-
an <a>in-flow</a> box
672-
to which 'initial-letters' applies and is not ''initial-letters/normal'';
673-
this triggers the special layout considerations described below.
681+
Values other than ''initial-letters/normal''
682+
cause the affected box to become an
683+
<dfn lt="initial letter | initial letter box">initial letter box</dfn>,
684+
which is an <a>in-flow</a> <a>inline-level box</a>
685+
with special layout behavior.
674686

675687
<div class="example">
676688
Here are some examples of 'initial-letters' usage:
@@ -712,11 +724,6 @@ Creating Initial Letters: the 'initial-letters' property</h3>
712724
</dl>
713725
</div>
714726

715-
<div class="example">
716-
The following code will create a 2-line dropped initial letter at the beginning of each paragraph:
717-
<pre>p::first-letter { initial-letters: 2; }</pre>
718-
</div>
719-
720727
<h4 id="first-most-inline-level">
721728
Applicability</h4>
722729

@@ -747,26 +754,30 @@ Applicability</h4>
747754
is not:
748755

749756
<xmp>
750-
<p><span><em><b>This phrase</b> is styled</em> <strong>specially</strong>. &hellip;</span>
757+
<p><span><em><b>This</b> phrase</em> is styled
758+
<strong>specially</strong>.</span>
751759
</xmp>
752760

753761
If we apply the following rules:
754762

755763
<pre>
756764
em { initial-letters: 2; }
757-
b { initial-letters: 3; }
765+
b, strong { initial-letters: 3; }
758766
</pre>
759767

768+
The 'initial-letters' property will take effect only on the <code>&lt;em></code>.
769+
The styling on <code>&lt;b></code>
770+
is ignored,
771+
as it has an ancestor already styled as an <a>initial letter</a>;
772+
and the styling on <code>&lt;strong></code> is ignored
773+
because it is a second sibling.
774+
760775
The result might be rendered as
761776

762-
<figure>
763-
<img src="images/first-most-inline-level-descendant-example.png" width="300"
764-
alt="text with two-line initial-letter">
765-
</figure>
766-
767-
(Note that the styling on <code>&lt;b></code>
768-
is ignored,
769-
as it has an ancestor already styled as an <a>initial letter</a>.)
777+
<figure>
778+
<img src="images/firstmost-inline.png"
779+
alt="“This phrase” becomes the dropped text spanning two lines, the remainder of the text wrapping alongside.">
780+
</figure>
770781
</div>
771782

772783
If 'initial-letters' is applied to an <a>inline-level box</a>
@@ -775,14 +786,14 @@ Applicability</h4>
775786
its <a>used value</a> is ''initial-letters/normal'',
776787
and it is not formatted as an <a>initial letter</a>.
777788

778-
Note: The 'initial-letters' property cannot apply to any element
779-
whose 'float' is not ''float/none'' or 'position' is not ''static'',
780-
because these values cause its 'display' to compute to ''display/block''.
781-
782789
The effect of the 'initial-letters' property is undefined
783790
on children of <a>ruby</a> base container boxes
784791
and on <a>ruby</a> container boxes.
785792

793+
Note: The 'initial-letters' property cannot apply to any element
794+
whose 'float' is not ''float/none'' or 'position' is not ''static'',
795+
because these values cause its 'display' to compute to ''display/block''.
796+
786797
<h4 id="initial-letter-properties">
787798
Properties</h4>
788799

7.21 KB
Loading

0 commit comments

Comments
 (0)