adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
730 stars 736 forks source link

[AMP] Components for AMP and Responsive Grid css #1324

Open szymon-krzysztyniak opened 3 years ago

szymon-krzysztyniak commented 3 years ago

Bug Report

I would like to build a page for AMP and use Core components. When building the page with Responsive Grid, css file generated by AEM is too large (for 3 viewports it is around 100KB). AMP limitation for CSS is that the file needs to be under 70,000B. Additionally, AEM use !important keyword in the css which is not allowed in AMP. Above disqualify usage of Responsive Grid on AMP pages in AEM.

Current Behavior Currently we are not able to build AMP page and use Responsive Grid at the same time!

When building AMP page with core components and Responsive Grid, css file generated to support responsive grid is over 75KB (AMP limit). Additionally, css generated use !important keyword which is not supported (allowed) in AMP. Page is considered as invalid by AMP validator.

Expected behavior/code When building AMP page with core components and Responsive Grid, css file generated to support responsive grid is optimised and size is under 75KB (AMP limit). Additionally, css generated doesn't use !important keyword.

Environment

Possible Solution

Additional context / Screenshots WKND doesn't support AMP but it does use the same responsive grid so it's generate exactly the same file: https://wknd.site/etc.clientlibs/wknd/clientlibs/clientlib-base.lc-604c2890bb40261cb7a24c421b97841a-lc.min.css

szymon-krzysztyniak commented 3 years ago

Hi, is there any progress on this one? I would appreciate if you can share the plan/idea that you will use to fix this? Thanks in advance.

Regards, Szymon