diff options
Diffstat (limited to 'subprojects/frontend/src/WindowControlsOverlayColor.tsx')
-rw-r--r-- | subprojects/frontend/src/WindowControlsOverlayColor.tsx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/subprojects/frontend/src/WindowControlsOverlayColor.tsx b/subprojects/frontend/src/WindowControlsOverlayColor.tsx new file mode 100644 index 00000000..14eda566 --- /dev/null +++ b/subprojects/frontend/src/WindowControlsOverlayColor.tsx | |||
@@ -0,0 +1,21 @@ | |||
1 | import { useTheme } from '@mui/material/styles'; | ||
2 | import { useEffect } from 'react'; | ||
3 | |||
4 | export default function WindowControlsOverlayColor(): null { | ||
5 | const { | ||
6 | palette: { | ||
7 | outer: { background }, | ||
8 | }, | ||
9 | } = useTheme(); | ||
10 | useEffect(() => { | ||
11 | document.head | ||
12 | .querySelectorAll('meta[name="theme-color"]') | ||
13 | .forEach((meta) => meta.remove()); | ||
14 | const meta = document.createElement('meta'); | ||
15 | meta.name = 'theme-color'; | ||
16 | meta.content = background; | ||
17 | document.head.appendChild(meta); | ||
18 | }, [background]); | ||
19 | |||
20 | return null; | ||
21 | } | ||