TelegramUI icon indicating copy to clipboard operation
TelegramUI copied to clipboard

Allow force light / dark theme in WebApp

Open bshelkhonov opened this issue 1 month ago • 0 comments

My Telegram MiniApp supports only light theme. I set appearance="light" in AppRoot.

<AppRoot platform="base" appearance="light">
     <MyApp />
</AppRoot>

but when I open my app in Telegram on device with dark mode, components are dark because --tgui--bg_color defined as --tg-theme-bg-color: https://github.com/Telegram-Mini-Apps/TelegramUI/blob/551a22fc55aa7145d8e2e7a4df6966a7e35a5b84/src/components/Service/AppRoot/AppRoot.module.css#L38

Can you add an option to force light or dark theme in my app by ignoring css variables from telegram miniapps api?

bshelkhonov avatar May 21 '24 06:05 bshelkhonov