1. Threshold logic
What's actually setting --state on this page, not a simplified stand-in for it.
.pipeline {
--state: 0;
transition: --state .2s ease-out;
@container (width >= 320px) { --state: 1; }
@container (width >= 560px) { --state: 2; }
@container (width >= 800px) { --state: 3; }
@container (width >= 1040px) { --state: 4; }
}
2. Turn state into behavior
One derived signal, --capacity, feeding both a grid track count and a boolean toggle.
.component {
--capacity: calc(var(--state) + 1);
}
.metrics {
grid-template-columns:
repeat(var(--capacity), 1fr);
}
.t1 { display: none; }
@container (width >= 320px) {
.t1 { display: block; }
}