Semantic color mapping that makes themes intelligent and adaptable.
Design tokens are the secret to creating themes that are both powerful and maintainable. Instead of hard-coding specific colors throughout your theme, tokens create a semantic layer that describes the purpose of each color. This abstraction might seem like extra complexity at first, but it's what enables professional-grade themes that can adapt to different contexts without manual updates.
Think of tokens as meaningful names for design decisions. Rather than saying "make this border #E5E5E5," you say "make this border use border-color." The token system then determines what border-color means in different contexts—it might be gray-200 in light mode, gray-700 in dark mode, or even adapt based on the visual type or emphasis level. This semantic approach is why you can switch between radically different visual styles with a single click.
Power UI's token system goes beyond simple color mapping. It understands the relationships between different UI elements and ensures they work harmoniously together. When you change your neutral palette from cool gray to warm gray, every token that references those shades updates automatically while maintaining proper contrast ratios and visual hierarchy. This systematic approach eliminates the tedious work of manually updating hundreds of color properties across dozens of visual types.
Power BI themes contain hundreds of color properties spread across different visual types. Without tokens, maintaining consistency is nearly impossible. Imagine manually ensuring that every border across tables, charts, cards, and slicers uses the exact same shade of gray. With tokens, you define "border-color" once, and it's automatically applied everywhere borders appear. Change the token definition, and every border updates instantly.
Light and dark modes aren't just about inverting colors—they require thoughtful adjustments to maintain readability and visual hierarchy. Tokens make this possible by mapping to different color values based on the active mode. A token like "text-primary" might map to gray-900 in light mode for dark text on light backgrounds, but switch to gray-100 in dark mode for light text on dark backgrounds. This intelligent mapping ensures your reports look professional in any lighting condition.
Organizations often need themes for different contexts—executive dashboards might use sophisticated blue-grays, while customer-facing reports use warmer, friendlier tones. With tokens, you can create these variations by simply swapping the underlying palettes. The semantic structure remains the same, ensuring that primary buttons, headers, and key metrics maintain their visual importance regardless of the color scheme.
As Power BI evolves and adds new visual types or properties, a token-based theme can adapt without starting from scratch. New properties can reference existing tokens, automatically inheriting your design decisions. This forward compatibility means your investment in theme design continues to pay dividends as the platform grows.
Token: border-color
Palette Color
gray-300
Applied To
Light Mode
background
text-primary
border-color
Dark Mode
background
text-primary
border-color
When you change your base palette...
Cool Gray
Warm Gray
All tokens automatically update...
surface-1
border-subtle
text-secondary
Power UI organizes tokens into logical categories that map to how designers think about visual hierarchy. Understanding these categories helps you customize themes effectively and create your own token mappings when needed.
Define the layering system for backgrounds and cards
surface-canvas
surface-1
surface-2
surface-3
Establish clear content hierarchy through text colors
text-primary
Primary content and headerstext-secondary
Supporting content and labelstext-tertiary
Subtle hints and metadatatext-disabled
Inactive or unavailable contentProvide consistent feedback for user interactions
Standard States
hover-overlay
- Subtle hover indicationactive-overlay
- Pressed/active stateselected-border
- Selection emphasisFocus States
focus-ring
- Keyboard focus indicatorfocus-background
- Focused item backgroundThe token system is what makes instant mode switching possible. Each token knows how to adapt its color value based on the current mode, ensuring your reports maintain readability and visual hierarchy whether viewed in a bright office or on a dashboard in a dimly lit operations center.
Toggle Theme Mode
Click the theme mode toggle in the Foundation panel
Tokens Recalculate
Each token updates its color value based on the new mode
Theme Updates Globally
All visuals instantly reflect the new color mappings
Important: The exported Power BI theme file will contain the color values for the currently active mode. Power BI itself doesn't support dynamic mode switching—you'll need to export separate theme files for light and dark modes if you need both.
While Power UI provides intelligent default token mappings, you have full control to customize how tokens map to colors. This flexibility lets you create unique visual treatments while maintaining the benefits of the token system.
The power of tokens comes from their semantic meaning. When customizing token mappings, maintain the intended purpose—don't map text-primary to a light color just because you prefer it. Instead, adjust your palette or create new tokens that better express your design intent while preserving the logical structure.
Tokens affect multiple visual types and properties. When adjusting a token mapping, preview your changes across different visuals—tables, charts, cards, and slicers. What works beautifully for one visual type might create problems in another. The preview panel is your best friend for catching these issues early.
If you create custom tokens or significantly modify default mappings, document these changes. Future theme maintainers (including yourself) will appreciate understanding why certain tokens map to unexpected colors. This documentation is especially important for team environments where multiple people might work with the theme.
Learn how to configure fonts and text styling to complete your professional theme.
Continue to Typography →