You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use an element with heights attribute the SSR or more specifically the createResponsiveSizer method in ApplyLayout.js adds an inline padding-top in the sizer element. But the SSR also generates amp-custom styles like this,
For this output, the browser will always use the inline padding instead of the padding declared in amp-custom style. Hence, the generated markup is not responsive as expected.
In addition to that, according to the source code of amphtml, when we simply use the non-SSR element, it adds an inline padding-top using the heights attribute value. There is no affect of height/width ratio here. It only works if there is a heights attribute.
So, from my observation, we should remove the inline padding-top and only use the amp-custom style generated by the heights attribute value to get a responsive sizer.
The text was updated successfully, but these errors were encountered:
heights attribute contains padding-top value for multiple media queries to make it responsive. AFAIK, it is not possible to add media query in inline style.
Related to ampproject/amp-toolbox-php#511
Consider an example snippet like this
When we use an element with
heights
attribute the SSR or more specifically thecreateResponsiveSizer
method in ApplyLayout.js adds an inlinepadding-top
in the sizer element. But the SSR also generates amp-custom styles like this,For this output, the browser will always use the inline padding instead of the padding declared in amp-custom style. Hence, the generated markup is not responsive as expected.
In addition to that, according to the source code of amphtml, when we simply use the non-SSR element, it adds an inline padding-top using the
heights
attribute value. There is no affect of height/width ratio here. It only works if there is aheights
attribute.So, from my observation, we should remove the inline
padding-top
and only use the amp-custom style generated by theheights
attribute value to get a responsive sizer.The text was updated successfully, but these errors were encountered: