> why offload the variable resolution to the client side when it can be done at compilation time?
Imagine I have a property that I need to change depending on screen resolution in order to make a responsive layout.
In my CSS rule I specify it to have a fallback default and to take a CSS variable that over-rides it.
Elsewhere in my CSS I define the CSS variable with a media query.
The CSS rule is quite clear in that it shows that something changes or can change.
In the olden days I would be declaring the CSS rule twice. Once for the default and once inside the media query.
With the old fashioned approach it would not be clear looking at the CSS rule that it had an over-ride somewhere else in a media query.
By using the CSS variable with a fallback in just the one rule I know that something in the rule changes. I can easily find the CSS variable, regardless of how it has been scoped to see what makes it get set. Since I know the convention for most of the CSS in the stylesheet, e.g. mobile first, I can guess that the variable is for the desktop setting.
The advantage is that I have code that I can hand on to the next guy and feel happy that even if they are not yet up to speed on CSS variables they will be able to easily work out what is going on with individual rules.
There is no point in Sass variables now, they are defunct. All of the functionality is superseded and there is no point learning two ways to achieve the same task when you can just master one. This trumps any 'compilation' speed ups, resolving variables is something that does not slow page load times.
The only use case for not using CSS variables is if you have to support people using extremely old browser.