How the `AppRoot` theming mechanism works
mainThe AppRoot component manages dynamic theming by combining CSS variables with React context. It automatically detects the current theme (light, dark, or Telegram custom themes) and the user's platform (iOS, Android, or web) to apply appropriate styles.
Key behaviors include:
- Theme Detection: Updates CSS variables based on Telegram settings or manual preferences.
- Platform Adaptation: Applies platform-specific styles (typography, sizing, interaction feedback) to match platform conventions.
- Contextual Access: Uses React context to provide theme and platform information to all nested components, enabling conditional rendering or styling deep within the component tree.