Google Add-on Card: How to apply color to header text

Viewed 859

The Google Apps Script guide below implies that header text can be colored.

When I try using some HTML tags (such as <span color>), any of them actually worked.

Which tag should I use to implement this?

highlighting-section-header

UPDATE

The following is my code to implement the section header. The <b> tag pair works, but any attempts I made to apply color failed.

CardService.newCardBuilder()
  .addSection(
    CardService.newCardSection()
    .setHeader('<b>header text</b>')
  )
  .build();
1 Answers

The Google Apps Script Card reference doesn't include much about how to handle the Card design but the Google Workspace Add-ons site points to use the G Suite Addon Design Kit.

Regarding the use of HTML the supported tags only a few. To assing a font color use something like this:

CardService.newCardBuilder()
  .addSection(
    CardService.newCardSection()
    .setHeader('<font color="#ea9999">header text</font>')
  )
  .build();

References

Resources

Related