Skip to content

Commit f6ae2b5

Browse files
ilhan007pskelin
andauthored
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

13 files changed

+281
-14
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon (light) and sap_horizon_dark */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon_hcw (light) and sap_horizon_hcb (dark) */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon_hcw/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon (light) and sap_horizon_dark */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon_hcw (light) and sap_horizon_hcb (dark) */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon_hcw/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon (light) and sap_horizon_dark */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon_hcw (light) and sap_horizon_hcb (dark) */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon_hcw/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon (light) and sap_horizon_dark */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon_hcw (light) and sap_horizon_hcb (dark) */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon_hcw/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon (light) and sap_horizon_dark */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon/parameters-bundle.css";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Auto-generated at build time by merging sap_horizon_hcw (light) and sap_horizon_hcb (dark) */
2+
/* This placeholder enables directory detection by the theme loader generator */
3+
@import "../sap_horizon_hcw/parameters-bundle.css";

0 commit comments

Comments
 (0)