postcss/postcss.org

Add support to scoped container queries

retroriff opened this issue · 2 comments

It seems that container queries are not supported, and therefore style rules are not scoped:

<style lang="postcss" scoped>
.container {
  container-type: inline-size;
}

@container (min-width: rem(700)) {
  .wrapper {
    flex-direction: row;
  }
}
</style>

This is what we get:

.wrapper[data-v-ec3ae8ce] {
    display: flex;
    flex-direction: column;
}
@container (min-width: 43.75rem)
  .wrapper {
      flex-direction: row;
      gap: 1.875rem;
  }
}

This makes that the container query is not rendered because the class specificity is lower.

ai commented

Hi. This is repo for PostCSS website, not the right place for this question.

Seems like you are asking about specific postcss-preset-env plugin. You should ask there.

You are right, sorry.