Change color by index

A typical news card that switch from a stacked to a horizontal design based on the available space in its container.

.card-wrapper {
  container: card / inline-size;
}
 
.card {
  display: flex;
  flex-direction: column;
}
 
@container card (min-width: 350px) {
  .card {
    flex-direction: row;
  }
 
  .card__thumb img {
    width: 200px;
  }
}

Take a look at the demo below and resize the wrapper.

Cinnamon rolls

Cinnamon rolls

A bit of desc text in here

Full Screen