<div class="div">
  
</div>
:root {
  --color: initial;
}

@media (max-width: 350px) {
  :root {
    --color: ;
  }
}

.div {
  --color-when-small: var(--color) red;
  --color-when-big: yellow;

  background-color: var(--color-when-small, var(--color-when-big));
  width: 80vw;
  height: 80vh;
  margin: 0 auto;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.