@ecl/site-header 5.0.0-RC2 → 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 -16
- package/site-header-ec.scss +20 -36
- package/site-header-eu.scss +20 -17
- 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,22 +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/
|
|
19
|
-
"@ecl/
|
|
20
|
-
"@ecl/
|
|
21
|
-
"@ecl/
|
|
22
|
-
"
|
|
23
|
-
"@ecl/search-form": "5.0.0-RC2",
|
|
24
|
-
"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"
|
|
25
23
|
},
|
|
26
24
|
"devDependencies": {
|
|
27
|
-
"@ecl/
|
|
28
|
-
"@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"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"design-system",
|
|
42
42
|
"twig"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "83f271fac12538193d99ae7444c5cbd3ab2c40a5"
|
|
45
45
|
}
|
package/site-header-ec.scss
CHANGED
|
@@ -29,13 +29,8 @@ $language-list: null !default;
|
|
|
29
29
|
bottom: 0;
|
|
30
30
|
padding: 0;
|
|
31
31
|
position: absolute;
|
|
32
|
-
|
|
32
|
+
inset-inline-end: 0;
|
|
33
33
|
width: 100%;
|
|
34
|
-
|
|
35
|
-
&:dir(rtl) {
|
|
36
|
-
left: 0;
|
|
37
|
-
right: auto;
|
|
38
|
-
}
|
|
39
34
|
}
|
|
40
35
|
|
|
41
36
|
.ecl-menu__open,
|
|
@@ -45,10 +40,6 @@ $language-list: null !default;
|
|
|
45
40
|
z-index: 54;
|
|
46
41
|
}
|
|
47
42
|
|
|
48
|
-
.ecl-mega-menu--rtl .ecl-mega-menu__open {
|
|
49
|
-
margin-inline-start: var(--s-m);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
43
|
.ecl-site-header__cta {
|
|
53
44
|
margin-top: var(--s-s);
|
|
54
45
|
position: relative;
|
|
@@ -145,8 +136,8 @@ $language-list: null !default;
|
|
|
145
136
|
}
|
|
146
137
|
|
|
147
138
|
.ecl-indicator:not(:empty) {
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
inset-inline-start: -18px;
|
|
140
|
+
inset-inline-end: auto;
|
|
150
141
|
}
|
|
151
142
|
}
|
|
152
143
|
|
|
@@ -180,8 +171,9 @@ $language-list: null !default;
|
|
|
180
171
|
&::before {
|
|
181
172
|
@include site-header-dropdown.arrow-up;
|
|
182
173
|
|
|
183
|
-
left:
|
|
184
|
-
|
|
174
|
+
left: var(--ecl-login-arrow-position);
|
|
175
|
+
margin-left: 0;
|
|
176
|
+
right: auto;
|
|
185
177
|
}
|
|
186
178
|
|
|
187
179
|
&.ecl-site-header__login-box--active {
|
|
@@ -216,8 +208,9 @@ $language-list: null !default;
|
|
|
216
208
|
&::before {
|
|
217
209
|
@include site-header-dropdown.arrow-up;
|
|
218
210
|
|
|
219
|
-
left:
|
|
220
|
-
|
|
211
|
+
left: var(--ecl-search-arrow-position);
|
|
212
|
+
margin-left: 0;
|
|
213
|
+
right: auto;
|
|
221
214
|
}
|
|
222
215
|
}
|
|
223
216
|
|
|
@@ -268,26 +261,16 @@ $menu-top: calc(44px + 2 * var(--s-xs));
|
|
|
268
261
|
bottom: auto;
|
|
269
262
|
padding: 0;
|
|
270
263
|
position: absolute;
|
|
271
|
-
right: 0;
|
|
272
264
|
top: 2.5rem;
|
|
273
|
-
width: calc(44px + var(--s-l) * 2);
|
|
274
|
-
}
|
|
275
265
|
|
|
276
|
-
|
|
277
|
-
|
|
266
|
+
// 44px as the other buttons
|
|
267
|
+
width: 2.75rem;
|
|
278
268
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
right: auto;
|
|
282
|
-
}
|
|
269
|
+
// container's padding inline end
|
|
270
|
+
inset-inline-end: var(--s-m);
|
|
283
271
|
}
|
|
284
|
-
// stylelint-enable no-descending-specificity
|
|
285
272
|
|
|
286
|
-
|
|
287
|
-
.ecl-site-header .ecl-menu--rtl {
|
|
288
|
-
left: 0;
|
|
289
|
-
right: auto;
|
|
290
|
-
}
|
|
273
|
+
// stylelint-enable no-descending-specificity
|
|
291
274
|
|
|
292
275
|
.ecl-site-header .ecl-menu__overlay,
|
|
293
276
|
.ecl-site-header .ecl-menu__inner,
|
|
@@ -351,9 +334,10 @@ $menu-top: calc(44px + 2 * var(--s-xs));
|
|
|
351
334
|
}
|
|
352
335
|
/* stylelint-disable-next-line plugin/selector-bem-pattern */
|
|
353
336
|
.ecl-site-header {
|
|
354
|
-
.ecl-
|
|
355
|
-
.ecl-menu {
|
|
356
|
-
|
|
337
|
+
.ecl-menu,
|
|
338
|
+
.ecl-mega-menu {
|
|
339
|
+
// container's padding inline end
|
|
340
|
+
inset-inline-end: var(--s-xl);
|
|
357
341
|
}
|
|
358
342
|
|
|
359
343
|
.ecl-search-form {
|
|
@@ -390,12 +374,12 @@ $menu-top: calc(44px + 2 * var(--s-xs));
|
|
|
390
374
|
|
|
391
375
|
.ecl-mega-menu {
|
|
392
376
|
position: relative;
|
|
393
|
-
|
|
377
|
+
inset-inline-end: 0;
|
|
394
378
|
top: 0;
|
|
395
379
|
width: 100%;
|
|
396
380
|
|
|
397
381
|
&.ecl-mega-menu--rtl {
|
|
398
|
-
|
|
382
|
+
inset-inline-end: 0;
|
|
399
383
|
}
|
|
400
384
|
}
|
|
401
385
|
|
package/site-header-eu.scss
CHANGED
|
@@ -41,13 +41,8 @@ $language-list: null !default;
|
|
|
41
41
|
top: var(--s-m);
|
|
42
42
|
padding: 0;
|
|
43
43
|
position: absolute;
|
|
44
|
-
|
|
45
|
-
width:
|
|
46
|
-
|
|
47
|
-
&:dir(rtl) {
|
|
48
|
-
left: 0;
|
|
49
|
-
right: auto;
|
|
50
|
-
}
|
|
44
|
+
inset-inline-end: var(--s-m);
|
|
45
|
+
width: 44px;
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
.ecl-site-header__cta {
|
|
@@ -110,10 +105,6 @@ $language-list: null !default;
|
|
|
110
105
|
width: 1.5rem;
|
|
111
106
|
}
|
|
112
107
|
|
|
113
|
-
.ecl-mega-menu__open {
|
|
114
|
-
margin-inline-start: var(--s-m);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
108
|
.ecl-menu[data-expanded] .ecl-menu__open,
|
|
118
109
|
.ecl-mega-menu[data-expanded] .ecl-mega-menu__open {
|
|
119
110
|
background-color: var(--c-p-20);
|
|
@@ -209,8 +200,9 @@ $language-list: null !default;
|
|
|
209
200
|
&::before {
|
|
210
201
|
@include site-header-dropdown.arrow-up;
|
|
211
202
|
|
|
212
|
-
left:
|
|
213
|
-
|
|
203
|
+
left: var(--ecl-login-arrow-position);
|
|
204
|
+
margin-left: 0;
|
|
205
|
+
right: auto;
|
|
214
206
|
}
|
|
215
207
|
|
|
216
208
|
&.ecl-site-header__login-box--active {
|
|
@@ -261,8 +253,8 @@ $language-list: null !default;
|
|
|
261
253
|
}
|
|
262
254
|
|
|
263
255
|
.ecl-indicator:not(:empty) {
|
|
264
|
-
|
|
265
|
-
|
|
256
|
+
inset-inline-start: -18px;
|
|
257
|
+
inset-inline-end: auto;
|
|
266
258
|
}
|
|
267
259
|
}
|
|
268
260
|
|
|
@@ -274,8 +266,9 @@ $language-list: null !default;
|
|
|
274
266
|
&::before {
|
|
275
267
|
@include site-header-dropdown.arrow-up;
|
|
276
268
|
|
|
277
|
-
left:
|
|
278
|
-
|
|
269
|
+
left: var(--ecl-search-arrow-position);
|
|
270
|
+
margin-left: 0;
|
|
271
|
+
right: auto;
|
|
279
272
|
}
|
|
280
273
|
}
|
|
281
274
|
}
|
|
@@ -336,6 +329,14 @@ $language-list: null !default;
|
|
|
336
329
|
}
|
|
337
330
|
// stylelint-enable plugin/selector-bem-pattern
|
|
338
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
|
+
|
|
339
340
|
@include breakpoints.down('l') {
|
|
340
341
|
.ecl-site-header__custom-action-toggle,
|
|
341
342
|
.ecl-site-header__login-toggle,
|
|
@@ -406,12 +407,14 @@ $language-list: null !default;
|
|
|
406
407
|
background: map.get($site-header, 'gradient-background');
|
|
407
408
|
min-height: auto;
|
|
408
409
|
position: static;
|
|
410
|
+
inset-inline-end: 0;
|
|
409
411
|
width: 100%;
|
|
410
412
|
}
|
|
411
413
|
|
|
412
414
|
.ecl-mega-menu {
|
|
413
415
|
background: map.get($site-header, 'gradient-background');
|
|
414
416
|
position: relative;
|
|
417
|
+
inset-inline-end: 0;
|
|
415
418
|
top: 0;
|
|
416
419
|
width: 100%;
|
|
417
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',
|