@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.
@@ -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
- left: 0;
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-RC2",
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-RC2",
14
- "@ecl/dom-utils": "5.0.0-RC2",
15
- "@ecl/grid": "5.0.0-RC2",
16
- "@ecl/icon": "5.0.0-RC2",
17
- "@ecl/link": "5.0.0-RC2",
18
- "@ecl/mega-menu": "5.0.0-RC2",
19
- "@ecl/menu": "5.0.0-RC2",
20
- "@ecl/mixins-typography": "5.0.0-RC2",
21
- "@ecl/notification": "5.0.0-RC2",
22
- "@ecl/picture": "5.0.0-RC2",
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/resources-ec-logo": "5.0.0-RC2",
28
- "@ecl/resources-eu-logo": "5.0.0-RC2"
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": "c6fea2445f9757307ca8d1de1a0f3de098a38abe"
44
+ "gitHead": "83f271fac12538193d99ae7444c5cbd3ab2c40a5"
45
45
  }
@@ -29,13 +29,8 @@ $language-list: null !default;
29
29
  bottom: 0;
30
30
  padding: 0;
31
31
  position: absolute;
32
- right: 0;
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
- left: -18px;
149
- right: auto;
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: auto;
184
- right: var(--ecl-login-arrow-position);
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: auto;
220
- right: var(--ecl-search-arrow-position);
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
- .ecl-site-header .ecl-mega-menu {
277
- right: calc(-1 * var(--s-l));
266
+ // 44px as the other buttons
267
+ width: 2.75rem;
278
268
 
279
- &:dir(rtl) {
280
- left: calc(-1 * var(--s-l));
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
- .ecl-site-header .ecl-mega-menu--rtl,
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-mega-menu,
355
- .ecl-menu {
356
- width: calc(44px + var(--s-xl) * 2);
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
- right: 0;
377
+ inset-inline-end: 0;
394
378
  top: 0;
395
379
  width: 100%;
396
380
 
397
381
  &.ecl-mega-menu--rtl {
398
- right: 0;
382
+ inset-inline-end: 0;
399
383
  }
400
384
  }
401
385
 
@@ -41,13 +41,8 @@ $language-list: null !default;
41
41
  top: var(--s-m);
42
42
  padding: 0;
43
43
  position: absolute;
44
- right: 0;
45
- width: calc(44px + var(--s-m) * 2);
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: auto;
213
- right: var(--ecl-login-arrow-position);
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
- left: -18px;
265
- right: auto;
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: auto;
278
- right: var(--ecl-search-arrow-position);
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
- if (loginRect.x === 0) {
573
+ const clientWidth = document.documentElement.clientWidth;
574
+ if (loginRect.width >= clientWidth - 1) {
574
575
  const loginToggleRect = this.loginToggle.getBoundingClientRect();
575
576
  const arrowPosition =
576
- document.documentElement.clientWidth -
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
- if (searchRect.x === 0) {
588
+ const clientWidth = document.documentElement.clientWidth;
589
+ if (searchRect.width >= clientWidth - 1) {
590
590
  const searchToggleRect = this.searchToggle.getBoundingClientRect();
591
591
  const arrowPosition =
592
- document.documentElement.clientWidth -
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',