Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Aug 12, 2024
1 parent 29b5683 commit cbe1bf1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ declare class BitTheme { static init(options: any): void; };
BitTheme.init({
system: true,
onChange: (newTheme: string, oldThem: string) => {
const primaryBackgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--bit-clr-bg-pri');
if (newTheme === 'dark') {
document.body.classList.add('theme-dark');
document.body.classList.remove('theme-light');
} else {
document.body.classList.add('theme-light');
document.body.classList.remove('theme-dark');
}
document.querySelector("meta[name=theme-color]")!.setAttribute('content', primaryBackgroundColor);
const primaryBgColor = getComputedStyle(document.documentElement).getPropertyValue('--bit-clr-bg-pri');
document.querySelector("meta[name=theme-color]")!.setAttribute('content', primaryBgColor);
}
});

0 comments on commit cbe1bf1

Please sign in to comment.