UNPKG

5.53 kBtext/lessView Raw
1@import 'aui-sidebar-config.less';
2@import (reference) 'imports/mixins.less';
3
4//
5// Imported by aui-sidebar.
6//
7// Implements grouping strategies for sidebar items. The various group
8// types are wrappers around the base aui-nav pattern. Different groups
9// behave and are styled differently depending on whether the sidebar
10// is expanded or collapsed.
11//
12
13//
14// Sidebar navigation grouping
15//
16.aui-sidebar {
17
18 .aui-sidebar-group {
19 // Note: these margins should collapse with those of aui-nav itself.
20 margin-top: (@aui-sidebar-grid * 2);
21 margin-bottom: @aui-sidebar-grid;
22 padding: 0 @aui-sidebar-gutter;
23
24 .aui-nav-heading {
25 padding: 0 (@aui-sidebar-spacing - @aui-sidebar-gutter);
26 }
27 }
28
29
30 //-----------------------
31 // Sidebar narrow state - add collapsed styles.
32 //-----------------------
33 &[aria-expanded="false"] {
34 // Replaces aui-nav with a default image to reflect nested content
35 .aui-sidebar-group {
36 // by default, groups collapse and are meant to look like clickable buttons.
37 #aui-nav.item-base(@aui-sidebar-nav-link-expected-height);
38 #aui-nav.item-style(normal);
39 background: url(images/icons/sidebar/icon-group.svg) 50% center no-repeat;
40 cursor: pointer;
41 height: @aui-sidebar-icon-size;
42 margin-left: @aui-sidebar-grid;
43 margin-right: @aui-sidebar-grid;
44 position: relative;
45
46 &:focus,
47 &:hover {
48 #aui-nav.item-style(hover);
49 }
50
51 &.active {
52 #aui-nav.item-style(selected);
53 }
54
55 > .aui-nav {
56 display: none;
57 }
58
59 // remove the faux button effect; these things are still groups.
60 &.aui-sidebar-group-actions,
61 &.aui-sidebar-group-tier-one {
62 background: none;
63 border-radius: 0;
64 cursor: auto;
65 padding: 0;
66 }
67 }
68
69 // make the group actions look like a special kind of rounded button.
70 .aui-sidebar-group-actions {
71 margin: @aui-sidebar-grid 0 @aui-sidebar-spacing 0;
72 height: @aui-icon-size-large;
73
74 &::after {
75 @aui-sidebar-group-actions-border-width: 1px;
76
77 background: url(images/icons/sidebar/icon-group-actions.svg) no-repeat center center;
78 background-size: @aui-sidebar-icon-size;
79 border: @aui-sidebar-group-actions-border-width solid transparent;
80 border-radius: 50%;
81 content: "";
82 display: block;
83 height: @aui-icon-size-large;
84 left: 0;
85 margin-left: ((@aui-sidebar-collapsed-width - @aui-sidebar-header-avatar-collapsed - (@aui-sidebar-group-actions-border-width * 2)) / 2);
86 margin-right: ((@aui-sidebar-collapsed-width - @aui-sidebar-header-avatar-collapsed - (@aui-sidebar-group-actions-border-width * 2)) / 2);
87 position: absolute;
88 top: 0;
89 width: @aui-icon-size-large;
90 }
91
92 &:hover,
93 &:focus,
94 &.active {
95 &::after {
96 background-color: @aui-button-default-active-bg-color;
97 border-color: @aui-button-default-active-bg-color;
98 }
99 }
100 }
101
102 // use when the nav items have icons - shows the icon in the collapsed state
103 .aui-sidebar-group-tier-one {
104 background: none;
105 height: auto;
106
107 &:after {
108 display: none;
109 }
110
111 &:focus,
112 &:hover {
113 background-color: transparent;
114 }
115
116 .aui-nav {
117 display: block;
118 height: auto;
119
120 > li {
121 display: block;
122
123 > .aui-nav-item {
124 padding-left: 0;
125 padding-right: 0;
126 text-align: center;
127
128 // Adjust the position of the icon
129 > .aui-icon {
130 float: none;
131 margin: 0 auto;
132 }
133
134 &.active {
135 #aui-nav.item-style(selected);
136 }
137 }
138
139 // visually hide the labels while allowing screen readers to still see them
140 .aui-nav-item-label {
141 #aui.visually-hidden();
142 }
143
144 // remove any top level twixy expand/collapse triggers
145 > .aui-nav-subtree-toggle {
146 display: none;
147 }
148
149 .aui-nav-item-actions {
150 display: none;
151 }
152 }
153
154 // remove nested navs - contents to be sucked into fly-out menus
155 .aui-nav {
156 display: none;
157 }
158 }
159 }
160
161 .aui-sidebar-group ~ .aui-sidebar-group {
162 border-top: @aui-nav-actions-list-divider-size solid @aui-nav-group-divider-color;
163 margin-top: @aui-sidebar-spacing;
164 padding-top: @aui-sidebar-grid;
165 }
166 }
167 // END Collapsed state
168}
169// END Sidebar
170//-----------------------