postcss / postcss.org

Official website for PostCSS
https://postcss.org
MIT License
81 stars 50 forks source link

Add support to scoped container queries #283

Closed retroriff closed 1 year ago

retroriff commented 1 year ago

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 1 year ago

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.

retroriff commented 1 year ago

You are right, sorry.