Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty value in the text-wrap doc is not fully documented #30073

Closed
Christopher-Hayes opened this issue Nov 6, 2023 · 5 comments
Closed

pretty value in the text-wrap doc is not fully documented #30073

Christopher-Hayes opened this issue Nov 6, 2023 · 5 comments
Labels
Content:CSS Cascading Style Sheets docs waiting for implementations Waiting for feature to be implemented in browsers

Comments

@Christopher-Hayes
Copy link

Christopher-Hayes commented Nov 6, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap

What specific section or headline is this issue about?

Syntax, Values, Formal Syntax

What information was incorrect, unhelpful, or incomplete?

The pretty value only shows up in the "Formal Syntax" section. Not mentioned in either "Syntax" or "Values".

What did you expect to see?

Seems like pretty should also show up in the "Syntax" section if it's in the "Formal Syntax" section.

It would also be helpful for pretty to be in the "Values" section which would explain what pretty does, (and ideally how it compares to balance)

Do you have any supporting links, references, or citations?

pretty is mentioned in the W3C working draft here:

https://www.w3.org/TR/css-text-4/#valdef-text-wrap-style-pretty

'pretty' Specifies the UA should bias for better layout over speed, and is expected to consider multiple lines, when making break decisions. Otherwise equivalent to auto,

NOTE: The auto value will typically map to Web browsers’ speedy legacy line breaking, which has so far used first-fit/greedy algorithms that can often give sub-optimal results. UAs can experiment with better line breaking algorithms with this default value, but as optimal results often take more time, pretty is offered as an opt-in to take more time for better results. The pretty value is intended for body text, where the last line is expected to be a bit shorter than the average line; the balance value is intended for titles and captions, where equal-length lines of text tend to be preferred; and the stable is intended for sections that are, or are likely become toggled as, editable.

Do you have anything more you want to share?

I also noticed the W3C working draft documents an auto value, which MDN doesn't mention. I would say auto should be added too; however, I'm noticing that Chrome's current implementation does not support auto as a valid value.

New spec note - This is a very much WIP / new spec. The W3C working draft was updated as recently as October 20, 2023. The current MDN page may very well be based on an older version of the working draft.

MDN metadata

Page report details
@Christopher-Hayes Christopher-Hayes added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 6, 2023
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Nov 6, 2023
@Christopher-Hayes
Copy link
Author

Christopher-Hayes commented Nov 6, 2023

I'm not used to reading W3C working drafts. What's a little confusing is the values for text-wrap are actually a combination of both text-wrap-mode and text-wrap-style. What I'm talking about above is text-wrap-style. But, based on the W3C spec, text-wrap should also support the modes, wrap and nowrap. (Which this MDN page does mention as accepted values)

Not sure if text-wrap-style is expected to become a separate property, but at the moment Chrome's implementation doesn't support it.

text-wrap-mode: https://www.w3.org/TR/css-text-4/#propdef-text-wrap-mode
text-wrap-style: https://www.w3.org/TR/css-text-4/#propdef-text-wrap-style
text-wrap: https://www.w3.org/TR/css-text-4/#propdef-text-wrap
Which is documented as text-wrap: <'text-wrap-mode'> || <'text-wrap-style'>

@Christopher-Hayes
Copy link
Author

An update to the "# Values" section might look like:

pretty

The browser will prioritize better layout over speed when making line break decisions. This value is intended for body text where the last line is expected to be shorter than the average, but may take more time to achieve optimal results.

@wbamberg
Copy link
Collaborator

wbamberg commented Nov 6, 2023

Yes, see also #29065 (comment).

@pepelsbey
Copy link
Member

pepelsbey commented Nov 14, 2023

Just like for #29065, we need to wait a bit until both spec and implementation settle before documenting it. The text-wrap: balance is coming in Firefox 121 in December (the second independent implementation) and we’re going to spend some time rewriting the docs to support the release.

@pepelsbey pepelsbey removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 14, 2023
@pepelsbey pepelsbey added the waiting for implementations Waiting for feature to be implemented in browsers label Nov 29, 2023
@Josh-Cena
Copy link
Member

Fixed by #30435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs waiting for implementations Waiting for feature to be implemented in browsers
Projects
None yet
Development

No branches or pull requests

4 participants