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
RJ_Nippur
Regular Visitor

Theme - Refer to default colour?

Dear all,

When working with Themes, I sometimes want to refer to one of the default colours I declared earlier in the JSON. Is there a way to do this? The usecase is, when a user wants the colour changed, I only have to change it at one point.

Example:

 

{
        "name": "PowerBI_Community_Example",
        "dataColors": ["#862632", "#68afe1", "#5eb991", "#4c4b52"],
    
    "visualStyles": {
        "slicer": {
		"*": {
			"general": [{
				"outlineColor": { "solid": { "color": "#68afe1"}},
				"outlineWeight": 1,
			}]
		}
        }
    }
}

In the example I want the outline of my slicer to be the same colour as my second default colour. So I am looking for something like:

{
        "name": "PowerBI_Community_Example",
        "dataColors": ["#862632", "#68afe1", "#5eb991", "#4c4b52"],
    
    "visualStyles": {
        "slicer": {
		"*": {
			"general": [{
				"outlineColor": { "solid": { "color": "dataColors_2"}},
				"outlineWeight": 1,
			}]
		}
        }
    }
}

Does anybody know the correct syntax to do this?

 

Kind regards,

 

Ricardo Jacobs

 

1 REPLY 1
v-lili6-msft
Community Support
Community Support

HI, @RJ_Nippur 

According to my knowledge, I'm afraid it couldn't achieve.

You need to define it in the code.

 

Best 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.