-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Update wording around multi-keyword syntax for the display property
#42986
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
Conversation
|
Preview URLs (1 page) Flaws (4) Found an unexpected or unresolvable flaw? Please report it here. URL:
(comment last updated: 2026-02-03 07:31:17) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
estelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for suggesting these edits. We do need to update this page. I made several suggestions.
| display: contents; | ||
| display: table; | ||
|
|
||
| /* multi-keyword syntax */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should either use "short syntax" and "full syntax" OR "single-keyword" and "multi-keyword".
display: inline list-item is both "short syntax" and "multi-keyword".
As the values are broken down by data-type under values, I suggest we keep it to three headers in the syntax section:
- short display
- full display
- global values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied this suggestion, please let me know if I misunderstood or if further changes are needed.
- moved
precomposed valuesintoshort display - moved
noneandcontentsintoshort display(as seen in the table here) - omitted
table-rowfrom this section, it doesn't fit in any of these three sections
|
|
||
| > [!NOTE] | ||
| > When browsers that support multi-keyword syntax encounter a display property that only has an **outer** value (e.g., `display: block` or `display: inline`), the inner value is set to `flow` (e.g., `display: block flow` and `display: inline flow`). | ||
| > When browsers encounter a display property that only has an **outer** value (e.g., `display: block` or `display: inline`), the inner value is set to `flow` (e.g., `display: block flow` and `display: inline flow`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this true?
let styleMap = el.computedStyleMap();
styleMap.get("display").value /* returns outer without inner */I think it may be more accurate to write:
| > When browsers encounter a display property that only has an **outer** value (e.g., `display: block` or `display: inline`), the inner value is set to `flow` (e.g., `display: block flow` and `display: inline flow`). | |
| When a display property has only an **outer** value set (e.g., `display: block` or `display: inline`), the inner value defaults to `flow` (e.g., `display: block flow` and `display: inline flow`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree! Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied a slight variant of your suggestions. Please let me know if this doesn't cover your feedback.
|
|
||
| > [!NOTE] | ||
| > When browsers that support multi-keyword syntax encounter a display property that only has an **inner** value (e.g., `display: flex` or `display: grid`), the outer value is set to `block` (e.g., `display: block flex` and `display: block grid`). | ||
| > When browsers encounter a display property that only has an **inner** value (e.g., `display: flex` or `display: grid`), the outer value is set to `block` (e.g., `display: block flex` and `display: block grid`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above. it defaults, but it isn't set (as in, there is no effect if querying the display value)
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
|
|
||
| > [!NOTE] | ||
| > When browsers that support multi-keyword syntax encounter a display property that only has an **outer** value (e.g., `display: block` or `display: inline`), the inner value is set to `flow` (e.g., `display: block flow` and `display: inline flow`). | ||
| > When a display property has only an **outer** value (e.g., `display: block` or `display: inline`), the inner value defaults to `flow` (e.g., `display: block flow` and `display: inline flow`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| > When a display property has only an **outer** value (e.g., `display: block` or `display: inline`), the inner value defaults to `flow` (e.g., `display: block flow` and `display: inline flow`). | |
| > When a display property is specified with only an **outer** value (e.g., `display: block` or `display: inline`), the inner value defaults to `flow` (e.g., `display: block flow` and `display: inline flow`). |
When a display property is specified with only an **outer** value
vs.
When a display property has only an **outer** value set as suggested by @estelle
value set could be read as a set of values, which was confusing to me.
|
Thank you for the review @estelle 🙇 |
estelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🎉
Description
The current docs for
displaywarn slightly against using the multi-keyword syntax and have some incorrect content (e.g.blockis not a precomposed value, onlyinline-blockis).Motivation
Given that multi-keyword syntax is now Baseline Widely Available it seems a good time to update the wording to promote this syntax a bit more.
The multi-keyword syntax makes it easier to fully understand how both inner and outer display modes function.
Additional details
https://drafts.csswg.org/css-display-3/#the-display-properties
Related issues and pull requests
None