set the meta tag for theme-color to the same theme css background

pull/21833/head
Dan Jenkins 2020-05-06 16:23:06 +01:00
parent 14516d3e7e
commit 1767a611a6
No known key found for this signature in database
GPG Key ID: A67A3BFEE1824A43
1 changed files with 4 additions and 0 deletions

View File

@ -242,6 +242,10 @@ export async function setTheme(theme) {
if (a == styleElements[stylesheetName]) return; if (a == styleElements[stylesheetName]) return;
a.disabled = true; a.disabled = true;
}); });
const bodyStyles = global.getComputedStyle(document.getElementsByTagName("body")[0]);
if (bodyStyles.backgroundColor) {
document.querySelector('meta[name="theme-color"]').content = bodyStyles.backgroundColor;
}
Tinter.setTheme(theme); Tinter.setTheme(theme);
resolve(); resolve();
}; };