Skip to content

Commit 723493f

Browse files
feat(ui5-navigation-layout): adjust shellbar padding when side navigation is present (#12175)
* feat(ui5-navigation-layout): update header paddings according to the specification
1 parent f133a70 commit 723493f

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

packages/fiori/src/NavigationLayout.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ class NavigationLayout extends UI5Element {
7272
@property({ type: Boolean })
7373
sideCollapsed : boolean = this._defaultSideCollapsed;
7474

75+
/**
76+
* @private
77+
*/
78+
@property({ type: Boolean })
79+
hasSideNavigation = false;
80+
7581
/**
7682
* @private
7783
*/
@@ -122,6 +128,7 @@ class NavigationLayout extends UI5Element {
122128
}
123129

124130
const sideNavigation = this.sideContent[0];
131+
this.hasSideNavigation = !!sideNavigation;
125132

126133
if (sideNavigation) {
127134
sideNavigation.collapsed = this.isSideCollapsed();

packages/fiori/src/SideNavigation.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ type PopupSideNavigationItem = SideNavigationItem & { associatedItem: SideNaviga
7575
* The items can consist of text only or an icon with text. The use or non-use of icons must be consistent for all items on one level.
7676
* You must not combine entries with and without icons on the same level. We strongly recommend that you do not use icons on the second level.
7777
*
78-
* The `ui5-side-navigation` component is intended for use within an `ui5-navigation-layout` component.
79-
* While it can function independently, it is recommended to use it with
80-
* the `ui5-navigation-layout` for optimal user experience.
78+
* The `ui5-side-navigation` component is designed to be used within a `ui5-navigation-layout1 component to ensure an optimal user experience.
79+
*
80+
* Using it standalone may not match the intended design and functionality.
81+
* For example, the side navigation may not exhibit the correct behavior on phones and tablets.
82+
* Padding of the `ui5-shellbar` will not match the padding of the side navigation.
8183
*
8284
* ### Keyboard Handling
8385
*

packages/fiori/src/themes/NavigationLayout.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@
5959
transform: translateX(100%);
6060
}
6161

62-
::slotted([ui5-shellbar][slot="header"]) {
63-
padding-inline: .5rem;
62+
:host([has-side-navigation]) ::slotted([ui5-shellbar][slot="header"]) {
63+
padding-inline: 0.875rem 1rem;
6464
}

0 commit comments

Comments
 (0)