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

This commit is contained in:
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

View file

@ -242,6 +242,10 @@ export async function setTheme(theme) {
if (a == styleElements[stylesheetName]) return;
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);
resolve();
};