Skip to content

Commit

Permalink
test(echarts): adapt theme logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jul-lam committed Dec 19, 2024
1 parent 372dfa2 commit ac16bc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 2 additions & 4 deletions packages/echarts/tests/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@
const searchParams = new URLSearchParams(location.search);

if (!searchParams.has('theme')) {
return 'brand-dark';
return 'theme-brand-dark';
}

const theme = searchParams.get('theme');

return theme.substring('theme-'.length, theme.length);
return searchParams.get('theme');
}

registerTheme(echarts);
Expand Down
14 changes: 6 additions & 8 deletions packages/echarts/tests/more-colors.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@
const searchParams = new URLSearchParams(location.search);

if (!searchParams.has('theme')) {
return 'brand-dark';
return 'theme-brand-dark';
}

const theme = searchParams.get('theme');

return theme.substring('theme-'.length, theme.length);
return searchParams.get('theme');
}

registerTheme(echarts);
Expand Down Expand Up @@ -185,7 +183,7 @@
};

switch (theme) {
case 'classic-dark':
case 'theme-classic-dark':
options.color = [
'#EF9A9A' /* theme-chart-14 */,
'#F38FC2' /* theme-chart-13 */,
Expand All @@ -198,7 +196,7 @@
];
break;

case 'classic-light':
case 'theme-classic-light':
options.color = [
'#9E5833' /* theme-chart-14 */,
'#6F2542' /* theme-chart-13 */,
Expand All @@ -211,7 +209,7 @@
];
break;

case 'brand-dark':
case 'theme-brand-dark':
options.color = [
'#BE5925' /* theme-chart-14 */,
'#FF98C4' /* theme-chart-13 */,
Expand All @@ -224,7 +222,7 @@
];
break;

case 'brand-light':
case 'theme-brand-light':
options.color = [
'#BE5925' /* theme-chart-14 */,
'#4F153D' /* theme-chart-13 */,
Expand Down

0 comments on commit ac16bc8

Please sign in to comment.