Style queries

Style queries let us query a CSS property or CSS variable for a container.

Stiven Castillo
June 07, 2023

Style queries

In simple words, style queries let us query a CSS property or CSS variable for a container.

.page-header {
  display: flex;
}

@container style(display: flex) {
  .page-header__start {
    flex: 1;
    display: flex;
    align-items: center;
    border-right: 1px solid lightgrey;
  }
}

https://ishadeed.com/article/css-container-style-queries