Skip to content

Commit 9f4944f

Browse files
authored
fix: match system theme for run button (#1953)
1 parent 24cd830 commit 9f4944f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/isolated-run-button.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ window.addEventListener('message', (event: MessageEvent) => {
348348
}
349349
});
350350

351-
void applyThemeByName(initialParams.get('initialTheme'));
351+
if (isUsingSystemTheme) {
352+
applyTheme(
353+
window.matchMedia(PREFERS_DARK_MEDIA_QUERY).matches
354+
? defaultDark
355+
: defaultLight,
356+
);
357+
} else {
358+
void applyThemeByName(initialParams.get('initialTheme'));
359+
}
352360

353361
render();

0 commit comments

Comments
 (0)