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

AMP Layout page invalid #6863

Open
omerr132 opened this issue Nov 19, 2024 · 3 comments
Open

AMP Layout page invalid #6863

omerr132 opened this issue Nov 19, 2024 · 3 comments

Comments

@omerr132
Copy link

The following page is AMP invalid:

The parent tag of tag 'style amp-custom' is 'section', but it can only be 'head'.

https://validator.amp.dev/#url=https://amp.dev/documentation/guides-and-tutorials/learn/amp-html-layout/layouts_demonstrated&errno=0

https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#stylesheets

@jaygray0919
Copy link

@omerr132
Copy link
Author

omerr132 commented Nov 21, 2024 via email

@jaygray0919
Copy link

jaygray0919 commented Nov 22, 2024

ok, you are correct
here's probably what happened. that page needs CSS that is not defined in the SCSS libs and generated as compiled CSS during build.
so page authors added compiled CSS and placed it as a second instance of <style amp-custom> in <body> (since they cannot inject it into <head><style amp-custom> during build).
there is nothing invalid about the CSS; it's simply "in the wrong place"
an easy fix: transform target CSS to SCSS as a specific library and add that SCSS lib to page source.

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

No branches or pull requests

2 participants