ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.89k forks source link

🍱 [amp-base-carousel:1.0] amp-base-carousel doesn't change aspect ratio on desktop as expected #37024

Open gilbertococchi opened 2 years ago

gilbertococchi commented 2 years ago

Description

AMP-base-carousel when used in Wordpress via the official plugin and when using visible count parameters doesn't work on Desktop because of hardcoded padding-top value on the i-amphtml-sizer node.

Code Snippet used:

<amp-base-carousel
                  id="home_carousel"
                  layout="responsive"
                  width="411"
                  height="584"
                  visible-count="(max-width: 1024px) 1, 4">

Generated output <amp-base-carousel id="home_carousel" layout="responsive" width="411" height="584" visible-count="(max-width: 1024px) 1, 4" class="i-amphtml-layout-responsive i-amphtml-layout-size-defined" i-amphtml-layout="responsive"><i-amphtml-sizer style="display:block;**padding-top:142.0925%**"></i-amphtml-sizer>

Because the padding-top property is appended as Style attribute the generated rules from visible-count' would not apply (screenshot below).

Schermata 2021-11-22 alle 12 44 47

Reproduction Steps

Relevant Logs

No response

Browser(s) Affected

No response

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

No response

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.