Commit f6ae2b5
feat(theming): add OS-adaptive auto themes (sap_horizon_auto, sap_horizon_hc_auto) (#13300)
* feat(theming): add sap_horizon_auto and sap_fiori_3_auto OS-adaptive themes
Add auto-switching themes that adapt to the user's OS light/dark preference
using CSS light-dark() for color values and space toggles for non-color values.
At build time, the light and dark theme CSS outputs are merged into a single
stylesheet. Color variables use the native CSS light-dark() function (Chrome 123+,
Firefox 120+, Safari 17.5+). Non-color variables use the space toggle pattern
with guaranteed-invalid custom properties, the same approach already used for
cozy/compact density switching.
The auto theme is self-contained: switching away from it removes the toggles.
No runtime code changes needed — it is purely CSS-driven.
Usage:
- URL: ?sap-ui-theme=sap_horizon_auto
- JS: setTheme("sap_horizon_auto")
- Config: <script data-ui5-config>{"theme":"sap_horizon_auto"}</script>
* feat(theming): add sap_horizon_hc_auto and sap_fiori_3_hc_auto OS-adaptive themes
Merge HCW (light) and HCB (dark) high contrast themes using the same
light-dark() and space toggle mechanism as the existing auto themes,
enabling automatic switching based on OS prefers-color-scheme.
* refactor(theming): remove fiori_3 auto themes, keep horizon only
Remove sap_fiori_3_auto and sap_fiori_3_hc_auto to reduce scope.
Only sap_horizon_auto and sap_horizon_hc_auto are generated.
---------
Co-authored-by: Petar Skelin <petar.skelin@sap.com>1 parent 5fe24d1 commit f6ae2b5
File tree
13 files changed
+281
-14
lines changed- packages
- ai/src/themes
- sap_horizon_auto
- sap_horizon_hc_auto
- compat/src/themes
- sap_horizon_auto
- sap_horizon_hc_auto
- fiori/src/themes
- sap_horizon_auto
- sap_horizon_hc_auto
- main/src/themes
- sap_horizon_auto
- sap_horizon_hc_auto
- theming/src/themes
- sap_horizon_auto
- sap_horizon_hc_auto
- tools
- lib/css-processors
13 files changed
+281
-14
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments