AMP HTML supports various layouts such as aspect-ratio-based responsive layout which is very useful. Other useful layouts such as responsive-height are also in the works.
Currently AMP layouts are only supported on AMP elements such a amp-img, amp-carousel, etc.. but these layouts can be useful on their own.
amp-layout component will bring the power of AMP layout attribute to a generic multi-purpose container element that can be used independent of other AMP elements.
For instance:
<amp-layout class="card" layout=responsive width=2 height=1>
This card container will always maintain its 2x1 aspect ratio!
</amp-layout>
.card {
background-color: red;
}
amp-layout extended component. Only allow FIXED, FIXED_HEIGHT, RESPONSIVE, FILL, FLEX_ITEM layouts (hint: isLayoutSizeDefined)closes Issue #10018 in the description.Once approved, your changes will be merged. ⚡⚡⚡Congrats on making your first contribution to the AMP Project!⚡⚡⚡ You'll be able to see it live across the web soon!
Thanks, and we hope to see more contributions from you soon.
If you have questions ask in this issue or on your Pull Request (mentioning @aghassemi) or see the How to get help section of the Getting Started guide.
Hi,
I'd love to work on this for my first OSS contribution, has it been claimed yet?
@subhankar-panda not yet, so it looks like this one is yours. :) Welcome to open source!
@aghassemi will be the best contact to answer questions you might have about the issue.
If you have any questions feel free to ask them here, or you can also reach me, @aghassemi and others on Slack (sign up if you haven't already).
I've also invited to you to join ampproject on GitHub; once you've done that we'll be able to assign this issue to you.
Hi @subhankar-panda; do you have any updates on your PR? Let us know if you need any help.
Hey, I finished work on it a couple of days back, I'll send the PR within the next couple of days!
Most helpful comment
Hey, I finished work on it a couple of days back, I'll send the PR within the next couple of days!