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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Fix thirds and fill layer in Safari #19194
Conversation
I think this fix doesn't work, since there is another Also, should we move to positioning all our "absolute" elements with |
Tested it with a simple test case and it works well:
Also tested with stories that were previously broken by the previous PR and everything seemed to work fine. Was also waiting for the visual tests to run and they certainly caught something, updated the PR. And I just filed #19195 for the latter part of your comment. |
@@ -261,6 +261,7 @@ amp-story-cta-layer { | |||
|
|||
/** Grid level */ | |||
amp-story-grid-layer { | |||
box-sizing: border-box !important; |
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.
Why is this needed?
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.
If we don't include it, the thirds
template won't consider padding for its 100% height calculation. See screenshots below:
You can also see this in a Percy build: (the right one hasbox-sizing: border-box
). And I think this is what we want, is that correct @newmuis?
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.
Yes, I believe the box-sizing
is necessary here.
left: 0 !important; | ||
height: 100% !important; | ||
width: 100% !important; |
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.
This will be overridden by the width: auto
below, and will, from what I understand, break the layout. Could you please upload your test cases?
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.
Woops. In this case width: auto
and width: 100%
were behaving the same, though.
The tests can be found under the visual diff examples:
http://localhost:8000/examples/visual-tests/amp-story/amp-story-grid-layer-template-fill.html
http://localhost:8000/examples/visual-tests/amp-story/amp-story-grid-layer-template-thirds.html
http://localhost:8000/examples/visual-tests/amp-story/amp-story-grid-layer-template-horizontal.html
http://localhost:8000/examples/visual-tests/amp-story/amp-story-grid-layer-template-vertical.html
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'm not actually sure we need to change fill
layers at all, since the implementation doesn't use grid-area
s.
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.
@newmuis you were right and the bug only affects to classes using grid-area
s. Updated the PR to only update the thirds template's height.
bf5bd04
to
4495ca1
Compare
* apply 100% to fill and thirds * update css * remove width auto * manipulate height only in thirds.
Fixes #13433
Even though the layer has position: absolute; bottom: 0; top: 0;, Safari collapses the height as this comment points out. Setting it explicitly prevents this.