Drupal 10 has dropped support for Internet Explorer which means CSS custom properties are fully supported by all browsers that Drupal supports.
Passing backend settings to frontend is quite common task when you need content managers to be able to change site appearance.
Currently it is typically implemented through preprocess variables which is kind of tedious.
Proposed solution
Support attaching CSS properties same way as JS settings.
'#attached': [
'drupalProperties': [
':root': [
'bg-color': 'pink',
],
],
],
On FE side it should look like this.
<style>
:root {--bg-color: pink}
</style>