codecheck
301 строка · 6.4 Кб
1// core
2.p-megamenu {
3display: flex;
4position: relative;
5}
6
7.p-megamenu-root-list {
8margin: 0;
9padding: 0;
10list-style: none;
11}
12
13.p-megamenu .p-menuitem-link {
14cursor: pointer;
15display: flex;
16align-items: center;
17text-decoration: none;
18overflow: hidden;
19position: relative;
20}
21
22.p-megamenu .p-menuitem-text {
23line-height: 1;
24}
25
26.p-megamenu-panel {
27display: none;
28width: auto;
29z-index: 1;
30left: 0;
31min-width: 100%;
32}
33
34.p-megamenu-panel:not(.p-megamenu-mobile) {
35position: absolute;
36}
37
38.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {
39display: block;
40}
41
42.p-megamenu-submenu {
43margin: 0;
44padding: 0;
45list-style: none;
46}
47
48.p-megamenu-button {
49display: none;
50cursor: pointer;
51align-items: center;
52justify-content: center;
53text-decoration: none;
54}
55
56/* Horizontal */
57.p-megamenu-horizontal {
58align-items: center;
59}
60
61.p-megamenu-horizontal .p-megamenu-root-list {
62display: flex;
63align-items: center;
64flex-wrap: wrap;
65}
66
67.p-megamenu-horizontal .p-megamenu-end {
68margin-left: auto;
69align-self: center;
70}
71
72/* Vertical */
73.p-megamenu-vertical {
74flex-direction: column;
75}
76
77.p-megamenu-vertical:not(.p-megamenu-mobile) {
78display: inline-flex;
79}
80
81.p-megamenu-vertical .p-megamenu-root-list {
82flex-direction: column;
83}
84
85.p-megamenu-vertical:not(.p-megamenu-mobile) .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {
86left: 100%;
87top: 0;
88}
89
90.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {
91margin-left: auto;
92}
93
94.p-megamenu-grid {
95display: flex;
96}
97
98.p-megamenu-col-2,
99.p-megamenu-col-3,
100.p-megamenu-col-4,
101.p-megamenu-col-6,
102.p-megamenu-col-12 {
103flex: 0 0 auto;
104padding: 0.5rem;
105}
106
107.p-megamenu-col-2 {
108width: 16.6667%;
109}
110
111.p-megamenu-col-3 {
112width: 25%;
113}
114
115.p-megamenu-col-4 {
116width: 33.3333%;
117}
118
119.p-megamenu-col-6 {
120width: 50%;
121}
122
123.p-megamenu-col-12 {
124width: 100%;
125}
126
127.p-megamenu.p-megamenu-mobile .p-megamenu-button {
128display: flex;
129}
130
131.p-megamenu.p-megamenu-mobile .p-megamenu-root-list {
132position: absolute;
133display: none;
134width: 100%;
135}
136
137.p-megamenu.p-megamenu-mobile .p-submenu-list {
138width: 100%;
139position: static;
140box-shadow: none;
141border: 0 none;
142}
143
144.p-megamenu.p-megamenu-mobile .p-megamenu-root-list .p-menuitem {
145width: 100%;
146position: static;
147}
148
149.p-megamenu.p-megamenu-mobile-active .p-megamenu-root-list {
150display: flex;
151flex-direction: column;
152top: 100%;
153left: 0;
154z-index: 1;
155}
156
157.p-megamenu.p-megamenu-mobile .p-megamenu-grid {
158flex-wrap: wrap;
159overflow: auto;
160max-height: 90%;
161}
162
163// theme
164.p-megamenu {
165padding: $horizontalMenuPadding;
166background: $horizontalMenuBg;
167color: $horizontalMenuTextColor;
168border: $horizontalMenuBorder;
169border-radius: $borderRadius;
170
171.p-megamenu-root-list {
172outline: 0 none;
173}
174
175.p-menuitem {
176@include menuitem();
177}
178
179.p-megamenu-panel {
180background: $overlayMenuBg;
181color: $menuTextColor;
182border: $overlayMenuBorder;
183box-shadow: $overlayMenuShadow;
184border-radius: $borderRadius;
185}
186
187.p-submenu-header {
188margin: $submenuHeaderMargin;
189padding: $submenuHeaderPadding;
190color: $submenuHeaderTextColor;
191background: $submenuHeaderBg;
192font-weight: $submenuHeaderFontWeight;
193border-top-right-radius: $borderRadius;
194border-top-left-radius: $borderRadius;
195}
196
197.p-submenu-list {
198padding: $verticalMenuPadding;
199min-width: $menuWidth;
200
201.p-menuitem-separator {
202border-top: $divider;
203margin: $menuSeparatorMargin;
204}
205}
206
207&.p-megamenu-vertical {
208min-width: $menuWidth;
209padding: $verticalMenuPadding;
210}
211
212&.p-megamenu-horizontal {
213.p-megamenu-root-list {
214> .p-menuitem {
215@include horizontal-rootmenuitem();
216}
217}
218}
219
220&.p-megamenu-mobile {
221&.p-megamenu-vertical {
222width: 100%;
223padding: $horizontalMenuPadding;
224}
225
226.p-megamenu-button {
227width: $actionIconWidth;
228height: $actionIconHeight;
229color: $horizontalMenuRootMenuitemIconColor;
230border-radius: $actionIconBorderRadius;
231transition: $actionIconTransition;
232outline-color: transparent;
233
234&:hover {
235color: $horizontalMenuRootMenuitemIconHoverColor;
236background: $horizontalMenuRootMenuitemHoverBg;
237}
238
239&:focus {
240@include focused();
241}
242}
243
244.p-megamenu-root-list {
245padding: $verticalMenuPadding;
246background: $overlayMenuBg;
247border: $overlayMenuBorder;
248box-shadow: $overlayMenuShadow;
249
250.p-menuitem-separator {
251border-top: $divider;
252margin: $menuSeparatorMargin;
253}
254
255.p-submenu-icon {
256font-size: $menuitemSubmenuIconFontSize;
257}
258
259.p-menuitem {
260.p-menuitem-content {
261.p-menuitem-link {
262.p-submenu-icon {
263margin-left: auto;
264transition: transform $transitionDuration;
265}
266}
267}
268
269
270&.p-menuitem-active {
271> .p-menuitem-content {
272> .p-menuitem-link {
273> .p-submenu-icon {
274transform: rotate(-180deg);
275}
276}
277}
278}
279}
280
281.p-submenu-list {
282.p-submenu-icon {
283transition: transform $transitionDuration;
284transform: rotate(90deg);
285}
286
287.p-menuitem-active {
288> .p-menuitem-content {
289> .p-menuitem-link {
290> .p-submenu-icon {
291transform: rotate(-90deg);
292}
293}
294}
295}
296}
297
298@include nested-submenu-indents(nth($menuitemPadding, 1), 2, 2);
299}
300}
301}
302