@ecl/mega-menu 5.0.0-alpha.6 → 5.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/mega-menu-featured-item.html.twig +102 -0
- package/mega-menu-item.html.twig +4 -18
- package/mega-menu.html.twig +4 -2
- package/mega-menu.js +10 -35
- package/mega-menu.scss +68 -38
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -10,7 +10,6 @@ npm install --save @ecl/mega-menu
|
|
|
10
10
|
|
|
11
11
|
- **"id"** (string) (default: random): Unique id
|
|
12
12
|
- **"toggle"**: (associative array) (default: {}): Toggle (hamburger) button, using ECL button structure
|
|
13
|
-
- **"title"** (string) (default: ''): Used as the inner container aria-label value
|
|
14
13
|
- **"close"**: (associative array) (default: {}): Object, using ECL Button structure
|
|
15
14
|
- **"aria_label"** (string): (default: ''): Main list aria label
|
|
16
15
|
- **"second_level_aria_label"** (string): (default: ''): Second level list aria label
|
|
@@ -32,7 +31,7 @@ npm install --save @ecl/mega-menu
|
|
|
32
31
|
"title": (string)
|
|
33
32
|
"content": (string)
|
|
34
33
|
"items": (associative array) Array of items with image and link
|
|
35
|
-
}
|
|
34
|
+
},
|
|
36
35
|
"children": (associative array) (optional): [
|
|
37
36
|
{
|
|
38
37
|
"label": (string) (default: '')
|
|
@@ -56,7 +55,6 @@ npm install --save @ecl/mega-menu
|
|
|
56
55
|
<!-- prettier-ignore -->
|
|
57
56
|
```twig
|
|
58
57
|
{% include '@ecl/mega-menu/mega-menu.html.twig' with {
|
|
59
|
-
title: 'Menu',
|
|
60
58
|
toggle: {
|
|
61
59
|
link: {
|
|
62
60
|
label: 'Menu',
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{% apply spaceless %}
|
|
2
|
+
|
|
3
|
+
{#
|
|
4
|
+
Parameters:
|
|
5
|
+
- "label" (string) Label of the textual link
|
|
6
|
+
- "path" (string) Path or Url for the href of the link
|
|
7
|
+
- "icon_path": Path to the icons sprite
|
|
8
|
+
- "picture" (associative array) ECL picture
|
|
9
|
+
- "img" (associative array) (default: {}):
|
|
10
|
+
- "src" (string) (default: ''): Path to the image
|
|
11
|
+
- "alt" (string) (default: ''): Alt text, required in case of a link with only an image
|
|
12
|
+
- "sources" (array) (default: []): format: [
|
|
13
|
+
{
|
|
14
|
+
"src" (string) (default: ''): Path to the source image
|
|
15
|
+
"media" (string) (default: ''): Media condition to use this source. Could be a breakpoint ('s', 'm', 'l', 'xl') or a free string.
|
|
16
|
+
"type" (string) (default: ''): Type of this source
|
|
17
|
+
},
|
|
18
|
+
...
|
|
19
|
+
]
|
|
20
|
+
- "extra_classes" (optional) (string) (default: '') Extra classes (space separated) for the nav element
|
|
21
|
+
- "extra_attributes" (optional) (array) (default: []) Extra attributes for the nav element
|
|
22
|
+
- "name" (string) Attribute name, eg. 'data-test'
|
|
23
|
+
- "value" (optional) (string) Attribute value, eg: 'data-test-1'
|
|
24
|
+
#}
|
|
25
|
+
|
|
26
|
+
{# Internal properties #}
|
|
27
|
+
|
|
28
|
+
{% set _item_css_class = 'ecl-mega-menu__featured-list__item' %}
|
|
29
|
+
{% set _css_class = 'ecl-mega-menu__featured-link' %}
|
|
30
|
+
{% set _label = label|default('') %}
|
|
31
|
+
{% set _path = path|default('') %}
|
|
32
|
+
{% set _picture = picture|default({}) %}
|
|
33
|
+
{% set _icon_path = icon_path|default('') %}
|
|
34
|
+
{% set _external = external|default(false) %}
|
|
35
|
+
{% set _sr_external = sr_external|default(false) %}
|
|
36
|
+
{% set _extra_attributes = 'data-ecl-mega-menu-featured-link' %}
|
|
37
|
+
|
|
38
|
+
{# Internal logic - Process properties #}
|
|
39
|
+
|
|
40
|
+
{% if extra_classes is defined and extra_classes is not empty %}
|
|
41
|
+
{% set _css_class = _css_class ~ ' ' ~ extra_classes %}
|
|
42
|
+
{% endif %}
|
|
43
|
+
|
|
44
|
+
{% if extra_attributes is defined and extra_attributes is not empty and extra_attributes is iterable %}
|
|
45
|
+
{% for attr in extra_attributes %}
|
|
46
|
+
{% if attr.value is defined %}
|
|
47
|
+
{% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name|e('html_attr') ~ '="' ~ attr.value|e('html_attr') ~ '"' %}
|
|
48
|
+
{% else %}
|
|
49
|
+
{% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name|e('html_attr') %}
|
|
50
|
+
{% endif %}
|
|
51
|
+
{% endfor %}
|
|
52
|
+
{% endif %}
|
|
53
|
+
|
|
54
|
+
{% set _picture_markup = '' %}
|
|
55
|
+
{% if _picture is not empty %}
|
|
56
|
+
{% set _picture_markup %}
|
|
57
|
+
{% include '@ecl/picture/picture.html.twig' with {
|
|
58
|
+
picture: _picture,
|
|
59
|
+
extra_classes: 'ecl-mega-menu__featured-picture',
|
|
60
|
+
extra_image_classes: 'ecl-mega-menu__featured-image',
|
|
61
|
+
} only %}
|
|
62
|
+
{% endset %}
|
|
63
|
+
{% endif %}
|
|
64
|
+
|
|
65
|
+
{% if _label is not empty and _picture_markup is not empty %}
|
|
66
|
+
{% set _item_css_class = _item_css_class ~ ' ecl-mega-menu__featured-list__item--combo' %}
|
|
67
|
+
{% endif %}
|
|
68
|
+
{% if _picture is not empty and _path is empty %}
|
|
69
|
+
{% set _item_css_class = _item_css_class ~ ' ecl-mega-menu__featured-list__item--image-only' %}
|
|
70
|
+
{% endif %}
|
|
71
|
+
|
|
72
|
+
<li class="{{ _item_css_class }}">
|
|
73
|
+
{# Link with image #}
|
|
74
|
+
{% if _path is not empty and _picture is not empty %}
|
|
75
|
+
<a
|
|
76
|
+
class="ecl-link ecl-link--standalone {{ _css_class }}"
|
|
77
|
+
href="{{ _path }}"
|
|
78
|
+
{{ _extra_attributes|raw }}
|
|
79
|
+
>
|
|
80
|
+
{{- _picture_markup -}}{{- _label -}}
|
|
81
|
+
</a>
|
|
82
|
+
{# simple image #}
|
|
83
|
+
{% elseif _picture is not empty %}
|
|
84
|
+
{{- _picture_markup -}}
|
|
85
|
+
{# textual link #}
|
|
86
|
+
{% elseif _path is not empty and _label is not empty %}
|
|
87
|
+
{% include '@ecl/link/link.html.twig' with {
|
|
88
|
+
link: {
|
|
89
|
+
path: _path,
|
|
90
|
+
type: 'standalone',
|
|
91
|
+
icon_path: _icon_path,
|
|
92
|
+
external: _external,
|
|
93
|
+
sr_external: _sr_external,
|
|
94
|
+
label: _label,
|
|
95
|
+
},
|
|
96
|
+
extra_attributes: extra_attributes|default([])|merge([{ name: 'data-ecl-mega-menu-featured-link' }]),
|
|
97
|
+
extra_classes: _css_class,
|
|
98
|
+
} only %}
|
|
99
|
+
{% endif %}
|
|
100
|
+
</li>
|
|
101
|
+
|
|
102
|
+
{% endapply %}
|
package/mega-menu-item.html.twig
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
- "path" (string) Path or Url for the href
|
|
25
25
|
- "label" (string) Label of the item
|
|
26
26
|
- "external" (boolean) Whether the link is external
|
|
27
|
+
- "icon_path" (string) Path to the icons sprite
|
|
27
28
|
- "sr_external" (string) (default: '') Additional label for the external icon
|
|
28
29
|
- "extra_attributes" (array)
|
|
29
30
|
- "name" (string) Attribute name, eg. 'data-test'
|
|
@@ -191,10 +192,10 @@
|
|
|
191
192
|
size: 'xs',
|
|
192
193
|
},
|
|
193
194
|
extra_classes: _info.link.extra_classes|default('') ~ ' ecl-mega-menu__info-link',
|
|
194
|
-
extra_attributes: [{
|
|
195
|
+
extra_attributes: _info.link.extra_attributes|default([])|merge([{
|
|
195
196
|
name: 'aria-describedby',
|
|
196
197
|
value: _info_title_id,
|
|
197
|
-
}],
|
|
198
|
+
}]),
|
|
198
199
|
}) only %}
|
|
199
200
|
{%- endif -%}
|
|
200
201
|
</div>
|
|
@@ -340,22 +341,7 @@
|
|
|
340
341
|
aria-labelledby="{{ 'ecl-mega-menu-featured-title-' ~ sublink_id ~ ' ' ~ sublink_id }}"
|
|
341
342
|
>
|
|
342
343
|
{% for item in _featured.items %}
|
|
343
|
-
|
|
344
|
-
{% if item.picture is not empty %}
|
|
345
|
-
{% include '@ecl/picture/picture.html.twig' with {
|
|
346
|
-
picture: item.picture,
|
|
347
|
-
extra_classes: 'ecl-mega-menu__featured-picture',
|
|
348
|
-
extra_image_classes: 'ecl-mega-menu__featured-image',
|
|
349
|
-
} only %}
|
|
350
|
-
{% endif %}
|
|
351
|
-
{% include '@ecl/link/link.html.twig' with {
|
|
352
|
-
link: item|merge({ type: 'standalone', icon_path: _icon_path }),
|
|
353
|
-
extra_attributes: [
|
|
354
|
-
{ name: 'data-ecl-mega-menu-featured-link' },
|
|
355
|
-
]|merge(item.extra_attributes|default([])),
|
|
356
|
-
extra_classes: item.extra_classes|default(''),
|
|
357
|
-
} only %}
|
|
358
|
-
</li>
|
|
344
|
+
{% include '@ecl/mega-menu/mega-menu-featured-item.html.twig' with item|merge({ icon_path: _icon_path }) only %}
|
|
359
345
|
{% endfor %}
|
|
360
346
|
</ul>
|
|
361
347
|
{%- endif -%}
|
package/mega-menu.html.twig
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
- "aria_label" (string) (default: '') Aria label for the main nav
|
|
10
10
|
- "second_level_aria_label" (string) (default: '') Aria label for the sub-lists, second level
|
|
11
11
|
- "third_level_aria_label" (string) (default: '') Aria label for the sub-lists, third level
|
|
12
|
+
- "see_all_label": (string) (default: ''): Label for the "view all" link
|
|
12
13
|
- "icon_path": (string) (default: ''): Path to the icon sprite
|
|
13
14
|
- "items": (array) (default: []): The menu items - format: [
|
|
14
15
|
{
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"path": (string) (default: '')
|
|
36
37
|
"external": (boolean),
|
|
37
38
|
"sr_external" (string) (default: '') Additional label for the external icon
|
|
38
|
-
"see_all" (boolean)
|
|
39
|
+
"see_all" (boolean) controls visibility of "View All" button
|
|
39
40
|
"see_all_label" (string)
|
|
40
41
|
"see_all_attributes" (optional) (array) (default: [])
|
|
41
42
|
- "name" (string) Attribute name, eg. 'data-test'
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
]
|
|
48
49
|
}
|
|
49
50
|
],
|
|
50
|
-
- "extra_classes" (
|
|
51
|
+
- "extra_classes" (string) (default: '') Extra classes (space separated) for the nav element
|
|
51
52
|
- "extra_attributes" (optional) (array) (default: []) Extra attributes for the nav element
|
|
52
53
|
- "name" (string) Attribute name, eg. 'data-test'
|
|
53
54
|
- "value" (optional) (string) Attribute value, eg: 'data-test-1'
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
{% set _toggle = toggle|default({}) %}
|
|
64
65
|
{% set _close = close|default({}) %}
|
|
65
66
|
{% set _items = items|default([{}]) %}
|
|
67
|
+
{% set _see_all_label = see_all_label|default('') %}
|
|
66
68
|
{% set _css_class = 'ecl-mega-menu' %}
|
|
67
69
|
{% set _extra_attributes = '' %}
|
|
68
70
|
{% set _icon_path = icon_path|default('') %}
|
package/mega-menu.js
CHANGED
|
@@ -143,7 +143,6 @@ export class MegaMenu {
|
|
|
143
143
|
this.infoLinks = null;
|
|
144
144
|
this.seeAllLinks = null;
|
|
145
145
|
this.featuredLinks = null;
|
|
146
|
-
this.featuredImages = null;
|
|
147
146
|
|
|
148
147
|
// Bind `this` for use in callbacks
|
|
149
148
|
this.handleClickOnOpen = this.handleClickOnOpen.bind(this);
|
|
@@ -153,8 +152,6 @@ export class MegaMenu {
|
|
|
153
152
|
this.handleClickGlobal = this.handleClickGlobal.bind(this);
|
|
154
153
|
this.handleClickOnItem = this.handleClickOnItem.bind(this);
|
|
155
154
|
this.handleClickOnSubitem = this.handleClickOnSubitem.bind(this);
|
|
156
|
-
this.handleClickOnFeaturedImage =
|
|
157
|
-
this.handleClickOnFeaturedImage.bind(this);
|
|
158
155
|
this.handleFocusOut = this.handleFocusOut.bind(this);
|
|
159
156
|
this.handleKeyboard = this.handleKeyboard.bind(this);
|
|
160
157
|
this.handleKeyboardGlobal = this.handleKeyboardGlobal.bind(this);
|
|
@@ -197,10 +194,6 @@ export class MegaMenu {
|
|
|
197
194
|
);
|
|
198
195
|
this.toggleLabel = queryOne('.ecl-button__label', this.open);
|
|
199
196
|
this.menuOverlay = queryOne('.ecl-mega-menu__overlay', this.element);
|
|
200
|
-
this.featuredImages = queryAll(
|
|
201
|
-
'.ecl-mega-menu__featured-image',
|
|
202
|
-
this.element,
|
|
203
|
-
);
|
|
204
197
|
|
|
205
198
|
// Check if we should use desktop display (it does not rely only on breakpoints)
|
|
206
199
|
this.isDesktop = this.useDesktopDisplay();
|
|
@@ -218,12 +211,6 @@ export class MegaMenu {
|
|
|
218
211
|
this.back.addEventListener('keyup', this.handleKeyboard);
|
|
219
212
|
}
|
|
220
213
|
|
|
221
|
-
if (this.featuredImages) {
|
|
222
|
-
this.featuredImages.forEach((img) => {
|
|
223
|
-
img.addEventListener('click', this.handleClickOnFeaturedImage);
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
214
|
// Global click
|
|
228
215
|
if (this.attachClickListener) {
|
|
229
216
|
document.addEventListener('click', this.handleClickGlobal);
|
|
@@ -374,12 +361,6 @@ export class MegaMenu {
|
|
|
374
361
|
this.back.removeEventListener('click', this.handleClickOnBack);
|
|
375
362
|
}
|
|
376
363
|
|
|
377
|
-
if (this.featuredImages) {
|
|
378
|
-
this.featuredImages.forEach((img) => {
|
|
379
|
-
img.removeEventListener('click', this.handleClickOnFeaturedImage);
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
|
|
383
364
|
document.removeEventListener('click', this.handleClickGlobal);
|
|
384
365
|
}
|
|
385
366
|
|
|
@@ -513,10 +494,15 @@ export class MegaMenu {
|
|
|
513
494
|
|
|
514
495
|
// Remove display:none from the sublists
|
|
515
496
|
if (subLists && viewport === 'mobile') {
|
|
516
|
-
const megaMenus = queryAll(
|
|
517
|
-
|
|
497
|
+
const megaMenus = queryAll('[data-ecl-mega-menu-mega]', this.element);
|
|
498
|
+
const featuredPanels = queryAll(
|
|
499
|
+
'[data-ecl-mega-menu-featured]',
|
|
518
500
|
this.element,
|
|
519
501
|
);
|
|
502
|
+
if (featuredPanels.length) {
|
|
503
|
+
megaMenus.push(...featuredPanels);
|
|
504
|
+
}
|
|
505
|
+
|
|
520
506
|
megaMenus.forEach((menu) => {
|
|
521
507
|
menu.style.height = '';
|
|
522
508
|
});
|
|
@@ -775,7 +761,8 @@ export class MegaMenu {
|
|
|
775
761
|
featuredHeight += child.offsetHeight + marginHeight;
|
|
776
762
|
},
|
|
777
763
|
);
|
|
778
|
-
|
|
764
|
+
// Add 5px to the featured panel height to prevent scrollbar on hover
|
|
765
|
+
featuredHeight += 5;
|
|
779
766
|
heights.push(featuredHeight);
|
|
780
767
|
}
|
|
781
768
|
}
|
|
@@ -796,6 +783,7 @@ export class MegaMenu {
|
|
|
796
783
|
if (wrapper) {
|
|
797
784
|
wrapper.style.height = `${height}px`;
|
|
798
785
|
}
|
|
786
|
+
|
|
799
787
|
if (mainPanel && this.isLarge) {
|
|
800
788
|
mainPanel.style.height = `${height}px`;
|
|
801
789
|
} else if (mainPanel && infoPanel && this.isDesktop) {
|
|
@@ -1321,19 +1309,6 @@ export class MegaMenu {
|
|
|
1321
1309
|
this.trigger('onBack', { level: level2 ? 2 : 1 });
|
|
1322
1310
|
}
|
|
1323
1311
|
|
|
1324
|
-
/**
|
|
1325
|
-
* Programmatically click the related link when an image is clicked
|
|
1326
|
-
*
|
|
1327
|
-
* @param {Event} e
|
|
1328
|
-
*/
|
|
1329
|
-
handleClickOnFeaturedImage(e) {
|
|
1330
|
-
const featuredImage = e.target;
|
|
1331
|
-
const featuredLink = featuredImage.parentElement.nextSibling;
|
|
1332
|
-
if (featuredLink) {
|
|
1333
|
-
featuredLink.click();
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
1312
|
/**
|
|
1338
1313
|
* Show/hide the first panel
|
|
1339
1314
|
*
|
package/mega-menu.scss
CHANGED
|
@@ -14,7 +14,8 @@ $mega-menu: null !default;
|
|
|
14
14
|
|
|
15
15
|
@mixin with-scrollbar {
|
|
16
16
|
overflow-y: auto;
|
|
17
|
-
scrollbar-color: var(--c-n)
|
|
17
|
+
scrollbar-color: var(--cm-on-surface-neutral-medium, var(--c-n))
|
|
18
|
+
rgba(0, 0, 0, 0);
|
|
18
19
|
scrollbar-width: thin;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -68,6 +69,7 @@ $mega-menu: null !default;
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
&:hover {
|
|
72
|
+
background-color: map.get($mega-menu, 'mobile', 'open-background-hover');
|
|
71
73
|
text-decoration: underline;
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -83,6 +85,10 @@ $mega-menu: null !default;
|
|
|
83
85
|
.ecl-mega-menu[data-expanded] .ecl-mega-menu__open {
|
|
84
86
|
background-color: map.get($mega-menu, 'mobile', 'open-background-active');
|
|
85
87
|
|
|
88
|
+
&:hover {
|
|
89
|
+
background-color: map.get($mega-menu, 'mobile', 'open-background-hover');
|
|
90
|
+
}
|
|
91
|
+
|
|
86
92
|
.ecl-icon:first-of-type {
|
|
87
93
|
display: none;
|
|
88
94
|
}
|
|
@@ -114,7 +120,7 @@ $mega-menu: null !default;
|
|
|
114
120
|
padding-top: 0;
|
|
115
121
|
|
|
116
122
|
.ecl-container {
|
|
117
|
-
padding: 0
|
|
123
|
+
padding: 0 map.get($mega-menu, 'desktop', 'container-padding-horizontal');
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
.ecl-mega-menu__container {
|
|
@@ -315,7 +321,7 @@ $mega-menu: null !default;
|
|
|
315
321
|
}
|
|
316
322
|
|
|
317
323
|
.ecl-mega-menu__wrapper {
|
|
318
|
-
background:
|
|
324
|
+
background: #fff;
|
|
319
325
|
display: none;
|
|
320
326
|
font: map.get($mega-menu, 'global', 'font');
|
|
321
327
|
position: absolute;
|
|
@@ -394,8 +400,8 @@ $mega-menu: null !default;
|
|
|
394
400
|
background: transparent;
|
|
395
401
|
border-color: transparent;
|
|
396
402
|
border-radius: 0px;
|
|
397
|
-
color: var(--c-d);
|
|
398
|
-
outline-color: var(--c-p);
|
|
403
|
+
color: var(--cm-on-surface-brand, var(--c-d));
|
|
404
|
+
outline-color: var(--cm-border-primary, var(--c-p));
|
|
399
405
|
outline-offset: -2px;
|
|
400
406
|
outline-width: 2px;
|
|
401
407
|
}
|
|
@@ -415,11 +421,23 @@ $mega-menu: null !default;
|
|
|
415
421
|
}
|
|
416
422
|
}
|
|
417
423
|
|
|
418
|
-
.ecl-mega-menu__featured-list__item
|
|
419
|
-
|
|
424
|
+
.ecl-mega-menu__featured-list__item {
|
|
425
|
+
.ecl-link {
|
|
426
|
+
/* stylelint-disable-next-line declaration-property-value-no-unknown */
|
|
427
|
+
border-bottom: 1px solid
|
|
428
|
+
map.get($mega-menu, 'mobile', 'featured-link-border');
|
|
420
429
|
|
|
421
|
-
|
|
422
|
-
|
|
430
|
+
.ecl-picture {
|
|
431
|
+
margin-inline: calc(-1 * var(--s-s)) calc(-1 * var(--s-2xl));
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
&:hover {
|
|
435
|
+
border-color: map.get($mega-menu, 'mobile', 'featured-link-border');
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
&--combo .ecl-mega-menu__featured-image {
|
|
440
|
+
margin-block-end: var(--s-xs);
|
|
423
441
|
}
|
|
424
442
|
}
|
|
425
443
|
|
|
@@ -440,7 +458,7 @@ $mega-menu: null !default;
|
|
|
440
458
|
outline: none;
|
|
441
459
|
|
|
442
460
|
.ecl-button__label {
|
|
443
|
-
outline: 2px solid var(--c-p);
|
|
461
|
+
outline: 2px solid var(--cm-border-primary, var(--c-p));
|
|
444
462
|
outline-offset: 4px;
|
|
445
463
|
}
|
|
446
464
|
}
|
|
@@ -495,11 +513,11 @@ $mega-menu: null !default;
|
|
|
495
513
|
.ecl-mega-menu__subitem {
|
|
496
514
|
.ecl-mega-menu__sublink--level-2 {
|
|
497
515
|
background: transparent;
|
|
498
|
-
color: var(--c-p);
|
|
516
|
+
color: var(--cm-on-surface-primary, var(--c-p));
|
|
499
517
|
|
|
500
518
|
&:hover {
|
|
501
519
|
box-shadow: none;
|
|
502
|
-
color: var(--c-p-140);
|
|
520
|
+
color: var(--cm-on-surface-primary-highest, var(--c-p-140));
|
|
503
521
|
}
|
|
504
522
|
}
|
|
505
523
|
}
|
|
@@ -561,7 +579,7 @@ $mega-menu: null !default;
|
|
|
561
579
|
z-index: 0;
|
|
562
580
|
|
|
563
581
|
&:active {
|
|
564
|
-
color:
|
|
582
|
+
color: #fff;
|
|
565
583
|
}
|
|
566
584
|
|
|
567
585
|
&:hover {
|
|
@@ -579,7 +597,7 @@ $mega-menu: null !default;
|
|
|
579
597
|
);
|
|
580
598
|
border-radius: 0;
|
|
581
599
|
color: map.get($mega-menu, 'desktop', 'item-color-focus');
|
|
582
|
-
outline-color:
|
|
600
|
+
outline-color: #fff;
|
|
583
601
|
outline-offset: -8px;
|
|
584
602
|
outline-width: map.get($mega-menu, 'desktop', 'outline-width');
|
|
585
603
|
}
|
|
@@ -635,7 +653,7 @@ $mega-menu: null !default;
|
|
|
635
653
|
}
|
|
636
654
|
|
|
637
655
|
.ecl-mega-menu__link:focus-visible {
|
|
638
|
-
outline-color: var(--c-p);
|
|
656
|
+
outline-color: var(--cm-border-primary, var(--c-p));
|
|
639
657
|
}
|
|
640
658
|
}
|
|
641
659
|
}
|
|
@@ -651,8 +669,8 @@ $mega-menu: null !default;
|
|
|
651
669
|
|
|
652
670
|
&.ecl-mega-menu__item--expanded {
|
|
653
671
|
.ecl-mega-menu__link {
|
|
654
|
-
background-color:
|
|
655
|
-
color: var(--c-d);
|
|
672
|
+
background-color: #fff;
|
|
673
|
+
color: var(--cm-on-surface-brand, var(--c-d));
|
|
656
674
|
z-index: map.get($theme, 'z-index', 'dropdown') + 1;
|
|
657
675
|
}
|
|
658
676
|
}
|
|
@@ -768,7 +786,7 @@ $mega-menu: null !default;
|
|
|
768
786
|
.ecl-link {
|
|
769
787
|
border-radius: 0;
|
|
770
788
|
box-sizing: border-box;
|
|
771
|
-
color: var(--c-d);
|
|
789
|
+
color: var(--cm-on-surface-brand, var(--c-d));
|
|
772
790
|
margin: 0 var(--s-l);
|
|
773
791
|
padding: var(--s-xs) 0;
|
|
774
792
|
|
|
@@ -834,15 +852,15 @@ $mega-menu: null !default;
|
|
|
834
852
|
}
|
|
835
853
|
|
|
836
854
|
&--current {
|
|
837
|
-
background-color: var(--c-n-80);
|
|
838
|
-
box-shadow: inset 4px 0 0 0 var(--c-p);
|
|
855
|
+
background-color: var(--cm-surface-neutral-lowest, var(--c-n-80));
|
|
856
|
+
box-shadow: inset 4px 0 0 0 var(--cm-border-primary, var(--c-p));
|
|
839
857
|
}
|
|
840
858
|
|
|
841
859
|
&:focus-visible {
|
|
842
860
|
background: transparent;
|
|
843
861
|
border-color: transparent;
|
|
844
|
-
color: var(--c-d);
|
|
845
|
-
outline-color: var(--c-p);
|
|
862
|
+
color: var(--cm-on-surface-brand, var(--c-d));
|
|
863
|
+
outline-color: var(--cm-border-primary, var(--c-p));
|
|
846
864
|
outline-offset: -2px;
|
|
847
865
|
outline-width: 2px;
|
|
848
866
|
}
|
|
@@ -870,14 +888,14 @@ $mega-menu: null !default;
|
|
|
870
888
|
}
|
|
871
889
|
|
|
872
890
|
.ecl-mega-menu__sublink {
|
|
873
|
-
color: var(--c-p);
|
|
891
|
+
color: var(--cm-on-surface-primary, var(--c-p));
|
|
874
892
|
|
|
875
893
|
&:hover {
|
|
876
894
|
text-decoration: underline;
|
|
877
895
|
}
|
|
878
896
|
|
|
879
897
|
&:focus-visible {
|
|
880
|
-
color: var(--c-p) !important;
|
|
898
|
+
color: var(--cm-on-surface-primary, var(--c-p)) !important;
|
|
881
899
|
}
|
|
882
900
|
|
|
883
901
|
&.ecl-mega-menu__sublink--last {
|
|
@@ -896,16 +914,19 @@ $mega-menu: null !default;
|
|
|
896
914
|
|
|
897
915
|
.ecl-mega-menu__featured {
|
|
898
916
|
background-color: map.get($mega-menu, 'mobile', 'featured-background');
|
|
899
|
-
border-color: var(--c-n);
|
|
917
|
+
border-color: var(--cm-border-neutral, var(--c-n));
|
|
900
918
|
border-width: 0.5px;
|
|
901
919
|
flex-direction: column;
|
|
902
920
|
padding: 0 var(--s-xs);
|
|
903
921
|
|
|
922
|
+
.ecl-mega-menu__featured-scrollable {
|
|
923
|
+
background-color: map.get($mega-menu, 'mobile', 'featured-background');
|
|
924
|
+
}
|
|
925
|
+
|
|
904
926
|
.ecl-mega-menu__featured-picture {
|
|
905
927
|
display: block;
|
|
906
928
|
|
|
907
929
|
.ecl-mega-menu__featured-image {
|
|
908
|
-
cursor: pointer;
|
|
909
930
|
aspect-ratio: 16/9;
|
|
910
931
|
display: block;
|
|
911
932
|
margin-inline-start: var(--s-l);
|
|
@@ -914,6 +935,10 @@ $mega-menu: null !default;
|
|
|
914
935
|
}
|
|
915
936
|
}
|
|
916
937
|
|
|
938
|
+
.ecl-link .ecl-mega-menu__featured-picture .ecl-mega-menu__featured-image {
|
|
939
|
+
margin-inline-start: var(--s-s);
|
|
940
|
+
}
|
|
941
|
+
|
|
917
942
|
.ecl-mega-menu__featured-title {
|
|
918
943
|
display: block;
|
|
919
944
|
margin: calc(var(--s-xs) + 2px) var(--s-m) calc(var(--s-xs) + 2px)
|
|
@@ -933,16 +958,20 @@ $mega-menu: null !default;
|
|
|
933
958
|
.ecl-link {
|
|
934
959
|
border-radius: 0;
|
|
935
960
|
box-sizing: border-box;
|
|
936
|
-
color: var(--c-p);
|
|
961
|
+
color: var(--cm-on-surface-primary, var(--c-p));
|
|
937
962
|
display: block;
|
|
938
963
|
outline-offset: -2px;
|
|
939
964
|
padding: var(--s-m) var(--s-l);
|
|
940
965
|
width: 100%;
|
|
941
966
|
|
|
942
967
|
&:hover {
|
|
943
|
-
color: var(--c-p);
|
|
968
|
+
color: var(--cm-on-surface-primary, var(--c-p));
|
|
944
969
|
}
|
|
945
970
|
}
|
|
971
|
+
|
|
972
|
+
&--image-only {
|
|
973
|
+
margin-block-end: var(--s-xs);
|
|
974
|
+
}
|
|
946
975
|
}
|
|
947
976
|
}
|
|
948
977
|
}
|
|
@@ -969,7 +998,7 @@ $mega-menu: null !default;
|
|
|
969
998
|
width: 100vw;
|
|
970
999
|
|
|
971
1000
|
&::before {
|
|
972
|
-
background: #e3e3e3;
|
|
1001
|
+
background: var(--cm-border-neutral, '#e3e3e3');
|
|
973
1002
|
content: ' ';
|
|
974
1003
|
display: block;
|
|
975
1004
|
height: 1px;
|
|
@@ -999,7 +1028,7 @@ $mega-menu: null !default;
|
|
|
999
1028
|
> .ecl-mega-menu__wrapper
|
|
1000
1029
|
> .ecl-container
|
|
1001
1030
|
> .ecl-mega-menu__info {
|
|
1002
|
-
background-color:
|
|
1031
|
+
background-color: #fff;
|
|
1003
1032
|
border: map.get($mega-menu, 'desktop', 'mega-border');
|
|
1004
1033
|
border-radius: 0 0 map.get($mega-menu, 'global', 'border-radius')
|
|
1005
1034
|
map.get($mega-menu, 'global', 'border-radius');
|
|
@@ -1049,7 +1078,7 @@ $mega-menu: null !default;
|
|
|
1049
1078
|
}
|
|
1050
1079
|
|
|
1051
1080
|
.ecl-mega-menu__item > .ecl-mega-menu__mega-container {
|
|
1052
|
-
background-color:
|
|
1081
|
+
background-color: #fff;
|
|
1053
1082
|
top: 100%;
|
|
1054
1083
|
width: 100%;
|
|
1055
1084
|
|
|
@@ -1102,7 +1131,7 @@ $mega-menu: null !default;
|
|
|
1102
1131
|
}
|
|
1103
1132
|
|
|
1104
1133
|
.ecl-mega-menu__subitem--expanded .ecl-mega-menu__featured {
|
|
1105
|
-
background:
|
|
1134
|
+
background: #fff;
|
|
1106
1135
|
display: flex;
|
|
1107
1136
|
margin-bottom: 0;
|
|
1108
1137
|
|
|
@@ -1122,7 +1151,7 @@ $mega-menu: null !default;
|
|
|
1122
1151
|
}
|
|
1123
1152
|
|
|
1124
1153
|
.ecl-mega-menu__sublist {
|
|
1125
|
-
border-color:
|
|
1154
|
+
border-color: #fff;
|
|
1126
1155
|
border-width: 2px;
|
|
1127
1156
|
display: flex;
|
|
1128
1157
|
flex-direction: column;
|
|
@@ -1211,7 +1240,7 @@ $mega-menu: null !default;
|
|
|
1211
1240
|
}
|
|
1212
1241
|
|
|
1213
1242
|
&:focus-visible {
|
|
1214
|
-
outline-color: var(--c-p);
|
|
1243
|
+
outline-color: var(--cm-border-primary, var(--c-p));
|
|
1215
1244
|
}
|
|
1216
1245
|
}
|
|
1217
1246
|
}
|
|
@@ -1253,14 +1282,14 @@ $mega-menu: null !default;
|
|
|
1253
1282
|
|
|
1254
1283
|
&:focus-visible {
|
|
1255
1284
|
border-color: transparent;
|
|
1256
|
-
color: var(--c-d);
|
|
1257
|
-
outline-color: var(--c-p);
|
|
1285
|
+
color: var(--cm-on-surface-brand, var(--c-d));
|
|
1286
|
+
outline-color: var(--cm-border-primary, var(--c-p));
|
|
1258
1287
|
outline-width: 2px;
|
|
1259
1288
|
}
|
|
1260
1289
|
}
|
|
1261
1290
|
|
|
1262
1291
|
.ecl-mega-menu__subitem[aria-expanded] > .ecl-mega-menu__sublink:hover {
|
|
1263
|
-
background-color: var(--c-n-40);
|
|
1292
|
+
background-color: var(--cm-surface-neutral-lowest, var(--c-n-40));
|
|
1264
1293
|
box-shadow: none;
|
|
1265
1294
|
text-decoration: none;
|
|
1266
1295
|
}
|
|
@@ -1274,7 +1303,7 @@ $mega-menu: null !default;
|
|
|
1274
1303
|
'desktop',
|
|
1275
1304
|
'sublink-current-background'
|
|
1276
1305
|
);
|
|
1277
|
-
border-color: var(--c-p);
|
|
1306
|
+
border-color: var(--cm-border-primary, var(--c-p));
|
|
1278
1307
|
}
|
|
1279
1308
|
}
|
|
1280
1309
|
}
|
|
@@ -1292,6 +1321,7 @@ $mega-menu: null !default;
|
|
|
1292
1321
|
top: 0;
|
|
1293
1322
|
|
|
1294
1323
|
.ecl-mega-menu__featured-scrollable {
|
|
1324
|
+
background-color: transparent;
|
|
1295
1325
|
height: 100%;
|
|
1296
1326
|
|
|
1297
1327
|
@include with-scrollbar;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ecl/mega-menu",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "5.0.0-alpha.
|
|
5
|
+
"version": "5.0.0-alpha.8",
|
|
6
6
|
"description": "ECL Mega Menu",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"module": "mega-menu.js",
|
|
12
12
|
"style": "mega-menu.scss",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ecl/button": "5.0.0-alpha.
|
|
15
|
-
"@ecl/dom-utils": "5.0.0-alpha.
|
|
16
|
-
"@ecl/event-manager": "5.0.0-alpha.
|
|
17
|
-
"@ecl/link": "5.0.0-alpha.
|
|
14
|
+
"@ecl/button": "5.0.0-alpha.8",
|
|
15
|
+
"@ecl/dom-utils": "5.0.0-alpha.8",
|
|
16
|
+
"@ecl/event-manager": "5.0.0-alpha.8",
|
|
17
|
+
"@ecl/link": "5.0.0-alpha.8",
|
|
18
|
+
"@ecl/picture": "5.0.0-alpha.8",
|
|
18
19
|
"bowser": "2.11.0",
|
|
19
20
|
"focus-trap": "7.6.4"
|
|
20
21
|
},
|
|
@@ -32,5 +33,5 @@
|
|
|
32
33
|
"design-system",
|
|
33
34
|
"twig"
|
|
34
35
|
],
|
|
35
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "765d0f9f94ff5aebe563f8693bb682647cc4f8a8"
|
|
36
37
|
}
|