added theme support

This commit is contained in:
Mark Gregory
2026-10-20 10:23:23 +01:00
parent 1d70a9c8cf
commit f0e31aad6b
5 changed files with 55 additions and 25 deletions
+5 -1
View File
@@ -14,7 +14,11 @@ final class Stylist
{
$requested = $this->resolver->resolve($context);
try {
return $this->loader->find($requested);
$theme = $this->loader->find($requested);
if ($context !== null && $theme->type() !== $context) {
throw ThemeNotFoundException::forKey($requested);
}
return $theme;
} catch (ThemeNotFoundException) {
$fallback = $context === 'frontend'
? (string) config('stylist.default_frontend_theme', 'sonardesk')