@ConditionalOnMissingBean(name = "casThemeResolver")
    @Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public ThemeResolver themeResolver(
        final ObjectProvider<CasConfigurationProperties> casProperties,
        @Qualifier(TenantExtractor.BEAN_NAME)
        final ObjectProvider<TenantExtractor> tenantExtractor,
        @Qualifier(AuthenticationServiceSelectionPlan.BEAN_NAME)
        final ObjectProvider<AuthenticationServiceSelectionPlan> authenticationRequestServiceSelectionStrategies,
        @Qualifier(ServicesManager.BEAN_NAME)
        final ObjectProvider<ServicesManager> servicesManager) {

        val defaultThemeName = casProperties.getObject().getTheme().getDefaultThemeName();
        val fixedResolver = new FixedThemeResolver();
        fixedResolver.setDefaultThemeName(defaultThemeName);

        val sessionThemeResolver = new SessionThemeResolver();
        sessionThemeResolver.setDefaultThemeName(defaultThemeName);

        val tgc = casProperties.getObject().getTgc();
        val cookieThemeResolver = new CookieThemeResolver();
        cookieThemeResolver.setDefaultThemeName(defaultThemeName);
        cookieThemeResolver.setCookieDomain(tgc.getDomain());
        cookieThemeResolver.setCookieHttpOnly(tgc.isHttpOnly());
        cookieThemeResolver.setCookieMaxAge(CookieUtils.getCookieMaxAge(tgc.getMaxAge()));
        cookieThemeResolver.setCookiePath(tgc.getPath());
        cookieThemeResolver.setCookieSecure(tgc.isSecure());

        val serviceThemeResolver = new RegisteredServiceThemeResolver(servicesManager,
            authenticationRequestServiceSelectionStrategies, casProperties);
        serviceThemeResolver.setDefaultThemeName(defaultThemeName);

        val header = new RequestHeaderThemeResolver(casProperties.getObject().getTheme().getParamName());
        header.setDefaultThemeName(defaultThemeName);

        val chainingThemeResolver = new ChainingThemeResolver();
        chainingThemeResolver
            .addResolver(cookieThemeResolver)
            .addResolver(sessionThemeResolver)
            .addResolver(header)
            .addResolver(serviceThemeResolver)
            .addResolver(fixedResolver);

        if (casProperties.getObject().getMultitenancy().getCore().isEnabled()) {
            val tenantThemeResolver = new TenantThemeResolver(tenantExtractor, servicesManager,
                authenticationRequestServiceSelectionStrategies, casProperties);
            tenantThemeResolver.setDefaultThemeName(defaultThemeName);
            chainingThemeResolver.addResolver(tenantThemeResolver);
        }
        chainingThemeResolver.setDefaultThemeName(defaultThemeName);
        return chainingThemeResolver;
    }
This is {@link CasThemesAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-themes/src/main/java/org/apereo/cas/config/CasThemesAutoConfiguration.java