Skip to content

Commit 076f910

Browse files
fix(ui5-side-navigation): update CSS styles (#11208)
- collapse/expand icon has spacings according to the visual design - touch (click) area of the collapse/expand is correct now (before it was with smaller height than the item) fixes: #11171
1 parent ab9ba5c commit 076f910

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

packages/fiori/src/themes/SideNavigationItemBase.css

+31-8
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,40 @@ and there is an additional border that appears on hover. */
198198
}
199199

200200
:host(:not([side-nav-collapsed])) .ui5-sn-item-toggle-icon {
201-
min-width: var(--_ui5_side_navigation_expand_icon_width);
202-
padding-inline: 0.25rem 0.375rem;
203-
padding-block: 0.25rem; /* height of the separator (the border left) should be --sapElement_Condensed_Heightwhich is equal to 1.375rem (22px) */
204-
border-inline-start: 0.0625rem solid var(--sapTextColor);
201+
width: var(--_ui5_side_navigation_expand_icon_width);
202+
padding-inline-end: 0.375rem;
203+
padding-block: var(--_ui5_side_navigation_item_expand_arrow_padding);
204+
margin-inline-start: 0.5rem;
205+
height: var(--sapElement_Condensed_Height);
206+
}
207+
208+
/* this is for the group item*/
209+
:host(:not([unselectable], [side-nav-collapsed])) .ui5-sn-item-toggle-icon {
210+
width: calc(var(--_ui5_side_navigation_expand_icon_width) + 4px); /*width of the icon + 4px padding*/
211+
}
212+
213+
/* this is for the two-click item */
214+
:host(:not([unselectable], [side-nav-collapsed], [ui5-side-navigation-group])) .ui5-sn-item-toggle-icon {
205215
margin-inline-start: 1rem;
216+
width: calc(var(--_ui5_side_navigation_expand_icon_width) + 5px); /*width of the icon + 1px separator + 4px padding*/
206217
}
207218

208-
:host([unselectable]:not([side-nav-collapsed])) .ui5-sn-item-toggle-icon,
209-
:host(:not([side-nav-collapsed])) .ui5-sn-item-group .ui5-sn-item-toggle-icon,
210-
:host([side-nav-collapsed]) .ui5-sn-item:not(.ui5-sn-item-active):not(.ui5-sn-item-no-hover-effect):hover .ui5-sn-item-toggle-icon,
211-
:host([side-nav-collapsed]) .ui5-sn-item:not(.ui5-sn-item-active):not(.ui5-sn-item-no-hover-effect):focus .ui5-sn-item-toggle-icon {
219+
:host(:not([side-nav-collapsed])) .ui5-sn-item-toggle-icon::part(root) {
220+
padding-block: 0.25rem; /* height of the separator (the border left) should be --sapElement_Condensed_Height which is equal to 1.375rem (22px) */
221+
border-inline-start: 0.0625rem solid var(--sapTextColor);
222+
display: block;
223+
height: 0.875rem;
224+
width: var(--_ui5_side_navigation_expand_icon_width);
225+
}
226+
227+
:host(:not([unselectable], [side-nav-collapsed])) .ui5-sn-item-toggle-icon::part(root) {
228+
padding-inline-start: 0.25rem;
229+
}
230+
231+
:host([unselectable]:not([side-nav-collapsed])) .ui5-sn-item-toggle-icon::part(root),
232+
:host(:not([side-nav-collapsed])) .ui5-sn-item-group .ui5-sn-item-toggle-icon::part(root),
233+
:host([unselectable][side-nav-collapsed]) .ui5-sn-item:not(.ui5-sn-item-active):not(.ui5-sn-item-no-hover-effect):hover .ui5-sn-item-toggle-icon,
234+
:host([unselectable][side-nav-collapsed]) .ui5-sn-item:not(.ui5-sn-item-active):not(.ui5-sn-item-no-hover-effect):focus .ui5-sn-item-toggle-icon {
212235
border-inline-start: none;
213236
}
214237

packages/fiori/src/themes/base/SideNavigation-parameters.css

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
--_ui5_side_navigation_item_border_style_color: none;
2525
--_ui5_side_navigation_item_border_width: 0;
2626
--_ui5_side_navigation_item_height: 2.75rem;
27+
--_ui5_side_navigation_item_expand_arrow_padding: 0.6875rem;
2728
--_ui5_side_navigation_last_item_border_style_color: none;
2829
--_ui5_side_navigation_item_border_radius: 0;
2930
--_ui5_side_navigation_item_bottom_margin: 0;
@@ -75,6 +76,7 @@
7576
.sapUiSizeCompact {
7677
--_ui5_side_navigation_navigation_separator_margin: var(--_ui5_side_navigation_navigation_separator_margin_collapsed);
7778
--_ui5_side_navigation_item_height: 2rem;
79+
--_ui5_side_navigation_item_expand_arrow_padding: 0.3125rem;
7880
}
7981

8082
[dir="rtl"] {

0 commit comments

Comments
 (0)