Skip to content

Commit

Permalink
Merge pull request #510 from live-codes/fix-embeds
Browse files Browse the repository at this point in the history
hot fix for embeds
  • Loading branch information
hatemhosny authored Feb 17, 2024
2 parents 82223c1 + 1b845da commit 0a3167c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/livecodes/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,10 @@ const setTheme = (theme: Theme, editorTheme: Config['editorTheme']) => {
const root = document.querySelector(':root');
root?.classList.remove(...themes);
root?.classList.add(theme);
UI.getThemeToggle().checked = theme === 'dark';
const themeToggle = UI.getThemeToggle();
if (themeToggle) {
themeToggle.checked = theme === 'dark';
}
getAllEditors().forEach((editor) => {
editor?.setTheme(theme, editorTheme);
customEditors[editor?.getLanguage()]?.setTheme(theme);
Expand Down

0 comments on commit 0a3167c

Please sign in to comment.