@ecl/site-header 5.0.0-RC1 → 5.0.0-RC3
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/_site-header-dropdown.scss +2 -2
- package/package.json +16 -15
- package/site-header-ec.scss +20 -37
- package/site-header-eu.scss +20 -18
- package/site-header.js +6 -8
|
@@ -51,7 +51,7 @@ $language-list: null !default;
|
|
|
51
51
|
box-shadow: map.get($language-switcher, 'shadow');
|
|
52
52
|
color: map.get($language-list, 'color');
|
|
53
53
|
font: var(--f-m);
|
|
54
|
-
|
|
54
|
+
inset-inline-start: 0;
|
|
55
55
|
height: auto;
|
|
56
56
|
margin-top: var(--s-m);
|
|
57
57
|
padding-block-start: map.get(
|
|
@@ -73,8 +73,8 @@ $language-list: null !default;
|
|
|
73
73
|
#{map.get($language-list, 'container-padding-mobile', 'inline-end')} +
|
|
74
74
|
#{map.get($language-list, 'item-active-border-width')}
|
|
75
75
|
);
|
|
76
|
+
inset-inline-end: 0;
|
|
76
77
|
position: absolute;
|
|
77
|
-
right: 0;
|
|
78
78
|
width: auto;
|
|
79
79
|
z-index: map.get($theme, 'z-index', 'overlay');
|
|
80
80
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ecl/site-header",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "5.0.0-
|
|
5
|
+
"version": "5.0.0-RC3",
|
|
6
6
|
"description": "ECL Site Header",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -10,21 +10,22 @@
|
|
|
10
10
|
"main": "site-header.js",
|
|
11
11
|
"module": "site-header.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@ecl/button": "5.0.0-
|
|
14
|
-
"@ecl/dom-utils": "5.0.0-
|
|
15
|
-
"@ecl/
|
|
16
|
-
"@ecl/
|
|
17
|
-
"@ecl/
|
|
18
|
-
"@ecl/menu": "5.0.0-
|
|
19
|
-
"@ecl/
|
|
20
|
-
"@ecl/
|
|
21
|
-
"@ecl/
|
|
22
|
-
"
|
|
23
|
-
"focus-trap": "8.0.0"
|
|
13
|
+
"@ecl/button": "5.0.0-RC3",
|
|
14
|
+
"@ecl/dom-utils": "5.0.0-RC3",
|
|
15
|
+
"@ecl/icon": "5.0.0-RC3",
|
|
16
|
+
"@ecl/link": "5.0.0-RC3",
|
|
17
|
+
"@ecl/mega-menu": "5.0.0-RC3",
|
|
18
|
+
"@ecl/menu": "5.0.0-RC3",
|
|
19
|
+
"@ecl/notification": "5.0.0-RC3",
|
|
20
|
+
"@ecl/picture": "5.0.0-RC3",
|
|
21
|
+
"@ecl/search-form": "5.0.0-RC3",
|
|
22
|
+
"focus-trap": "8.0.1"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@ecl/
|
|
27
|
-
"@ecl/
|
|
25
|
+
"@ecl/grid": "5.0.0-RC3",
|
|
26
|
+
"@ecl/mixins-typography": "5.0.0-RC3",
|
|
27
|
+
"@ecl/resources-ec-logo": "5.0.0-RC3",
|
|
28
|
+
"@ecl/resources-eu-logo": "5.0.0-RC3"
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
@@ -40,5 +41,5 @@
|
|
|
40
41
|
"design-system",
|
|
41
42
|
"twig"
|
|
42
43
|
],
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "83f271fac12538193d99ae7444c5cbd3ab2c40a5"
|
|
44
45
|
}
|
package/site-header-ec.scss
CHANGED
|
@@ -20,7 +20,6 @@ $language-list: null !default;
|
|
|
20
20
|
|
|
21
21
|
.ecl-site-header {
|
|
22
22
|
background-color: map.get($site-header, 'background-color');
|
|
23
|
-
background-image: url('https://d2o9p5vky89u4e.cloudfront.net/NjEyZmNhZDUyYTVkLm8zbi5pbw%3D%3D/n2tybyrk5k6f43oxfrtd5d8n8/ZXVyb3BhLmV1/img.gif');
|
|
24
23
|
margin: 0;
|
|
25
24
|
position: relative;
|
|
26
25
|
z-index: map.get($theme, 'z-index', 'modal');
|
|
@@ -30,13 +29,8 @@ $language-list: null !default;
|
|
|
30
29
|
bottom: 0;
|
|
31
30
|
padding: 0;
|
|
32
31
|
position: absolute;
|
|
33
|
-
|
|
32
|
+
inset-inline-end: 0;
|
|
34
33
|
width: 100%;
|
|
35
|
-
|
|
36
|
-
&:dir(rtl) {
|
|
37
|
-
left: 0;
|
|
38
|
-
right: auto;
|
|
39
|
-
}
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
.ecl-menu__open,
|
|
@@ -46,10 +40,6 @@ $language-list: null !default;
|
|
|
46
40
|
z-index: 54;
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
.ecl-mega-menu--rtl .ecl-mega-menu__open {
|
|
50
|
-
margin-inline-start: var(--s-m);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
43
|
.ecl-site-header__cta {
|
|
54
44
|
margin-top: var(--s-s);
|
|
55
45
|
position: relative;
|
|
@@ -146,8 +136,8 @@ $language-list: null !default;
|
|
|
146
136
|
}
|
|
147
137
|
|
|
148
138
|
.ecl-indicator:not(:empty) {
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
inset-inline-start: -18px;
|
|
140
|
+
inset-inline-end: auto;
|
|
151
141
|
}
|
|
152
142
|
}
|
|
153
143
|
|
|
@@ -181,8 +171,9 @@ $language-list: null !default;
|
|
|
181
171
|
&::before {
|
|
182
172
|
@include site-header-dropdown.arrow-up;
|
|
183
173
|
|
|
184
|
-
left:
|
|
185
|
-
|
|
174
|
+
left: var(--ecl-login-arrow-position);
|
|
175
|
+
margin-left: 0;
|
|
176
|
+
right: auto;
|
|
186
177
|
}
|
|
187
178
|
|
|
188
179
|
&.ecl-site-header__login-box--active {
|
|
@@ -217,8 +208,9 @@ $language-list: null !default;
|
|
|
217
208
|
&::before {
|
|
218
209
|
@include site-header-dropdown.arrow-up;
|
|
219
210
|
|
|
220
|
-
left:
|
|
221
|
-
|
|
211
|
+
left: var(--ecl-search-arrow-position);
|
|
212
|
+
margin-left: 0;
|
|
213
|
+
right: auto;
|
|
222
214
|
}
|
|
223
215
|
}
|
|
224
216
|
|
|
@@ -269,26 +261,16 @@ $menu-top: calc(44px + 2 * var(--s-xs));
|
|
|
269
261
|
bottom: auto;
|
|
270
262
|
padding: 0;
|
|
271
263
|
position: absolute;
|
|
272
|
-
right: 0;
|
|
273
264
|
top: 2.5rem;
|
|
274
|
-
width: calc(44px + var(--s-l) * 2);
|
|
275
|
-
}
|
|
276
265
|
|
|
277
|
-
|
|
278
|
-
|
|
266
|
+
// 44px as the other buttons
|
|
267
|
+
width: 2.75rem;
|
|
279
268
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
right: auto;
|
|
283
|
-
}
|
|
269
|
+
// container's padding inline end
|
|
270
|
+
inset-inline-end: var(--s-m);
|
|
284
271
|
}
|
|
285
|
-
// stylelint-enable no-descending-specificity
|
|
286
272
|
|
|
287
|
-
|
|
288
|
-
.ecl-site-header .ecl-menu--rtl {
|
|
289
|
-
left: 0;
|
|
290
|
-
right: auto;
|
|
291
|
-
}
|
|
273
|
+
// stylelint-enable no-descending-specificity
|
|
292
274
|
|
|
293
275
|
.ecl-site-header .ecl-menu__overlay,
|
|
294
276
|
.ecl-site-header .ecl-menu__inner,
|
|
@@ -352,9 +334,10 @@ $menu-top: calc(44px + 2 * var(--s-xs));
|
|
|
352
334
|
}
|
|
353
335
|
/* stylelint-disable-next-line plugin/selector-bem-pattern */
|
|
354
336
|
.ecl-site-header {
|
|
355
|
-
.ecl-
|
|
356
|
-
.ecl-menu {
|
|
357
|
-
|
|
337
|
+
.ecl-menu,
|
|
338
|
+
.ecl-mega-menu {
|
|
339
|
+
// container's padding inline end
|
|
340
|
+
inset-inline-end: var(--s-xl);
|
|
358
341
|
}
|
|
359
342
|
|
|
360
343
|
.ecl-search-form {
|
|
@@ -391,12 +374,12 @@ $menu-top: calc(44px + 2 * var(--s-xs));
|
|
|
391
374
|
|
|
392
375
|
.ecl-mega-menu {
|
|
393
376
|
position: relative;
|
|
394
|
-
|
|
377
|
+
inset-inline-end: 0;
|
|
395
378
|
top: 0;
|
|
396
379
|
width: 100%;
|
|
397
380
|
|
|
398
381
|
&.ecl-mega-menu--rtl {
|
|
399
|
-
|
|
382
|
+
inset-inline-end: 0;
|
|
400
383
|
}
|
|
401
384
|
}
|
|
402
385
|
|
package/site-header-eu.scss
CHANGED
|
@@ -19,7 +19,6 @@ $language-list: null !default;
|
|
|
19
19
|
|
|
20
20
|
.ecl-site-header {
|
|
21
21
|
background-color: map.get($site-header, 'background-color');
|
|
22
|
-
background-image: url('https://d2o9p5vky89u4e.cloudfront.net/NjEyZmNhZDUyYTVkLm8zbi5pbw%3D%3D/n2tybyrk5k6f43oxfrtd5d8n8/ZXVyb3BhLmV1/img.gif');
|
|
23
22
|
margin: 0;
|
|
24
23
|
position: relative;
|
|
25
24
|
z-index: map.get($theme, 'z-index', 'modal');
|
|
@@ -42,13 +41,8 @@ $language-list: null !default;
|
|
|
42
41
|
top: var(--s-m);
|
|
43
42
|
padding: 0;
|
|
44
43
|
position: absolute;
|
|
45
|
-
|
|
46
|
-
width:
|
|
47
|
-
|
|
48
|
-
&:dir(rtl) {
|
|
49
|
-
left: 0;
|
|
50
|
-
right: auto;
|
|
51
|
-
}
|
|
44
|
+
inset-inline-end: var(--s-m);
|
|
45
|
+
width: 44px;
|
|
52
46
|
}
|
|
53
47
|
|
|
54
48
|
.ecl-site-header__cta {
|
|
@@ -111,10 +105,6 @@ $language-list: null !default;
|
|
|
111
105
|
width: 1.5rem;
|
|
112
106
|
}
|
|
113
107
|
|
|
114
|
-
.ecl-mega-menu__open {
|
|
115
|
-
margin-inline-start: var(--s-m);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
108
|
.ecl-menu[data-expanded] .ecl-menu__open,
|
|
119
109
|
.ecl-mega-menu[data-expanded] .ecl-mega-menu__open {
|
|
120
110
|
background-color: var(--c-p-20);
|
|
@@ -210,8 +200,9 @@ $language-list: null !default;
|
|
|
210
200
|
&::before {
|
|
211
201
|
@include site-header-dropdown.arrow-up;
|
|
212
202
|
|
|
213
|
-
left:
|
|
214
|
-
|
|
203
|
+
left: var(--ecl-login-arrow-position);
|
|
204
|
+
margin-left: 0;
|
|
205
|
+
right: auto;
|
|
215
206
|
}
|
|
216
207
|
|
|
217
208
|
&.ecl-site-header__login-box--active {
|
|
@@ -262,8 +253,8 @@ $language-list: null !default;
|
|
|
262
253
|
}
|
|
263
254
|
|
|
264
255
|
.ecl-indicator:not(:empty) {
|
|
265
|
-
|
|
266
|
-
|
|
256
|
+
inset-inline-start: -18px;
|
|
257
|
+
inset-inline-end: auto;
|
|
267
258
|
}
|
|
268
259
|
}
|
|
269
260
|
|
|
@@ -275,8 +266,9 @@ $language-list: null !default;
|
|
|
275
266
|
&::before {
|
|
276
267
|
@include site-header-dropdown.arrow-up;
|
|
277
268
|
|
|
278
|
-
left:
|
|
279
|
-
|
|
269
|
+
left: var(--ecl-search-arrow-position);
|
|
270
|
+
margin-left: 0;
|
|
271
|
+
right: auto;
|
|
280
272
|
}
|
|
281
273
|
}
|
|
282
274
|
}
|
|
@@ -337,6 +329,14 @@ $language-list: null !default;
|
|
|
337
329
|
}
|
|
338
330
|
// stylelint-enable plugin/selector-bem-pattern
|
|
339
331
|
|
|
332
|
+
@include breakpoints.up('m') {
|
|
333
|
+
.ecl-site-header .ecl-menu,
|
|
334
|
+
.ecl-site-header .ecl-mega-menu {
|
|
335
|
+
// container's padding-inline-end
|
|
336
|
+
inset-inline-end: var(--s-l);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
340
|
@include breakpoints.down('l') {
|
|
341
341
|
.ecl-site-header__custom-action-toggle,
|
|
342
342
|
.ecl-site-header__login-toggle,
|
|
@@ -407,12 +407,14 @@ $language-list: null !default;
|
|
|
407
407
|
background: map.get($site-header, 'gradient-background');
|
|
408
408
|
min-height: auto;
|
|
409
409
|
position: static;
|
|
410
|
+
inset-inline-end: 0;
|
|
410
411
|
width: 100%;
|
|
411
412
|
}
|
|
412
413
|
|
|
413
414
|
.ecl-mega-menu {
|
|
414
415
|
background: map.get($site-header, 'gradient-background');
|
|
415
416
|
position: relative;
|
|
417
|
+
inset-inline-end: 0;
|
|
416
418
|
top: 0;
|
|
417
419
|
width: 100%;
|
|
418
420
|
}
|
package/site-header.js
CHANGED
|
@@ -570,12 +570,11 @@ export class SiteHeader {
|
|
|
570
570
|
|
|
571
571
|
setLoginArrow() {
|
|
572
572
|
const loginRect = this.loginBox.getBoundingClientRect();
|
|
573
|
-
|
|
573
|
+
const clientWidth = document.documentElement.clientWidth;
|
|
574
|
+
if (loginRect.width >= clientWidth - 1) {
|
|
574
575
|
const loginToggleRect = this.loginToggle.getBoundingClientRect();
|
|
575
576
|
const arrowPosition =
|
|
576
|
-
|
|
577
|
-
loginToggleRect.right +
|
|
578
|
-
loginToggleRect.width / 2;
|
|
577
|
+
loginToggleRect.left - loginRect.left + loginToggleRect.width / 2;
|
|
579
578
|
|
|
580
579
|
this.loginBox.style.setProperty(
|
|
581
580
|
'--ecl-login-arrow-position',
|
|
@@ -586,12 +585,11 @@ export class SiteHeader {
|
|
|
586
585
|
|
|
587
586
|
setSearchArrow() {
|
|
588
587
|
const searchRect = this.searchForm.getBoundingClientRect();
|
|
589
|
-
|
|
588
|
+
const clientWidth = document.documentElement.clientWidth;
|
|
589
|
+
if (searchRect.width >= clientWidth - 1) {
|
|
590
590
|
const searchToggleRect = this.searchToggle.getBoundingClientRect();
|
|
591
591
|
const arrowPosition =
|
|
592
|
-
|
|
593
|
-
searchToggleRect.right +
|
|
594
|
-
searchToggleRect.width / 2;
|
|
592
|
+
searchToggleRect.left - searchRect.left + searchToggleRect.width / 2;
|
|
595
593
|
|
|
596
594
|
this.searchForm.style.setProperty(
|
|
597
595
|
'--ecl-search-arrow-position',
|