Skill: Theme Customization
Purpose
Create, modify, validate, and enforce Power BI report themes. A well-designed theme ensures visual consistency across the report by pushing formatting into a centralized JSON file rather than scattering overrides across individual visuals.
When a report is driven by a UI mockup, screenshot, Figma file, or React prototype, this skill should be used early to extract and encode the visual design system before heavy PBIR implementation begins.
Prerequisites
- ✅ A PBIP project exists with
<ProjectName>/PBIP/<ProjectName>.Report/ folder.
- ✅ The theme file lives at
StaticResources/SharedResources/BaseThemes/<ThemeName>.json or StaticResources/RegisteredResources/<ThemeName>.json.
- ✅
definition/report.json references the theme via themeCollection.customTheme.name.
References — Load on Demand
| Reference |
Path |
When to Load |
| Theme JSON Structure |
references/theme-json-structure.md |
Creating or modifying a theme |
| Visual Type Overrides |
references/visual-type-overrides.md |
Adding type-specific overrides |
| Theme Validation Checklist |
references/theme-validation-checklist.md |
Validating or auditing a theme |
Optional PBIR CLI Backend
When the local pbir CLI is available, it may be used as an execution helper for theme inspection and theme application.
Good fits:
pbir theme colors
pbir theme text-classes
pbir theme fonts
pbir theme set-colors
pbir theme set-text-classes
pbir theme set-formatting
pbir theme validate
Rules:
- The theme JSON in the repository remains the source of truth.
- Do NOT run
pbir setup.
- Prefer theme-level changes over visual-level overrides even when the CLI can change both.
- If the CLI is unavailable or cannot express the required change cleanly, fall back to direct theme JSON edits guided by repository references.
The Formatting Hierarchy
Power BI applies formatting through a four-level cascade:
Level 1 Power BI built-in defaults
Level 2 Theme wildcard: visualStyles["*"]["*"] → ALL visuals
Level 3 Theme visual-type: visualStyles["lineChart"]["*"] → overrides wildcard for that type
Level 4 Visual instance: visual.json objects → overrides everything
Core principle: Push as much formatting as possible into levels 2 and 3. Visual-level overrides (level 4) should exist only for true one-offs or conditional formatting.
Workflows
A) Create a New Theme
- READ
references/theme-json-structure.md for complete structure reference.
- Start from a valid base — use
examples/minimal-custom-theme.json or examples/enterprise-theme.json. Never author from an empty {}.
- Design the color system first:
dataColors: 6-12 hex values, muted/desaturated, visually distinguishable
- Semantic colors:
good, bad, neutral (flat hex at root level)
- Background/foreground variants
- Set typography (
textClasses): title, header, label, callout, dataTitle. Use Segoe UI / Segoe UI Semibold only.
- Set wildcard container defaults (
visualStyles["*"]["*"]): title, background off, border off, dropShadow off, padding.
- Add visual-type overrides — READ
references/visual-type-overrides.md. At minimum: textbox and image to suppress container chrome.
- Validate — READ
references/theme-validation-checklist.md and apply all checks.
- Place file at
StaticResources/SharedResources/BaseThemes/<ThemeName>.json.
- Update
report.json to reference the theme.
B) Modify an Existing Theme
- READ the existing theme file to understand current structure.
- Identify the change scope: colors, typography, wildcard, visual-type overrides.
- Apply changes following the structure from
references/theme-json-structure.md.
- Validate with
references/theme-validation-checklist.md.
B.1) Theme-First Workflow for Mockup-Driven Reports
When a visual mockup is available, prefer a theme-first approach before detailed PBIR layout work.
- Extract design tokens from the mockup: page background, card surfaces, accent colors, sentiment colors, typography hierarchy, spacing rhythm, and container treatment.
- Encode reusable tokens in the theme JSON first instead of scattering them across visuals.
- Reserve visual-level overrides for true one-offs, SVG content, Deneb specifics, or conditional formatting.
- Align
good, bad, and neutral with the mockup's semantic cues when possible.
- Document any mockup styling that cannot be expressed in the theme and must remain a visual-level approximation.
This reduces drift between design intent and implementation and improves consistency when a mockup must be translated into a Power BI-feasible visual language.
C) Promote Visual Overrides to Theme
When visuals have accumulated bespoke formatting that should become defaults:
- Audit: Identify which visuals have
objects or visualContainerObjects overrides.
- Classify each override:
- Stale: Duplicates theme value → remove from visual
- Conflicting: Different from theme → promote to theme or document as exception
- Conditional formatting: Expression-based → never promote, keep in visual
- Decide placement: Wildcard (
["*"]["*"]) for universal, visual-type (["<type>"]["*"]) for type-specific.
- Write the value into the theme JSON.
- Remove the override from the visual.
- Verify the visual still renders correctly.
D) Audit Theme Compliance
- Establish baseline: Read theme wildcard and type-level sections.
- Scan visuals: Find all
visual.json files with objects or visualContainerObjects.
- Compare: For each override, check if it matches or conflicts with the theme.
- Report findings using severity levels:
- Critical: Chrome overrides contradicting theme across multiple visuals
- Warning: Individual property differences from theme defaults
- Suggestion: Empty/null override keys, redundant values
Anti-Hallucination Rules
- Never invent theme property names — verify against the theme JSON schema or the
references/visual-type-overrides.md index.
- Color format matters:
textClasses uses plain hex strings ("color": "#343a40"); visualStyles uses object wrappers ({"solid": {"color": "#343a40"}}). Mixing them causes silent failures.
- Supported fonts only: Segoe UI, Segoe UI Semibold, Segoe UI Light, Segoe UI Bold, Arial, Calibri, Candara, Consolas, Courier New, DIN, Georgia, Tahoma, Times New Roman, Trebuchet MS, Verdana. No custom fonts.
- Semantic colors are root-level keys (
"good": "#2f9e44"), NOT nested under a sentimentColors object.
- Array wrapper required: All
visualStyles container values must be wrapped in [{...}].
Schema and Documentation
1---2name: theme-customization3description: Use when creating, modifying, or auditing Power BI report themes. Triggers: "create a theme", "design a theme", "build a theme", "apply theme", "update theme colors", "change theme typography", "set text classes", "enforce theme compliance", "audit theme adherence", "push formatting to theme", "promote bespoke formatting to theme", "clear visual overrides", "standardize report formatting", "validate a theme", "add visual-type overrides to theme", "sentiment colors", "dataColors palette".4---56# Skill: Theme Customization78## Purpose9Create, modify, validate, and enforce Power BI report themes. A well-designed theme ensures visual consistency across the report by pushing formatting into a centralized JSON file rather than scattering overrides across individual visuals.1011When a report is driven by a UI mockup, screenshot, Figma file, or React prototype, this skill should be used early to extract and encode the visual design system before heavy PBIR implementation begins.1213## Prerequisites141. ✅ A PBIP project exists with `<ProjectName>/PBIP/<ProjectName>.Report/` folder.152. ✅ The theme file lives at `StaticResources/SharedResources/BaseThemes/<ThemeName>.json` or `StaticResources/RegisteredResources/<ThemeName>.json`.163. ✅ `definition/report.json` references the theme via `themeCollection.customTheme.name`.1718## References — Load on Demand1920| Reference | Path | When to Load |21|---|---|---|22| Theme JSON Structure | `references/theme-json-structure.md` | Creating or modifying a theme |23| Visual Type Overrides | `references/visual-type-overrides.md` | Adding type-specific overrides |24| Theme Validation Checklist | `references/theme-validation-checklist.md` | Validating or auditing a theme |2526## Optional PBIR CLI Backend2728When the local `pbir` CLI is available, it may be used as an execution helper for theme inspection and theme application.2930Good fits:31- `pbir theme colors`32- `pbir theme text-classes`33- `pbir theme fonts`34- `pbir theme set-colors`35- `pbir theme set-text-classes`36- `pbir theme set-formatting`37- `pbir theme validate`3839Rules:401. The theme JSON in the repository remains the source of truth.412. Do **NOT** run `pbir setup`.423. Prefer theme-level changes over visual-level overrides even when the CLI can change both.434. If the CLI is unavailable or cannot express the required change cleanly, fall back to direct theme JSON edits guided by repository references.4445## The Formatting Hierarchy4647Power BI applies formatting through a four-level cascade:4849```50Level 1 Power BI built-in defaults51Level 2 Theme wildcard: visualStyles["*"]["*"] → ALL visuals52Level 3 Theme visual-type: visualStyles["lineChart"]["*"] → overrides wildcard for that type53Level 4 Visual instance: visual.json objects → overrides everything54```5556**Core principle**: Push as much formatting as possible into levels 2 and 3. Visual-level overrides (level 4) should exist only for true one-offs or conditional formatting.5758## Workflows5960### A) Create a New Theme61621. **READ** `references/theme-json-structure.md` for complete structure reference.632. **Start from a valid base** — use `examples/minimal-custom-theme.json` or `examples/enterprise-theme.json`. Never author from an empty `{}`.643. **Design the color system first**:65 - `dataColors`: 6-12 hex values, muted/desaturated, visually distinguishable66 - Semantic colors: `good`, `bad`, `neutral` (flat hex at root level)67 - Background/foreground variants684. **Set typography** (`textClasses`): `title`, `header`, `label`, `callout`, `dataTitle`. Use Segoe UI / Segoe UI Semibold only.695. **Set wildcard container defaults** (`visualStyles["*"]["*"]`): title, background off, border off, dropShadow off, padding.706. **Add visual-type overrides** — READ `references/visual-type-overrides.md`. At minimum: `textbox` and `image` to suppress container chrome.717. **Validate** — READ `references/theme-validation-checklist.md` and apply all checks.728. **Place file** at `StaticResources/SharedResources/BaseThemes/<ThemeName>.json`.739. **Update `report.json`** to reference the theme.7475### B) Modify an Existing Theme76771. **READ** the existing theme file to understand current structure.782. **Identify the change scope**: colors, typography, wildcard, visual-type overrides.793. **Apply changes** following the structure from `references/theme-json-structure.md`.804. **Validate** with `references/theme-validation-checklist.md`.8182### B.1) Theme-First Workflow for Mockup-Driven Reports8384When a visual mockup is available, prefer a theme-first approach before detailed PBIR layout work.85861. Extract design tokens from the mockup: page background, card surfaces, accent colors, sentiment colors, typography hierarchy, spacing rhythm, and container treatment.872. Encode reusable tokens in the theme JSON first instead of scattering them across visuals.883. Reserve visual-level overrides for true one-offs, SVG content, Deneb specifics, or conditional formatting.894. Align `good`, `bad`, and `neutral` with the mockup's semantic cues when possible.905. Document any mockup styling that cannot be expressed in the theme and must remain a visual-level approximation.9192This reduces drift between design intent and implementation and improves consistency when a mockup must be translated into a Power BI-feasible visual language.9394### C) Promote Visual Overrides to Theme9596When visuals have accumulated bespoke formatting that should become defaults:97981. **Audit**: Identify which visuals have `objects` or `visualContainerObjects` overrides.992. **Classify** each override:100 - **Stale**: Duplicates theme value → remove from visual101 - **Conflicting**: Different from theme → promote to theme or document as exception102 - **Conditional formatting**: Expression-based → never promote, keep in visual1033. **Decide placement**: Wildcard (`["*"]["*"]`) for universal, visual-type (`["<type>"]["*"]`) for type-specific.1044. **Write** the value into the theme JSON.1055. **Remove** the override from the visual.1066. **Verify** the visual still renders correctly.107108### D) Audit Theme Compliance1091101. **Establish baseline**: Read theme wildcard and type-level sections.1112. **Scan visuals**: Find all `visual.json` files with `objects` or `visualContainerObjects`.1123. **Compare**: For each override, check if it matches or conflicts with the theme.1134. **Report findings** using severity levels:114 - **Critical**: Chrome overrides contradicting theme across multiple visuals115 - **Warning**: Individual property differences from theme defaults116 - **Suggestion**: Empty/null override keys, redundant values117118## Anti-Hallucination Rules1191201. **Never invent theme property names** — verify against the theme JSON schema or the `references/visual-type-overrides.md` index.1212. **Color format matters**: `textClasses` uses plain hex strings (`"color": "#343a40"`); `visualStyles` uses object wrappers (`{"solid": {"color": "#343a40"}}`). Mixing them causes silent failures.1223. **Supported fonts only**: Segoe UI, Segoe UI Semibold, Segoe UI Light, Segoe UI Bold, Arial, Calibri, Candara, Consolas, Courier New, DIN, Georgia, Tahoma, Times New Roman, Trebuchet MS, Verdana. No custom fonts.1234. **Semantic colors are root-level keys** (`"good": "#2f9e44"`), NOT nested under a `sentimentColors` object.1245. **Array wrapper required**: All `visualStyles` container values must be wrapped in `[{...}]`.125126## Schema and Documentation127128| Resource | URL |129|---|---|130| Theme JSON Schema (versioned, Draft 7) | https://github.com/microsoft/powerbi-desktop-samples/tree/main/Report%20Theme%20JSON%20Schema |131| Microsoft Learn — Report Themes | https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes |132| Community theme templates | https://github.com/deldersveld/PowerBI-ThemeTemplates |