CSS nesting in amp pages- is there a way to include nested css (css-nesting) in amp-html?

50 views Asked by At

In amp-html, although the official documentation does not prohibit nested selectors but nested css selectors do not pass online amp validator.

I tested the following html using online amp validator

<style amp-custom>
ul {
  padding-left: 1em;
  .component & {
    padding-left: 0;
  }
}
</style>

This produces the error on the nested selector: "CSS syntax error in tag 'style amp-custom' - invalid declaration."

I dont quite understand why we have this limitation in amp-pages.

Any guidance would be appreciated.

0

There are 0 answers