ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

[DynamicPage | Theming]: The action button icon color of the dynamic page cannot be overridden

Open hirakshetry opened this issue 1 month ago • 6 comments

Bug Description

We overridden the button theme at the root level, which causes the theme to apply partially to the dynamic header actions—specifically, the button text color is affected. Our goal is to style only the dynamic header action buttons, but this isn’t possible because UI5 web component uses private CSS variables (e.g., --_ui5-v2-11-0_dynamic_page_header-actions-background and --_ui5-v2-11-0_dynamic_page_header-actions-color). Since these variables are private and not intended for theming, creating a custom theme for dynamic page header actions is not feasible.

:root {
 --sapButton_Background:red;
 --sapButton_TextColor: white;
 --sapButton_Lite_TextColor: red;
 --sapLinkColor:green;
}

replicate steps: https://ui5.github.io/webcomponents/play/#eNrtXFlTIzkS_isazwt0IB8cDZgjlnN7YultYqB7d2Po6JCrZJcalVSjkk2zHfz3zZSqXPIFBpaXiQoI48rKW6n8xEPqZ0OomP9oJjaVje7PhmIpb3RD4loj0spyZYG8_wulJJPsfmD0UMW0r2VMKD28Ufu_nH46uf7P5RlBISTgXyKZGhzcNLi6aQCt_NlPOIvhmcDvfm7vJceHd12l7Uo35n2heLxKfgItFjma6xKlFd8DwgPKOxvufV-biMc00lIbyuLvw9xO8JL9Vqn_L29uP-WWkShhJucWkv75-pzuuLwXr3BtgT4S_C7Txt40SLGyQLwTsU0OYj4SEafuYY0IJaxgkuYRk_yg02wXyqywYPOKpZnk-y3_hHQp1C0xXII651aecI5WEsP7QGu2UiZUM8pzp2e_VVQBfO3p-J44GeBLuBgkEOh2u5392CM9Ft0W5eYS0SUjZlYozVl2PH51gm9WC__mFCnlqihUZBiKLRrfQzpERDM24ETEYBe_gbd5ou9ARltuFrBTFzLJpcbMuYcjw1lhHbl78BhHZpj28pItIM1npMLytMzVr8DzkUGO5jEtJX2VaJ6_Qv73oVJCDchTeqbfBDmbSBMuNuhDzzIeQVmR0IJXU5YSKojFqBTNFcsyHn8oNZBIsjyvXng5WlkoHWAjZpmBFWUZFlb-55AZX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Z1mGdh0kVzqHE7RIz5RLKVTIuLLa5qjobrNwanJ8MiuBlAqzR1QQtrw0wnLYOKWgkUSVZ3Nvf5j_lowCUdvd2lJDsmHJsENkjMXPS6I4ZJhHrzyBarD-vIRjeVZL4cl9Q0DEGu8HR7T5EhfqwzPbPBPve9QMP7g980dbr49sefnSEy2gSCjG531rTCpc9vQHIVXPqKJBoVbnkIrN32p77oE9oTIcpG7goV9VBRse29RF2g8PPwPKwQTGQ

Affected Component

No response

Expected Behaviour

No response

Isolated Example

No response

Steps to Reproduce

...

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

2.16.2

Browser

Chrome

Operating System

all

Additional Context

Image

Organization

SuccessFactors

Declaration

  • [x] I’m not disclosing any internal or sensitive information.

hirakshetry avatar Nov 26 '25 03:11 hirakshetry

Hi @hirakshetry, thanks for your feedback!

UI5 Web Components use global theme variables, so changing one of these variables (for example a button background or text color) will also affect all components that rely on the same variable. This is expected, because the theming system is designed to ensure visual consistency across the whole application.

If you want to style only a specific element—for example buttons inside a Toolbar—without impacting other controls, the recommended approach is to use the component-specific styling: ui5-toolbar { --sapButton_TextColor: blue; }

Your example

Vonahz avatar Nov 26 '25 07:11 Vonahz

This issue has been closed. To reopen, just leave a comment!

github-actions[bot] avatar Nov 26 '25 07:11 github-actions[bot]

I want to change the button color used in the dynamic page header actions, as shown below. How can I modify the button color in that area?

Image

hirakshetry avatar Nov 26 '25 13:11 hirakshetry

After reviewing the behavior, I don’t believe this is a bug but rather a limitation of the current design. The dynamic header action buttons aren’t built to support this functionality yet. I am forwarding to @UI5/ui5-team-ctr-pir. From my point of view, this fits better as a feature request, since it would require new functionality rather than a fix to existing logic.

Regards, Milen

Vonahz avatar Nov 27 '25 09:11 Vonahz

Hello @hirakshetry,

Since the ui5-dynamic-page component has been implemented according to the current design specification, which does not define dedicated theming parameters for the toolbar action buttons, your request to have separate CSS variables for styling these buttons is considered a specification enhancement request.

The toolbar action buttons (the "Create", "Edit", "Paste" buttons in your example) have no dedicated theming parameters and rely on global button variables (--sapButton_Background, --sapButton_TextColor), which affect all buttons throughout the application.

Based on the design requirements, this request will need to go through the design team review process to add public theming parameters specifically for the DynamicPage header action buttons. Could you please create a Jira ticket for Central Design and include the reference here in this issue?

Thanks and Regards, Nikola

NakataCode avatar Nov 28 '25 11:11 NakataCode

Hi @NakataCode

Issue: Dynamic Page Action Button Icon Visibility Problem with Custom Theme

When applying custom theme variables at the root level (e.g., --sapButton_Background: red and --sapButton_TextColor: white), most buttons display correctly with a red background and white text. However, the Dynamic Page action button icon becomes invisible (while background and white text color).

Root Cause: The Dynamic Page action button uses a different background variable:

background-color: var(--_ui5-v2-17-0-rc-5_dynamic_page_header-actions-background); This internal variable is mapped to:

--_ui5-v2-17-0-rc-5_dynamic_page_header-actions-background: var(--sapObjectHeader_Background); Problem: The action button text color incorrectly inherits from --sapButton_TextColor, but since its background comes from --sapObjectHeader_Background instead of --sapButton_Background, there's a mismatch. This creates contrast issues where the icon/text may become invisible depending on the custom theme values.

Expected Behavior: The Dynamic Page action button should either:

Use consistent button-specific variables for both background and text color, or Use consistent object header variables for both properties This inconsistency causes problems when implementing customer themes.

hkshetry avatar Dec 11 '25 16:12 hkshetry

Hi @hkshetry,

Thank you for the detailed analysis of the root cause.

After reviewing the DynamicPage specification and the Button specification it references, I've identified the following:

The DynamicPage spec defines: Button type: Secondary Background: --sapObjectHeader_Background (explicitly overridden from the standard Secondary button background) Border: 1px solid --sapButton_BorderColor

The Button spec defines for Secondary buttons: Background: --sapButton_Background Text & Icon: --sapButton_TextColor

The issue: The DynamicPage specification overrides the background from the standard Secondary button to use --sapObjectHeader_Background, but it does not specify what should happen to the text/icon color in this case. This creates ambiguity - should the text/icon color still follow the Secondary button specification (--sapButton_TextColor), or should it be adjusted to match the ObjectHeader theming context?

This is why the Central Design team needs to clarify the specification. They need to define which color parameter should be used for the icon/text when the background is set to --sapObjectHeader_Background.

Could you please create a Jira ticket for Central Design and reference this GitHub issue?

Thanks and regards, Nikola

NakataCode avatar Dec 19 '25 10:12 NakataCode