-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Description
Just landed the edits to split text-box-edge into two properties and add a shorthand with text-box-trim in 7869dc6 ; see
- CSSWG resolution in 8829
- Editor's Draft: line box sizing property definition
- Editor's Draft: leading-trimming properties and shorthand
We had left open some amount of syntax bikeshedding to follow up on, so before I publish the Editor's Draft I wanted to run the current state by the CSSWG.
Here's the syntax overview:
<text-edges> = [ text | cap | ex | ideographic | ideographic-ink ]
[ text | alphabetic | ideographic | ideographic-ink ]?
<text-trim> = start | end | both
/* line box sizing property (inherited) */
line-fit-edge: leading | <text-edges>
/* leading-trim properties (non-inherited) */
text-box: normal | <text-trim> || <text-edges>
text-box-trim: none | <text-trim>
text-box-edge: auto | <text-edges>
Shorthand details:
text-box: normalsets to initial values (none/auto).- Setting only
<text-trim>defaultstext-box-edgetoauto(initial value). - Setting only
<text-edges>defaultstext-box-trimtoboth(not initial value).
Additional details:
text-box-edge: autocopies fromline-fit-edge, treatingleadingastext.- Reminder:
line-fit-edgevalues other thanleadingopt into the newer line box sizing model (leading only on root inline, honoring margin/border/padding on inline boxes).
Consequences:
- Defaulting this way enables trimming the leading by just setting a
<text-trim>value. - If the author set something more aggressive and script-specific for the inherited
line-fit-edgeproperty, that gets passed through as the default trim edges. - They can alternatively set an explicit trim value in the
text-boxshorthand or cascade one independently with thetext-box-edgelonghand. - Shorthanding magic for
text-boxmeans that:text-box: bothsets trimming to the default edge on both sides.text-box: cap alphabeticsets trimming to those edges on both sides.text-box: normaldoes the normal thing of not trimming the line box. :)
We should rename the trim keywords:
Having the text-box shorthand take start | end | both reads badly, suggest renaming these keywords to trim-start | trim-end | trim-both for two reasons:
- Consistency with
text-spacing-trim - The shorthand reads a lot more reasonably:
text-box: trim-bothrather thantext-box: bothwhich is weird.
Proposed Resolutions:
- Adopt
text-box/text-box-trim/text-box-edgeproperties as outlined above. - Rename
start | end | bothvalues oftext-box-trimtotrim-start | trim-end | trim-both. - Name the line-box sizing property (previously discussed as
text-line-edgeto contrast withtext-box-edge) toline-fit-edge(for now), or to some alternative that people might suggest here. - Republish css-inline-3 as WD with these edits.
nileshprajapati, hober, myakura, chalkygames123, argyleink and 1 more