'Shared theme shell fragments rendered through the component system.', 'option' => function($prop) { $key = (string)($prop['key'] ?? ''); $default = $prop['default'] ?? null; $themes = cfg('theme/options'); $currentThemeKey = (string)cfg('theme/key'); $currentTheme = is_array($themes) && isset($themes[$currentThemeKey]) ? $themes[$currentThemeKey] : []; if(is_array($currentTheme) && array_key_exists($key, $currentTheme)) return $currentTheme[$key]; $direct = cfg('theme/'.$key); return $direct !== null ? $direct : $default; }, 'html_class' => function($prop) { $classes = ['no-js']; if(cfg('theme/mode') === 'dark') $classes[] = 'dark-theme'; $extra = trim((string)($prop['extra_class'] ?? '')); if($extra !== '') $classes[] = $extra; return trim(implode(' ', $classes)); }, 'head' => function($prop, $component) { $themePath = (string)cfg('theme/path'); $themePathCommon = 'themes/common/'; $description = first($prop['description'] ?? false, $component['option'](['key' => 'meta_description', 'default' => '']), 'Web App Starter theme'); $themeColor = first($prop['theme_color'] ?? false, $component['option'](['key' => 'theme_color', 'default' => '']), '#0f172a'); include_css($themePath.'css/style.css'); include_js('js/u-query.js'); include_js('js/morphdom.js'); include_js('js/site.js'); foreach((array)($prop['extra_css'] ?? []) as $extraCss) include_css($extraCss); foreach((array)($prop['extra_js'] ?? []) as $extraJs) include_js($extraJs); ob_start(); ?>