Use logic, specifically if() in CSS!
Check it out 👇
CSS tip: CSS has if() now.
.badge {
background: if(
style(--status: online): #16A34A;
style(--status: away): #F59E0B;
else: #9CA3AF
);
}
Set --status on the element and the color follows.


