question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with text color of adaptive cards changing by teams theme

See original GitHub issue

Platform

What platform is your issue or question related to? (Delete other platforms).

  • JavaScript

Author or host

Are you an author (like sending something to Outlook), or a host that is rendering your own cards? Author If you’re an author, who are you sending cards to? Either DMs or group chats on MS teams

Version of SDK

1.0 What version are you using? Ex: NuGet 1.0.2, or latest master, etc… Issue happens both the current version of the botbuilder framework with CardFactory.adaptiveCard() and with the direct importing of the adaptivecards package and declaring the adaptive card as:

var companyCard = new AdaptiveCards.AdaptiveCard();
companyCard.parse(card);

Issue

When I set the text of an adaptive card to light (white) it will appear white on the default teams theme and the high contrast but will invert to black on the teams dark theme and therefore not be readable. The screen shots I posted are of the same card with and without a background image that I’m using as a background color for the cards (#001F3D) Screen Shot 2019-07-18 at 10 54 38 AM Screen Shot 2019-07-18 at 10 55 46 AM Screen Shot 2019-07-18 at 10 56 00 AM Screen Shot 2019-07-18 at 10 56 05 AM Screen Shot 2019-07-18 at 10 56 29 AM Screen Shot 2019-07-18 at 10 56 34 AM

As you can see the default and high contrast themes work as intended, but the dark theme inverts the white to black which is detrimental in this instance.

. The JSON is:

let card = CardFactory.adaptiveCard(
            {
                "type": "AdaptiveCard",
                "body": [
                    {
                        "type": "Container",
                        "items": [
                            {
                                "type": "TextBlock",
                                "size": "Medium",
                                "weight": "Bolder",
                                "text": "Feature not active",
                                "color": "Light"
                            }
                        ]
                    },
                    {
                        "type": "Container",
                        "items": [
                            {
                                "type": "TextBlock",
                                "text": "This version does not support imperatives.",
                                "wrap": true,
                                "color": "Light"
                            }
                        ]
                    },
                    {
                        "type": "Image",
                        "url": "https://raw.githubusercontent.com/link-works-but-has-repo-names-I-cant-share",
                        "size": "Small",
                        "horizontalAlignment": "Right",
                        "spacing": "None"
                    }
                ],
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "version": "1.0",
                "backgroundImage": "https://raw.githubusercontent.com/link-works-but-has-repo-names-I-cant-share"
            }
        );

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
shalinijoshi19commented, Nov 11, 2019

@siduppal / @susanshen96 could you help take a look at this real quick please?

1reaction
oettingerjcommented, Jul 19, 2019

detrimental in this instance

do not mess with this guy’s adaptive cards

Read more comments on GitHub >

github_iconTop Results From Across the Web

MS Teams, Dark Mode, Task with Adaptive card
MS Teams, Dark Mode, Task with Adaptive card - wrong colors (Microsoft Teams Version 1.4. 00.26376. Dark Mode. Task - AdaptiveCard (v 1.3)....
Read more >
Microsoft Teams Adaptive Card - Dark Mode Color Issue
The only problem I have with it, is that my Adaptive Card has a color issue withing Microsoft Teams in Dark Mode. Take...
Read more >
TextBlock - Schema Explorer
TextBlock. Displays text, allowing control over font sizes, weight, and color. ... You can even draw attention to certain text with color ...
Read more >
Adaptive Cards in Microsoft Teams using Power Automate
Getting started with Adaptive Cards for Microsoft Teams using Power ... We will build forms in adaptive cards using text boxes, Images, ...
Read more >
Create a Company Snapshot Adaptive Card
An Adaptive Card is a portable, flexible, and open source card exchange with automatic theme styling that promotes a consistent user experience in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found