Here's a way to THINK about CSS Custom Property (variable) usage: when state changes, don't re-declare entire chunks of CSS, just change the data. The original declaration updates with the new data. Not only more DRY but better reflects your intention.
https://codepen.io/chriscoyier/pen/yLZKJWq