diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts index 3fc8601fb9..f009a5f682 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/app.ts @@ -14,7 +14,6 @@ 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'); @@ -22,6 +21,7 @@ BitTheme.init({ 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); } });