1. Converting ECharts Theme to CSS Variables
Frontend EngineerBackground
A developer needs to integrate a custom ECharts theme into a web application that uses CSS custom properties for global styling.
Problem
Manually extracting colors and font sizes from a complex ECharts theme JSON is tedious and error-prone.
How to use
Paste the ECharts theme JSON, set the output format to CSS variables, add a 'chart' prefix, and enable HEX color normalization.
{
"themeJson": "{\n \"color\": [\"#5470c6\", \"#91cc75\", \"#fac858\"],\n \"backgroundColor\": \"rgb(255, 255, 255)\",\n \"textStyle\": { \"fontSize\": 12, \"color\": \"#333333\" }\n}",
"format": "css",
"prefix": "chart",
"colorMode": "hex"
}Outcome
Generates a clean :root CSS block containing normalized HEX color variables and font size variables prefixed with '--chart-'.