Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
benoitdubuc
Regular Visitor

Text classes for theme not working the way I thought

I am trying to set a minimal theme with just color and text classes.

 

{
 "name": "MinimalThemeWClasses",
 "foreground": "#252423",
 "foregroundNeutralSecondary": "#605E5C",
 "foregroundNeutralTertiary": "#B3B0AD",
 "background": "#FFFFFF",
 "backgroundLight": "#F3F2F1",
 "backgroundNeutral": "#C8C6C4",
 "tableAccent": "#118DFF",
 "textClasses": {
      "callout": {
           "fontSize": 25,
           "fontFace": "DIN",
           "color": "#252423"
      },
      "title": {
           "fontSize": 14,
           "fontFace": "DIN",
           "color": "#252423"
      },
      "header": {
           "fontSize": 14,
           "fontFace": "Segoe UI",
           "color": "#252423"
      },
      "label": {
           "fontSize": 14,
           "fontFace": "Segoe UI",
           "color": "#FF0000"
      }
 }
}

When I apply it to my simple report, only the totals in the table visual are red. If I change the fontSize to 24, most of my text in my page change size. It seems I don't undertand what the color parameter does or this is a bug.Size 14, color redSize 14, color redSize 24, color redSize 24, color red

2 REPLIES 2
mckaysavage
New Member

It is because you've set 3 of the text classes to "color": "#252423", which is near-black. If you change these in your file and re-load the theme, you'll see more of the text change color. 

 

So for example, if you switch the title text class to red you'll see the titles change to red:

"title": {
"fontSize": 24,
"fontFace": "DIN",
"color": "#252423"
},

 

Also note that assuming you did not have these text classes in your minimal theme, the "foreground" color class affects most text color in the PowerBI. So you could also change that color and most of the PowerBI text will change. 

 

So in short, you are setting the global "foreground" text color currently to a near-black color #252423 and the "foregroundNeutralSecondary" class to a dark grey (which affects many text areas like headers and axes). You are then over-riding these text settings for "callout", "title" and "header" classes to set them to the near-black color #252423. It is only the "label" class that you changed to red #FF0000

 

 

McKay

v-lili6-msft
Community Support
Community Support

hi, @benoitdubuc 

For the font color of each visual, It requires separate Settings in the JSON file, please refer to this blog:

https://community.powerbi.com/t5/Webinars-and-Video-Gallery/How-to-create-a-Power-BI-theme-with-a-JS...

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.