Skip to content

Commit 8dcb4ec

Browse files
committed
[css-text-4] Add space-first value per Murakami's proposal in #2462
1 parent 5e6008e commit 8dcb4ec

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

css-text-4/Overview.bs

+49-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ Character Class Spacing: the 'text-spacing' property</h3>
926926
<tr>
927927
<th>Value:
928928
<td>normal | none |
929-
[ trim-start | space-start ] ||
929+
[ trim-start | space-start | space-first ] ||
930930
[ trim-end | space-end | allow-end ] ||
931931
[ trim-adjacent | space-adjacent ] ||
932932
no-compress ||
@@ -1004,6 +1004,54 @@ Character Class Spacing: the 'text-spacing' property</h3>
10041004
Set <a>fullwidth opening punctuation</a> with half-width glyphs (flush)
10051005
at the start of each line.
10061006

1007+
<dt><dfn>space-first</dfn>
1008+
<dd>
1009+
Behaves as ''space-start'' on the first line the block container
1010+
and each line after a <a>forced line break</a>
1011+
but as ''trim-start'' on all other lines.
1012+
1013+
<details class="note">
1014+
<summary>This value exists for UA compat requirements,
1015+
and is not recommended for general authoring use.</summary>
1016+
This value exists to improve formatting of existing Japanese ePUB content,
1017+
for which ''trim-start'' would have been appropriate typographically,
1018+
except that they are typeset
1019+
to expect the first line to be set as ''space-first''.
1020+
1021+
Specifically,
1022+
due to the lack of reliable 'hanging-punctuation' support across ePUB readers,
1023+
such content uses U+3000 ideographic space in place of 'text-indent',
1024+
but omits it when the paragraph begins with punctuation
1025+
that is desired to hang in the indent
1026+
in order to create the hanging punctuation effect.
1027+
Using ''trim-start'' on the first line
1028+
would thus trim away the effective indent in such content
1029+
and thus obscure that line's distinction
1030+
as the first line of a new paragraph.
1031+
1032+
Note that this ePUB typesetting practice
1033+
is not recommended for CSS in general
1034+
(i.e. where not dictated by compat):
1035+
authors should use 'hanging-punctuation' and 'text-indent'
1036+
to control paragraph formatting
1037+
rather than tweaking the text content of the document.
1038+
This preserves the text’s true semantics in the document source
1039+
and allows the style sheet designer
1040+
to freely switch among the various spacing/indentation styles
1041+
without needing to alter the content.
1042+
See [[#japanese-start-edges]] for examples.
1043+
1044+
UAs are encouraged to use this value
1045+
as part of their UA default style sheet for Japanese ePUB content:
1046+
to preserve the paragraph distinctions in such content
1047+
while applying ''trim-start'' behavior to wrapped lines
1048+
(which creates better optical alignment along the start edge
1049+
and helps emphasize paragraph breaks denoted by indentation).
1050+
1051+
ISSUE: Whether this value should also be part of the UA defaults for Web content
1052+
is <a href="https://github.com/w3c/csswg-drafts/issues/2462">currently under discussion</a>.
1053+
</details>
1054+
10071055
<dt><dfn>allow-end</dfn>
10081056
<dd>
10091057
Set <a>fullwidth closing punctuation</a> with half-width glyphs (flush)

0 commit comments

Comments
 (0)