I have found How can I programmatically get the theme name?, which works for the current user, but would I apply such logic to learn what theme another user would use?
I can get the active theme for current user and the default theme by using:
$my_theme = \Drupal::theme()->getActiveTheme(); $default_theme = \Drupal::config('system.theme')->get('default');
I was hoping there would be something like
\Drupal::theme()->getActiveTheme($other_user); to discover what theme another user would be using.
Is such a thing even possible and how?
To clear things up, I am attempting to figure out what theme was negotiated for a certain user. This could be the global default theme, but it could also be the theme that was negotiated based on a certain role, user selected theme, or any other contrib theme negotiator that might be in place.
So the better question would be, how can I discover what theme a user would be presented if he visits the site (no specific page)?