@Override
    protected ITemplateResource computeTemplateResource(
        final IEngineConfiguration configuration,
        final String ownerTemplate, final String template,
        final String resourceName, final String characterEncoding,
        final Map<String, Object> templateResolutionAttributes) {

        val request = HttpRequestUtils.getHttpServletRequestFromRequestAttributes();
        val themeName = themeResolver.resolveThemeName(request);

        if (StringUtils.isNotBlank(themeName)) {
            val themeTemplate = String.format(resourceName, themeName);
            val resource = new ClassLoaderTemplateResource(themeTemplate, StandardCharsets.UTF_8.name());
            if (resource.exists()) {
                LOGGER.trace("Computing template resource [{}]...", themeTemplate);
                return super.computeTemplateResource(configuration, ownerTemplate, template,
                    themeTemplate, characterEncoding, templateResolutionAttributes);
            }
        }
        return super.computeTemplateResource(configuration, ownerTemplate, template,
            resourceName, characterEncoding, templateResolutionAttributes);
    }
This is {@link ThemeClassLoaderTemplateResolver}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-thymeleaf-core/src/main/java/org/apereo/cas/web/view/ThemeClassLoaderTemplateResolver.java