You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-inline/Overview.bs
+66-11Lines changed: 66 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -2346,7 +2346,7 @@ The alignment constraints depend on the script used. In Japanese vertical writin
2346
2346
2347
2347
2348
2348
2349
-
<p class="issue">Add content describing constraint that the block container have a baseline grid (or fixed line-height?).</p>
2349
+
<p class="issue">Add content describing constraint that the block container have a baseline grid (or fixed line-height?). Can we say that the UA can treat other inline or replaced elements in the para as having line-height equal to zero when calculating the initial letter's alignment?</p>
@@ -2380,13 +2380,13 @@ Only the following properties can be applied to the <code>::first-letter</code>
2380
2380
2381
2381
2382
2382
2383
-
<h3 id="sizing-drop-initials">Creating Initial Letters: The 'initial-letter' Property</h3>
2383
+
<h3 id="sizing-drop-initials">Creating Initial Letters: The 'initial-letter' shorthand</h3>
2384
2384
2385
-
The 'initial-letter' property takes two positive integer values. The first argument defines the number of lines the initial letter should sink. An N-line initial letter sinks to the Nth text baseline. The optional second argument defines how many lines the initial letter occupies. If not specified, it duplicates the first argument.
2385
+
This <i>shorthand property</i> for 'initial-letter-drop' and 'initial-letter-size' takes two positive integer values. The first argument defines the number of lines the initial letter should sink. An N-line initial letter sinks to the Nth text baseline. The optional second argument defines how many lines the initial letter occupies. If not specified, it duplicates the first argument.
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
2392
2392
Inherited: no
@@ -2395,6 +2395,8 @@ Media: visual
2395
2395
Computed value: ???
2396
2396
</pre>
2397
2397
2398
+
<p class="note">Unlike most shorthands, omitting an argument does not result in the initial value for that argument being used.</p>
2399
+
2398
2400
2399
2401
<div class="example">
2400
2402
@@ -2413,7 +2415,47 @@ p::first-letter {
2413
2415
2414
2416
2415
2417
2416
-
Some styles of drop initials do not align with the first line of text. For example, “sunken caps” both sink below the first baseline, and extend above the first line of text. In these cases, the size of the initial cap needs to be defined. The optional second argument of 'initial-letter' specifies the size of an initial letter, as if it were an n-line drop cap.
2418
+
2419
+
2420
+
2421
+
2422
+
<h3>The initial-letter-drop property</h3>
2423
+
2424
+
This longhand describes the line to which an initial letter “sinks.” As in the above example, the baseline of a three-line initial letter aligns to the third text baseline of the paragraph.
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
2433
+
Inherited: no
2434
+
Percentages: N/A
2435
+
Media: visual
2436
+
Computed value: ???
2437
+
</pre>
2438
+
2439
+
<h3>The initial-letter-size property</h3>
2440
+
2441
+
2442
+
Some styles of drop initials do not align with the first line of text. For example, “sunken caps” both sink below the first baseline, and extend above the first line of text. In these cases, the size of the initial cap needs to be defined. The 'initial-letter-size' property specifies the size of the initial letter, as if it were an n-line drop cap.
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
2452
+
Inherited: no
2453
+
Percentages: N/A
2454
+
Media: visual
2455
+
Computed value: ???
2456
+
</pre>
2457
+
2458
+
2417
2459
2418
2460
2419
2461
@@ -2426,20 +2468,25 @@ Some styles of drop initials do not align with the first line of text. For examp
2426
2468
2427
2469
<figure>
2428
2470
<img src="SunkenCapA.png" width="480" alt="sunken drop initial"/>
2429
-
<p class="caption">Sunken cap. The letter drops two lines, but is the size of a three-line initial letter.</p>
2471
+
<p class="caption">Sunken cap. The letter drops to the second line, but is the size of a three-line initial letter.</p>
2430
2472
</figure>
2431
2473
<pre>
2432
-
2474
+
/* shorthand */
2433
2475
p::first-letter {
2434
2476
initial-letter: 2 3;
2435
2477
}
2436
2478
2479
+
/* longhand */
2480
+
p::first-letter {
2481
+
initial-letter-drop: 2;
2482
+
initial-letter-size: 3;
2483
+
}
2437
2484
</pre>
2438
2485
2439
2486
</div>
2440
2487
2441
2488
2442
-
If the first argument is ''1'', that creates a pure raised initial letter (often called “raised cap” or “stick-up cap.”
2489
+
If 'initial-letter-drop'is ''1'', that creates a pure raised initial letter (often called a “raised cap” or “stick-up cap.” It “sinks” to the first text baseline.
2443
2490
2444
2491
2445
2492
<div class="example">
@@ -2449,11 +2496,16 @@ If the first argument is ''1'', that creates a pure raised initial letter (often
2449
2496
<p class="caption">Raised cap. The initial letter is the size of a 3-line initial, but does not drop.</p>
2450
2497
</figure>
2451
2498
<pre>
2452
-
2499
+
/* shorthand */
2453
2500
p::first-letter {
2454
2501
initial-letter: 1 3;
2455
2502
}
2456
2503
2504
+
/* longhand */
2505
+
p::first-letter {
2506
+
initial-letter-drop: 1;
2507
+
initial-letter-size: 3;
2508
+
}
2457
2509
</pre>
2458
2510
2459
2511
</div>
@@ -2502,11 +2554,10 @@ span.initial {
2502
2554
initial-letter-alignment: ideographic;
2503
2555
}
2504
2556
</pre>
2505
-
2506
-
2507
2557
</div>
2508
2558
2509
2559
2560
+
2510
2561
<h3 id="initial-letter-exclusions">Space Around Initial Letters</h3>
2511
2562
2512
2563
If an initial letter has a descender, it could crash into the (n+1)th line of text. This is not desirable.
@@ -2526,6 +2577,10 @@ Text should be excluded around the glyph bounding boxes of the initial letters:
2526
2577
</figure>
2527
2578
2528
2579
2580
+
<p class="note">For Western scripts, an initial letter acts as a content box bounded at the top by the cap height of the font, and at the bottom by the glyph bounding box. Borders, margins, and padding will extend from this content box.</p>
2581
+
<p class="issue">The content box will need to be different for non-Western scripts. Perhaps this should be defined as part of the 'initial-letter-alignment' property.</p>
2582
+
2583
+
2529
2584
<h3 id="initial-letter-paragraphs">Interactions of initial letters with surrounding paragraphs</h3>
0 commit comments