Forum Discussion
Get context for your tab - dark mode
I have an angular website, which i would like to integrate in Teams as a tab.
The embedding of the website as a tab via the webiste tab works fine, but the website should be able to style according to the selected theme in Teams (e.g. default/dark/high contrast).
I tried to retrieve the context via the URL placeholder according to (https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/access-teams-context?view=msteams-client-js-latest) by adding ?theme={theme} to my url. But when i read this query param within my angular app, just the value {theme} is handed over and no substitution happens.
Furthermore i tried to use the Microsoft Teams JavaScript client SDK in my angular app also according to the linked article. And this did not work either.
My app renders the content according to dark/light mode via css media query and it works for the normal browser, but not when embedded in Teams.
Maybe someone can help me here.
Thanks in advance