| 136 | |
| 137 | // Get the collected CSS as a string with improved formatting |
| 138 | export function getCollectedCSS(): string { |
| 139 | if (Object.keys(cssCollection).length === 0) { |
| 140 | return ""; |
| 141 | } |
| 142 | |
| 143 | return Object.entries(cssCollection) |
| 144 | .map(([className, { styles }]) => { |
| 145 | if (!styles.length) return ""; |
| 146 | return `.${className} {\n ${styles.join(";\n ")}${styles.length ? ";" : ""}\n}`; |
| 147 | }) |
| 148 | .filter(Boolean) |
| 149 | .join("\n\n"); |
| 150 | } |
| 151 | |
| 152 | // Generate styled-components with improved naming and formatting |
| 153 | export function generateStyledComponents(): string { |