Skip to content

Commit 7fd0270

Browse files
committed
[css-text-4] Add line-padding property. #1973
1 parent 3685e64 commit 7fd0270

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

css-text-4/Overview.bs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,60 @@ Spacing</h2>
936936

937937
Issue: Add final level 3 word-spacing, letter-spacing
938938

939+
<h3 id="line-padding-property">
940+
Line Start/End Padding: the 'line-padding' property</h3>
941+
942+
<pre class="propdef">
943+
Name: line-padding
944+
Value: <<length>>
945+
Initial: 0
946+
Applies to: <a>inline boxes</a>
947+
Inherited: yes
948+
Percentages: N/A
949+
Computed value: absolute length
950+
</pre>
951+
952+
Whereas 'letter-spacing' adjusts spacing
953+
between <a>typographic letter units</a>
954+
and does not apply at the start or end of a line,
955+
this property adjusts spacing only at the start/end of a line.
956+
The extra spacing is applied only
957+
by the <em>innermost</em> <a>inline box</a>
958+
at the start/end of the line box,
959+
and is inserted between that <a>inline box</a>’s content edge
960+
and the adjacent <a>inline-level</a> content
961+
(text run <em>or</em> <a>atomic inline</a>).
962+
This extra space is not a <a>justification opportunity</a>.
963+
964+
<div class="example">
965+
Given the following HTML and CSS:
966+
<xmp>
967+
p { line-padding: 0.5em; line-height: 1; text-align: center }
968+
span { background: black; color: white; }
969+
em { background: green; color: white; }
970+
971+
<p><span>Here is <em>some text</em></p>
972+
</xmp>
973+
974+
If it renders such that there is a break between “some” and “text”,
975+
line-padding will be inserted such that
976+
an extra 0.5em of inline background will be visible
977+
on each side of each line:
978+
on the first line, black on the left and green on the right,
979+
and on the second line, green on both sides.
980+
981+
<style>
982+
#line-padding-rendering { line-height: 1; text-align: center; color: white; }
983+
#line-padding-rendering span { background: black; padding-left: 0.5em; }
984+
#line-padding-rendering em { background: green; padding-right: 0.5em; }
985+
#line-padding-rendering em + em { padding-left: 0.5em; }
986+
</style>
987+
<pre class="figure" id="line-padding-rendering">
988+
<span>Here is <em>some</em>
989+
<em>text</em>
990+
</pre>
991+
</div>
992+
939993
<h3 id="text-spacing-property">
940994
Character Class Spacing: the 'text-spacing' property</h3>
941995

0 commit comments

Comments
 (0)