* */ function icon(string $name, int $size = 0, string $class = ''): string { $path = APP_ROOT . "/public/assets/icons/{$name}.svg"; if (!file_exists($path)) { return ""; } $svg = file_get_contents($path); // Normalise width/height to 1em so icons scale with font-size $svg = preg_replace('/\bwidth="[^"]*"/', 'width="1em"', $svg); $svg = preg_replace('/\bheight="[^"]*"/', 'height="1em"', $svg); // Ensure aria-hidden by default (icons are decorative when used via this helper) if (!str_contains($svg, 'aria-hidden')) { $svg = str_replace('