SPFX Pretty

Home › How to fix › Branding

BRD002Needs you

Theme changes not handled

Why it matters

The web part opts in to section backgrounds but never reads the theme, so colours stay fixed.

How to fix

  1. Override onThemeChanged() and push semanticColors into CSS variables.
  2. Run "SPFX Pretty: Show Theme-Aware Web Part Snippet" for code tailored to your web part.
In VS Code: right-click the finding → Explain & How to Fix, or use ▶ Fix step by step in the report.