I'm implementing a 'light-dark-toggle" button to choose between these 2 themes. Currently I have 1 uniqueValueRenderer with a attribute FIELD. I was trying to add an attribute to the view object and using this value to check for light / dark mode.
($view.night == 1), 'night', 'day'
But unfortunately it's not possible to add custom attributes to the view and it's not possible to use $view.night with valueExpressions: