docs

Theming

OpenUI5 is an HTML library, therefore styling is done using Cascading Style Sheets (CSS). This allows for creating an impressive visual experience using a widely known standard technology which is well-accepted on the market.

OpenUI5 supports you when creating and using different visual designs - called themes - that can be used alternatively and switched on the fly. This way, the same application can look very different, depending on the user’s design preference or accessibility requirements.


Theming Approach

OpenUI5 offers a modern theming approach with the following key features:

Note:

Variables, mixins, and other LESS features have been deprecated as of version 1.127.0 in favor of CSS custom properties.


Core Concepts


Themes, Libraries, and CSS Artifacts


Default Behavior


CSS Custom Property Integration

Theme parameters are accessible as CSS custom properties:


Overview of Theming Capabilities

OpenUI5 provides comprehensive theming capabilities using multiple approaches:


The modern approach uses CSS custom properties for a theme-aware styling:

.myComponent {
  background-color: var(--sapButton_Background);
  border-color: var(--sapButton_BorderColor);
  color: var(--sapButton_TextColor);
}

Runtime Parameter Access

For dynamic theming scenarios, the Parameters API provides JavaScript access to theme values. For more information, see Enhanced Theming Concepts.


Theme Discovery

To explore available custom CSS properties and their current values, use the Theme Parameter Toolbox.


Creating Custom Themes

You can create custom themes using several approaches, depending on your requirements and technical expertise.


Theme from Scratch

You can create a completely new theme by writing CSS files if you meet the following requirements:


Best Practices


Dos Yes


Don’ts No


Next Steps

For detailed implementation guidance, see the specialized topics below this topic.

Related Information

Available Themes

Supported Combinations of Themes and Libraries