Skip to content

Commit beb054f

Browse files
crowrishclaude
andcommitted
Fix status bar style to dynamically adapt to dark/light mode
๐Ÿค– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 250cd9d commit beb054f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

โ€Žsrc/main.tsxโ€Ž

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ if ('serviceWorker' in navigator) {
2525
})
2626
}
2727

28+
// ์ƒํƒœ ํ‘œ์‹œ์ค„ ์Šคํƒ€์ผ ๋‹คํฌ๋ชจ๋“œ ๋Œ€์‘
29+
const updateStatusBarStyle = () => {
30+
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches
31+
const metaTag = document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]')
32+
if (metaTag) {
33+
metaTag.setAttribute('content', isDark ? 'black-translucent' : 'default')
34+
}
35+
}
36+
37+
// ์ดˆ๊ธฐ ์„ค์ •
38+
updateStatusBarStyle()
39+
40+
// ๋‹คํฌ๋ชจ๋“œ ๋ณ€๊ฒฝ ๊ฐ์ง€
41+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateStatusBarStyle)
42+
2843
// PWA ์ฐฝ ํฌ๊ธฐ ์ œ์–ด
2944
if (window.matchMedia('(display-mode: standalone)').matches) {
3045
// PWA ๋ชจ๋“œ์—์„œ ์‹คํ–‰ ์ค‘์ผ ๋•Œ

0 commit comments

Comments
ย (0)