+ $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
+ // Make keys (skin names) lowercase for case-insensitive matching.
+ $themes = array_change_key_case( $themes, CASE_LOWER );
+ $skinName = strtolower( $this->getSkin()->getSkinName() );
+ $theme = isset( $themes[ $skinName ] ) ? $themes[ $skinName ] : 'MediaWiki';
+ // For example, 'OOUI\MediaWikiTheme'.
+ $themeClass = "OOUI\\{$theme}Theme";
+ OOUI\Theme::setSingleton( new $themeClass() );