From f6682b2d076df747e74058b0b156b3cf0627952d Mon Sep 17 00:00:00 2001 From: Stoyan <88034608+hinzzx@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:22:08 +0200 Subject: [PATCH] fix(ui5-menu): prevent global line-height inheritance (#10916) Previously setting a `line-height` property on global level e.g `body { line-height: 0.5rem }` was being inherited by the `ui5-menu` and its `ui5-menu-item`'s which was not convenient. With this chnange we now prevent the global inheritance of the `line-height` with the following priority: `ui5-menu-item` > `ui5-menu` > `global (globally no longer takes effect)`, which means if a `line-height` is set to the `ui5-menu`, all of its children (ui5-menu-items) would receive the effect, but if a specific `ui5-menu-item` receives the property, it would take over. For example, here all children, except the first one (which has explicitly set `style="line-height: 0.5rem;"`) would have `line-height` of `1rem` ```ts ``` --- packages/main/src/themes/Menu.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/main/src/themes/Menu.css b/packages/main/src/themes/Menu.css index a7f7b45dd02d..d29803296ac8 100644 --- a/packages/main/src/themes/Menu.css +++ b/packages/main/src/themes/Menu.css @@ -1,3 +1,10 @@ +:host { + line-height: initial; +} + +::slotted([ui5-menu-item]) { + line-height: inherit; + } .ui5-menu-rp[ui5-responsive-popover]::part(header), .ui5-menu-rp[ui5-responsive-popover]::part(content),