Skip to content

Commit 5be5838

Browse files
committed
test(scripts): update to print default theme
1 parent 994340f commit 5be5838

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/scripts/testing/scripts.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const DEFAULT_THEME = 'md';
12

23
(function() {
34

@@ -20,7 +21,7 @@
2021
*/
2122
const themeQuery = window.location.search.match(/ionic:theme=([a-z0-9]+)/i);
2223
const themeAttr = document.documentElement.getAttribute('theme');
23-
const themeName = themeQuery?.[1] || themeAttr || 'md';
24+
const themeName = themeQuery?.[1] || themeAttr || DEFAULT_THEME;
2425

2526
// TODO(): Remove this when the tokens are working for all components
2627
// and the themes all use the same bundle
@@ -55,7 +56,7 @@
5556
loadThemeTokens(themeName, paletteName);
5657
} else if(themeName) {
5758
console.warn(
58-
`Unsupported theme "${themeName}". Supported themes are: ${validThemes.join(', ')}.`
59+
`Unsupported theme "${themeName}". Supported themes are: ${validThemes.join(', ')}. Defaulting to ${DEFAULT_THEME}.`
5960
);
6061
}
6162

0 commit comments

Comments
 (0)