-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
contain-intrinsic-size - improve docs #20912
Conversation
Preview URLs (this comment was updated 2022-09-23 12:30:11.748288) |
Can we ease the reading level down? i.e. intrinsic, mitigated, and computational may not be understood by native English speakers and we have a large ESL audience. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment mentions:
we should likely add this to that page. |
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
- : The element has no intrinsic size in the given dimension(s). | ||
- `<length>` | ||
- : The element has the specified {{cssxref("<length>")}} in the given dimension(s). | ||
- `auto <length>` |
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.
FYI @estelle , I find auto
a little tricky. The theory is pretty simple - it saves the natural/rendered size of the element whenever it is outside of size containment and then uses that instead of the stated length
when appropriate.
What I don't get is why you would bother - the spec indicates this is only really used offscreen and will switch to using length
for on-screen. I'm in discussion here w3c/csswg-drafts#7769 (comment) - might just be being stupid.
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.
FYI, I get the auto thing now; it makes sense and this documentation is correct.
The auto
option is mostly to get the benefits of size containment for offscreen elements without developers having to be too precise about the size of the element. It makes sense when you're skipping rendering the child elements. You don't have to worry about the fact that the length will be used when you're not skipping child elements because in this case as the element becomes visible you leave size containment and start rendering them.
If you're on screen and deliberately getting the benefits of size containment then it is up to the developer to make sure that the size is properly calculated.
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.
So much easier to read! Thank you.
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Thanks all. I'm going to merge this in the current state 👍🏻 it looks like we can revisit the |
* contain-intrinsic-size - improve docs * Update files/en-us/web/css/contain-intrinsic-size/index.md Co-authored-by: Estelle Weyl <estelle@openwebdocs.org> * Update files/en-us/web/css/contain-intrinsic-size/index.md * Update files/en-us/web/css/contain-intrinsic-size/index.md Co-authored-by: Estelle Weyl <estelle@openwebdocs.org> * Simplify language * Update files/en-us/web/css/contain-intrinsic-size/index.md Co-authored-by: Joshua Chen <sidachen2003@gmail.com> * Update files/en-us/web/css/contain-intrinsic-size/index.md Co-authored-by: Joshua Chen <sidachen2003@gmail.com> * Update files/en-us/web/css/contain-intrinsic-size/index.md Co-authored-by: Joshua Chen <sidachen2003@gmail.com> * Update files/en-us/web/css/contain-intrinsic-size/index.md Co-authored-by: Estelle Weyl <estelle@openwebdocs.org> Co-authored-by: Brian Thomas Smith <brian@smith.berlin> Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
contain-intrinsic-size docs are incomplete and inaccurate.
More work to be done:
contains-intrinsic-size
in the appropriate section on size containment.content-visibility
as this also triggers CSS containment.This is related to #20876