Skip to content

Commit a59a9d6

Browse files
committed
Added style for expandable-admin-sidebar-section to sidebar-sub-level-item-list's childs
1 parent a80fc16 commit a59a9d6

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="sidebar-collapsible-element-outer-wrapper">
3535
<div class="sidebar-collapsible-element-inner-wrapper">
3636
<div class="sidebar-sub-level-item-list" role="menu" [id]="adminMenuSectionId(section.id)" [attr.aria-label]="('menu.section.' + section.id) | translate">
37-
<div *ngFor="let subSection of (subSections$ | async)">
37+
<div class="sidebar-item" *ngFor="let subSection of (subSections$ | async)">
3838
{{ (sectionMap$ | async).get(subSection.id).component | json}}
3939
<ng-container
4040
*ngComponentOutlet="(sectionMap$ | async).get(subSection.id).component; injector: (sectionMap$ | async).get(subSection.id).injector;"></ng-container>

src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.scss

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,30 @@
33
list-style: none;
44
margin: 0;
55
padding: 0;
6-
::ng-deep .ds-menu-item {
7-
padding-left: var(--ds-admin-sidebar-section-indent);
6+
/* Make the entire sub-level row clickable by applying padding to the anchor */
7+
::ng-deep {
8+
/* Ensure anchors are full-width blocks */
9+
.ds-menu-item {
10+
display: block;
11+
width: 100%;
12+
padding-left: var(--ds-admin-sidebar-section-indent);
13+
}
14+
15+
/* Remove vertical padding from the wrapper and apply it to the anchor */
16+
.sidebar-item {
17+
padding-top: 0 !important;
18+
padding-bottom: 0 !important;
19+
}
20+
.sidebar-item .ds-menu-item {
21+
padding-top: var(--ds-admin-sidebar-item-padding);
22+
padding-bottom: var(--ds-admin-sidebar-item-padding);
23+
}
24+
25+
/* In case an anchor also has .sidebar-item, reset it to avoid double padding */
26+
.ds-menu-item.sidebar-item {
27+
padding-top: 0 !important;
28+
padding-bottom: 0 !important;
29+
}
830
}
931
}
1032

src/app/shared/menu/menu-item/onclick-menu-item.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<a *ngIf="!item.disabled"
2-
class="ds-menu-item sidebar-item" role="menuitem"
2+
class="ds-menu-item" role="menuitem"
33
routerLinkActive="active"
44
href="javascript:void(0);"
55
[title]="item.text | translate"
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.ds-menu-item {
1+
a {
22
cursor: pointer;
3-
display: block;
4-
width: 100%;
53
}

0 commit comments

Comments
 (0)