<div></div>
:root {
  --stopPoint: 50px;
}

@property --stop {
  syntax: "<percentage>";
  initial-value: 50%;
  inherits: false;
}

body {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

  --stop: 50px;
  background-image: linear-gradient(
    to right,
    red,
    red var(--stop),
    gold var(--stop),
    gold
  );
}

div {
  width: 50vw;
  height: 50vh;
  border: 1px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  --stopPoint: 30%;
  background-image: linear-gradient(
    to right,
    gold,
    gold var(--stopPoint),
    red var(--stopPoint),
    red
  );
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.