'lm',
'dark-mode' => 'dm',
'light-accent' => 'la',
'dark-accent' => 'da',
];
// Payment shapes
$paymentShapes = ['icon', 'square', 'rectangle', 'text-only'];
// Social shapes
$socialShapes = ['icon', 'full-logo', 'text-only'];
/**
* Build a sprite from a directory of SVG files
*/
function buildSprite(string $sourceDir, string $outputFile, string $modeSuffix): void
{
if (!is_dir($sourceDir)) {
echo " Skipping: $sourceDir (not found)\n";
return;
}
$files = glob($sourceDir . '/*.svg');
if (empty($files)) {
echo " Skipping: $sourceDir (no SVG files)\n";
return;
}
$symbols = [];
foreach ($files as $file) {
$filename = basename($file, '.svg');
$content = file_get_contents($file);
// Extract viewBox from original SVG
preg_match('/viewBox="([^"]+)"/', $content, $viewBoxMatch);
$viewBox = $viewBoxMatch[1] ?? '0 0 45 45';
// Extract width/height if present
preg_match('/width="([^"]+)"/', $content, $widthMatch);
preg_match('/height="([^"]+)"/', $content, $heightMatch);
$width = $widthMatch[1] ?? null;
$height = $heightMatch[1] ?? null;
// Remove XML declaration and outer SVG tags
$content = preg_replace('/<\?xml[^>]+\?>/', '', $content);
$content = preg_replace('//', '', $content);
// Extract inner content (everything between )
if (preg_match('/