UNPKG

4.78 kBtext/lessView Raw
1@import 'aui-sidebar-config.less';
2
3//
4// Imported by aui-sidebar.
5//
6// Implements the navigation pattern overrides for vertical navigation
7// so that it works both inside the sidebar panel itself as well as in the inline-dialogs
8// shown when the sidebar is contracted.
9//
10
11.aui-sidebar,
12.aui-sidebar-submenu {
13
14 //
15 // Nav pattern integration
16 //
17
18 .aui-navgroup .aui-sidebar-button {
19 margin-bottom: @aui-sidebar-grid;
20 margin-left: 3px;
21
22 > .aui-icon {
23 margin-right: 3px;
24 }
25 }
26
27 .aui-nav-item-label {
28 #aui.text-truncate();
29 display: block;
30 word-wrap: normal;
31 }
32
33 .aui-navgroup-vertical .aui-nav {
34 > li {
35 > .aui-nav-item {
36 #aui-nav.item-base(@aui-sidebar-nav-link-expected-height);
37 padding-left: @aui-sidebar-nav-link-inner-spacing;
38 padding-right: (@aui-icon-size-small + @aui-sidebar-nav-link-inner-spacing ); // room on the right for dropdown action menus
39 }
40 }
41
42 // Actions
43 .aui-nav-item-actions {
44 @actions-button-size: @aui-icon-size-small;
45 top: ((@aui-sidebar-nav-link-expected-height - @actions-button-size) / 2);
46 height: @actions-button-size;
47 width: @actions-button-size;
48 }
49
50 // Nested navigation
51 .aui-nav {
52 .aui-nav-item-actions {
53 margin-right: 0;
54 }
55 }
56 }
57
58 .aui-navgroup-vertical .aui-nav .aui-nav-selected > .aui-nav-item {
59 #aui-nav.item-style(selected);
60 }
61
62 .aui-nav {
63 > li {
64 position: relative;
65
66 > .aui-nav-item {
67 #aui.text-truncate();
68
69 > .aui-icon {
70 --aui-icon-size: @aui-sidebar-icon-size;
71 color: @aui-sidebar-icon-color;
72 margin-right: @aui-sidebar-nav-link-icon-spacing;
73 float: left;
74
75 &.aui-icon-small::before {
76 // This shrinks the icon inside the bounding box of the icon.
77 // The base icon styles' display:flex assures this is perfectly centred.
78 --aui-icon-size: @aui-icon-size-small;
79 }
80 }
81 }
82 }
83 }
84
85 // twixi for nested navigation
86 .aui-navgroup-vertical .aui-nav > li[aria-expanded] {
87 > .aui-nav-subtree-toggle {
88 @box-size: @aui-sidebar-nav-link-expected-height; // that assumption in aui-navigation about the .aui-nav-item height? yeeeeah, it's invalid here.
89 @fake-icon-with-spacing: @aui-nav-subtree-toggle-icon-size + @aui-sidebar-nav-link-icon-spacing;
90
91 top: ((@box-size - @aui-nav-subtree-toggle-icon-size) / 2);
92 left: @aui-sidebar-nav-link-inner-spacing; // push it "inside" the .aui-nav-item, though the element actually adjacent to it.
93 color: @aui-sidebar-toggle-icon-color;
94
95 + .aui-nav-item {
96 padding-left: (@aui-sidebar-nav-link-inner-spacing + @fake-icon-with-spacing);
97
98 > .aui-icon {
99 display: none; // the subtree toggle is shown in place of this icon.
100 }
101 }
102
103 ~ .aui-nav {
104 padding-left: @fake-icon-with-spacing;
105 }
106 }
107 }
108
109 // divider between multiple aui-sidebar-groups or aui-navs inside the sidebar, without a aui-nav-heading.
110 // they used to be displayed, but the design went "borderless", so now they're not.
111 hr {
112 display: none;
113 }
114}
115
116//-----------------------
117// Sidebar narrow state - add collapsed styles.
118//-----------------------
119.aui-sidebar {
120 &[aria-expanded="false"] {
121 .aui-nav-heading {
122 display: none;
123 }
124
125 // show the icon for an expandable twixi menu (if it has one)
126 .aui-navgroup-vertical .aui-nav > li[aria-expanded] {
127 > .aui-nav-subtree-toggle {
128 + .aui-nav-item {
129 padding-left: 0;
130
131 > .aui-icon {
132 display: block; // the subtree toggle doesn't exist in the reduced width sidebar
133 }
134 }
135 }
136 }
137
138 .aui-nav-sortable > li > a:after {
139 left: 0;
140 top: (@aui-sidebar-grid * .8);
141 }
142
143 .aui-nav-item-actions {
144 display: none;
145 }
146 }
147}
148// END Sidebar
149//-----------------------
150
151.aui-sidebar-submenu-dialog > .aui-inline-dialog-contents {
152 padding: @aui-sidebar-grid;
153 width: 300px;
154 max-height: 812px;
155}
156
157.aui-sidebar-submenu {
158 position: static;
159 background: transparent;
160 border-right: 0;
161 width: auto;
162}