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.
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.
Each OpenUI5 library (such as sap.ui.core, sap.m) provides a library.css file per theme.
Themes can provide a custom.css with customer overrides.
OpenUI5 computes and requests the correct files based on the active theme, libraries used, and configuration.
If no theme is specified by any of the available configuration mechanisms, OpenUI5 automatically applies a default theme.
The default theme depends on the OpenUI5 version and is currently one of the themes of the Horizon theme family, for example, sap_horizon, depending on which flavor is selected in the Demo Kit.
If no theme has been specified, OpenUI5 also considers the system’s light or dark mode settings and automatically applies the corresponding theme flavor. For example, if the user’s system preference is dark mode, and no theme has been specified, OpenUI5 automatically applies sap_horizon_dark.
Theme parameters are accessible as CSS custom properties:
--sapButton_BackgroundOpenUI5 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);
}
JavaScript required for basic themingFor dynamic theming scenarios, the Parameters API provides JavaScript access to theme values. For more information, see Enhanced Theming Concepts.
To explore available custom CSS properties and their current values, use the Theme Parameter Toolbox.
You can create custom themes using several approaches, depending on your requirements and technical expertise.
You can create a completely new theme by writing CSS files if you meet the following requirements:
library.css files for each OpenUI5 library you want to supportthemes/[theme-name]/[library]/library.css

For detailed implementation guidance, see the specialized topics below this topic.
theme configuration parameter or the sap/ui/core/Theming.setTheme method.Related Information