🖍 Cleanup several unresolved amp-layout CSS states#28115
🖍 Cleanup several unresolved amp-layout CSS states#28115jridgewell merged 3 commits intoampproject:masterfrom
Conversation
| /* Hide all children of non-container elements. */ | ||
| .i-amphtml-notbuilt:not(.i-amphtml-layout-container) > * , | ||
| [layout]:not([layout=container]):not(.i-amphtml-element) > * | ||
| [layout]:not([layout=container]):not(.i-amphtml-element) > *, |
There was a problem hiding this comment.
I realized this also doesn't account for implicit container layout. Is there even a CSS selector that would match?
There was a problem hiding this comment.
What defines implicit container? Is it just a lack of width and height and layout?
There was a problem hiding this comment.
Lines 429 to 442 in 67815dc
There was a problem hiding this comment.
I don't believe we can do this without :not(:resolved)
- Adds unresolved layout for `intrinsic` styles - Fixes specificity for unresolved `fixed-height` styles - Adds unresolved implicit layout `responsive` styles
|
Need a bundle size approval. |
| [layout]:not(.i-amphtml-element) | ||
| [layout]:not(.i-amphtml-element), | ||
| [width][height][sizes]:not([layout]):not(.i-amphtml-element), | ||
| [width][height][heights]:not([layout]):not(.i-amphtml-element) |
There was a problem hiding this comment.
Please add a comment that this [width][height][sizes] and [width][height][heights] are "implicit responsive" here and below. Follow-up PR is cool too to avoid the bundle size reapproval.
| [layout]:not(.i-amphtml-element) | ||
| [layout]:not(.i-amphtml-element), | ||
| [width][height][sizes]:not([layout]):not(.i-amphtml-element), | ||
| [width][height][heights]:not([layout]):not(.i-amphtml-element) |
There was a problem hiding this comment.
We're not handling any of the other implicit layouts either. Not sure if it's better to only fix this for implicit responsive or leave them all unfixed.
Consider leaving a note/TODO about this at least.
There was a problem hiding this comment.
fixed, fixed-height, fluid and container are the missing ones. fluid isn't documented on https://amp.dev/documentation/guides-and-tutorials/learn/amp-html-layout/#layout, so lets ignore it.
fixed and fixed-height are implicit based on height and width only. Unfortunately, that's very generic, and there are non-amp elmeents that fit that:
- width + height
- amp-script > canvas
- SVG > *
- td
- th
- input
- width
- table
And container conflicts with basically everything.
I'm not sure we want to apply these styles to those elements.
I'll add a comment.
* Cleanup several unresolved amp-layout CSS states - Adds unresolved layout for `intrinsic` styles - Fixes specificity for unresolved `fixed-height` styles - Adds unresolved implicit layout `responsive` styles * Fix fixed-height selector * Add in implicit responsive with heights
intrinsicstylesfixed-heightstylesresponsivestyles