Flatten CSS with potential selectors that include media prelude.
This simple post-processor merges entries that use the special selector format
“@media (min-width: X) {” where we will close the block at the end.
We group by media and inside concatenate selectors.
Register a theme from JSON. On duplicate, replace the theme’s selectors, inheritance, and variables.
Expected JSON format: { "name": "theme-name", "theme": { "inherits": "parent", "selectors": {...}, "variables": {...}, "breakpoints": {...} } }
Returns the updated state as JSON, or “{}” on error.