Skip to content

Commit 52fc728

Browse files
chore: change implementation to reflect resizing
1 parent 6c50e97 commit 52fc728

4 files changed

Lines changed: 28 additions & 30 deletions

File tree

packages/fiori/src/NavigationLayout.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ class NavigationLayout extends UI5Element {
7171
@property({ type: Boolean })
7272
hasSideNavigation = false;
7373

74-
/**
75-
* @private
76-
*/
77-
@property({ type: Boolean })
78-
isLayoutS = window.innerWidth < 600;
79-
8074
/**
8175
* Gets whether the side navigation is collapsed.
8276
* @public
@@ -110,7 +104,7 @@ class NavigationLayout extends UI5Element {
110104
onBeforeRendering() {
111105
this.calcSideCollapsed();
112106

113-
if (this.isLayoutS) {
107+
if (window.innerWidth < 600) {
114108
return;
115109
}
116110

packages/fiori/src/SideNavigation.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,6 @@ class SideNavigation extends UI5Element {
186186
@property({ type: Object })
187187
_menuPopoverItems: Array<SideNavigationItem> = [];
188188

189-
/**
190-
* Defines if the component is rendered on a mobile device.
191-
* @private
192-
*/
193-
@property({ type: Boolean })
194-
isLayoutS = window.innerWidth < 600;
195-
196189
_isOverflow = false;
197190
_flexibleItemNavigation: ItemNavigation;
198191
_fixedItemNavigation: ItemNavigation;

packages/fiori/src/themes/NavigationLayout.css

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,39 @@
3232
z-index: 2;
3333
}
3434

35-
:host([is-layout-s]) .ui5-nl-aside {
36-
position: absolute;
37-
top: 0;
38-
left: 0;
39-
bottom: 0;
40-
width: 100%;
35+
@media (width < 600px) {
36+
:host .ui5-nl-aside {
37+
position: absolute;
38+
top: 0;
39+
left: 0;
40+
bottom: 0;
41+
width: 100%;
42+
}
4143
}
4244

43-
:host([is-layout-s]) ::slotted([ui5-side-navigation][slot="sideContent"]) {
44-
width: 100%;
45-
box-shadow: none;
45+
@media (width < 600px) {
46+
:host ::slotted([ui5-side-navigation][slot="sideContent"]) {
47+
width: 100%;
48+
box-shadow: none;
49+
}
4650
}
4751

4852
.ui5-nl-content {
4953
flex: 1;
5054
min-width: 0;
5155
overflow: auto;
5256
}
53-
54-
:host([side-collapsed][is-layout-s]) .ui5-nl-aside {
55-
transform: translateX(-100%);
57+
@media (width < 600px) {
58+
:host([side-collapsed]) .ui5-nl-aside {
59+
transform: translateX(-100%);
60+
}
5661
}
5762

58-
:host([side-collapsed][is-layout-s]) :dir(rtl) .ui5-nl-aside {
59-
transform: translateX(100%);
63+
@media (width < 600px) {
64+
:host([side-collapsed]) :dir(rtl) .ui5-nl-aside {
65+
transform: translateX(100%);
66+
}
67+
6068
}
6169

6270
:host([has-side-navigation]) ::slotted([ui5-shellbar][slot="header"]) {

packages/fiori/src/themes/SideNavigation.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
width: var(--_ui5_side_navigation_collapsed_width);
2121
}
2222

23-
:host([is-layout-s]) {
24-
width: 100%;
23+
@media (width < 600px) {
24+
:host(:not([hidden])) {
25+
width: 100%;
26+
}
2527
}
2628

29+
2730
.ui5-sn-root {
2831
height: 100%;
2932
display: flex;

0 commit comments

Comments
 (0)