Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with AMP #389

Closed
Download opened this issue Mar 8, 2017 · 5 comments
Closed

Compatibility with AMP #389

Download opened this issue Mar 8, 2017 · 5 comments

Comments

@Download
Copy link

Download commented Mar 8, 2017

I am wondering, is Material Components Web compatible with AMP.

I do not find any mention of AMP on this project and the AMP website does not mention Material Components.

Both Google projects seem to be targetting the same kind of modern progressive web app style, but I don't think we are allowed to include the material components web JS script in an AMP page... So can we combine them?

I am wondering about this because I am hoping to support AMP and it would be very convenient if the AMP pages could use the same Material Components as the main pages... But I wonder if it's possible?

Is AMP support a target for you guys?
Do you have pointers on docs/guidance about this?

If I am right in thinking we cannot embed the material-components-web JS script on an AMP page, is there guidance available on which components we can still use if we don't have this script?

@traviskaufman
Copy link
Contributor

Unfortunately Material Components for the web is not compatible with AMP as of now.

AMP doesn't allow JS on its pages, which MDC-Web needs for its more complex components. Furthermore, there are certain restrictions on CSS styles, such as disallowing !important and :not. We make use of both of these constructs within our (S)CSS, since in many cases its needed to facilitate the complexity of the Material Design UX.

Having custom AMP components built that leverage MDC-Web is something that we can definitely investigate in the future, but it's not on our radar right now.

@Download
Copy link
Author

Thanks for your explanation!

@niutech
Copy link

niutech commented Aug 17, 2017

You can use the AMP Surface CSS-only framework to create AMP pages - see the demo.

@ronnieroyston
Copy link

Curious of MDC-Web could provide guidance on achieving some goals of the AMP project, namely, fastest possible loading / rendering of pages. One thing I see them doing in AMP is embedding the CSS in the head and avoiding reflow / repaint of the page. Usage of srcset and art direction. Seems like we could get this baked into the Getting Started Guide or a Best Practices Guide.

As an aside, AMP's caching seems to be heavily highlighted. Doesn't Firebase hosting have this baked in already (i know getting off topic, ..but)

@niutech
Copy link

niutech commented Dec 21, 2018

Update: I have also AMP-lified another Material Design CSS framework MUI - see the demo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants