@foeewni/web-core 3.0.0-alpha.14 → 3.0.0-alpha.16

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.
@@ -289,6 +289,7 @@ The parallax effect needs the file `foe.components.js` to be appended in the pag
289
289
 
290
290
  &[data-jaunt-factor] {
291
291
  border: none;
292
+ border-color: $foe-primary;
292
293
  padding: $spacer;
293
294
 
294
295
  &::before {
@@ -31,7 +31,8 @@
31
31
  }
32
32
  }
33
33
 
34
- .bg-primary {
34
+ .bg-primary,
35
+ .bg-secondary {
35
36
  background-color: $foe-leaf-75 !important;
36
37
 
37
38
  @include heading_colours($foe-extradark, $foe-extradark);
@@ -83,3 +84,21 @@
83
84
  @include button-outline-variant($foe-offwhite);
84
85
  }
85
86
  }
87
+
88
+ .bg-light,
89
+ .bg-white {
90
+ background-color: $foe-offwhite !important;
91
+
92
+ @include heading_colours($foe-accent, $foe-accent);
93
+ @include text_colours($foe-accent, $foe-accent);
94
+
95
+ .btn-primary,
96
+ .foe-cta {
97
+ @include button-variant($foe-accent, $foe-accent);
98
+ }
99
+
100
+ .btn-outline-primary,
101
+ .btn-secondary {
102
+ @include button-outline-variant($foe-accent);
103
+ }
104
+ }
@@ -13,15 +13,22 @@
13
13
  padding: 0;
14
14
  z-index: $zindex-navbar !important;
15
15
  background-color: $foe-leaf-75;
16
+ color: $foe-extradark;
16
17
  transition:
17
18
  background-color $foe-transition-duration-base $foe-transition-easing,
18
19
  background-position $foe-transition-duration-base $foe-transition-easing,
19
20
  box-shadow $foe-transition-duration-base $foe-transition-easing,
20
21
  padding $foe-transition-duration-base $foe-transition-easing;
21
22
 
23
+ .navbar-toggler {
24
+ .icon-close,
25
+ .icon-bar {
26
+ background-color: $foe-extradark;
27
+ }
28
+ }
29
+
22
30
  &.js-menustack {
23
31
  position: fixed;
24
- color: $foe-offwhite;
25
32
  z-index: $zindex-navbar + 10 !important;
26
33
 
27
34
  // Scrolled state
@@ -62,13 +69,6 @@
62
69
  right: 0;
63
70
  }
64
71
 
65
- @include media-breakpoint-down(md) {
66
- padding-left: calc($grid-gutter-width / 2) !important;
67
- padding-right: calc($grid-gutter-width / 2) !important;
68
- // #13294 Fixing the mobile navigation (with overflow:hidden the mobile search does not display below the navigation)
69
- // overflow: hidden;
70
- }
71
-
72
72
  // Scrolled state
73
73
  &.js-menustack-stuck {
74
74
  padding: 0;
@@ -77,5 +77,26 @@
77
77
  body.foe-page-has-campaign-nav & {
78
78
  box-shadow: none;
79
79
  }
80
+
81
+ @include media-breakpoint-up(lg) {
82
+ .foe-nav-cta a {
83
+ @include margin-vertical-align($foe-nav-height-large-scrolled, $foe-nav-cta-height-large);
84
+ }
85
+
86
+ ul.navbar-nav > li > a {
87
+ line-height: $foe-nav-height-large-scrolled;
88
+ }
89
+ }
90
+ }
91
+
92
+ .skip-link:focus-within + * &.js-menustack {
93
+ top: 1.5rem;
94
+ }
95
+
96
+ @include media-breakpoint-down(md) {
97
+ padding-left: calc($grid-gutter-width / 2) !important;
98
+ padding-right: calc($grid-gutter-width / 2) !important;
99
+ // #13294 Fixing the mobile navigation (with overflow:hidden the mobile search does not display below the navigation)
100
+ // overflow: hidden;
80
101
  }
81
102
  }
@@ -17,10 +17,22 @@
17
17
  visibility 0s $foe-transition-easing $foe-transition-duration-base,
18
18
  opacity $foe-transition-duration-base $foe-transition-easing;
19
19
 
20
+ @include media-breakpoint-up(lg) { // Megamenus are only applicable on larger viewports. They appear as a list on smaller screens
21
+ display: block;
22
+ padding-top: $foe-submenu-margin;
23
+ padding-bottom: $foe-submenu-margin;
24
+ }
25
+
20
26
  @include media-breakpoint-up(md) { // Megamenus are only applicable on larger viewports.
21
27
  display: block;
22
28
  }
23
29
 
30
+ > .container {
31
+ @include media-breakpoint-up(md) {
32
+ justify-content: flex-end;
33
+ }
34
+ }
35
+
24
36
  &.megamenu-search { // Allow the search "megamenu" to persist at smaller breakpoints
25
37
  @include media-breakpoint-up(sm) {
26
38
  display: block;
@@ -40,6 +52,10 @@
40
52
 
41
53
  > .container > .row {
42
54
  width: 100%;
55
+
56
+ @include media-breakpoint-up(md) {
57
+ justify-content: flex-end;
58
+ }
43
59
  }
44
60
  }
45
61
 
@@ -181,3 +197,76 @@
181
197
  }
182
198
  }
183
199
  }
200
+
201
+ ul.navbar-nav.menu-main {
202
+ .foe-mega-menu {
203
+ .submenu-block {
204
+ ul.sub-megamenu-first {
205
+ column-gap: 0;
206
+ overflow: hidden;
207
+ height: auto; /* $foe-submenu-tile-height; */
208
+ display: flex;
209
+ flex-direction: column;
210
+ list-style: none;
211
+ padding-left: .5rem;
212
+ padding-bottom: .5rem;
213
+
214
+ @include media-breakpoint-up(lg) {
215
+ align-items: end;
216
+ }
217
+
218
+ > li {
219
+ &.sub-item {
220
+ width: 100%;
221
+ padding: .125rem;
222
+ }
223
+
224
+ > span {
225
+ line-height: calc($foe-submenu-tile-height / 4);
226
+ font-weight: 500;
227
+ color: $foe-gray;
228
+ }
229
+
230
+ > a {
231
+ line-height: calc($foe-submenu-tile-height / 4 - 0.4rem);
232
+ font-weight: 600;
233
+ color: $foe-extradark;
234
+ transition: color 400ms ease-in-out;
235
+
236
+ @include media-breakpoint-up(md) {
237
+ padding-right: 0;
238
+ }
239
+
240
+ &:hover {
241
+ color: $foe-extradark;
242
+ box-shadow: none;
243
+ }
244
+ }
245
+
246
+ ul.sub-megamenu-below {
247
+ padding-left: 0;
248
+ display: flex;
249
+ flex-direction: column;
250
+
251
+ @include media-breakpoint-down(md) {
252
+ display: none;
253
+ }
254
+
255
+ li.sub-item {
256
+ a {
257
+ color: $foe-text;
258
+ font-weight: 500;
259
+ line-height: 1.8rem;
260
+
261
+ &:hover {
262
+ color: $foe-extradark;
263
+ box-shadow: none;
264
+ }
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+ }
@@ -38,11 +38,6 @@
38
38
  display: block;
39
39
  color: $foe-extradark;
40
40
  text-decoration: none;
41
- box-shadow: inset 0 0 0 0 $foe-accent;
42
- transition:
43
- color $foe-transition-duration-base ease-in-out,
44
- box-shadow $foe-transition-duration-base ease-in-out;
45
- // transition: line-height $foe-transition-duration-base $foe-transition-easing, color $foe-transition-duration-base $foe-transition-easing;
46
41
 
47
42
  @include media-breakpoint-up(lg) {
48
43
  padding: 0 18px;
@@ -58,7 +53,6 @@
58
53
 
59
54
  &:hover {
60
55
  color: $foe-offwhite;
61
- box-shadow: inset 10rem 0 0 0 $foe-accent;
62
56
  text-decoration: none;
63
57
  }
64
58
  }
@@ -90,16 +84,110 @@
90
84
  }
91
85
  }
92
86
  }
93
- }
94
87
 
95
- @include media-breakpoint-up(lg) {
96
- &.js-menustack-stuck {
97
- .foe-nav-cta a {
98
- @include margin-vertical-align($foe-nav-height-large-scrolled, $foe-nav-cta-height-large);
88
+ > li {
89
+ > a {
90
+ background: linear-gradient(90deg, $foe-accent 0%, $foe-accent 50%, transparent 50%, transparent 100%);
91
+ background-size: 200% 100%;
92
+ background-position: 101% 50%;
93
+ background-repeat: no-repeat;
94
+ transition:
95
+ color $foe-transition-duration-base ease-in-out,
96
+ background-position $foe-transition-duration-base ease-in-out;
97
+
98
+ &:hover {
99
+ background-position: 0% 50%;
100
+ }
101
+ }
102
+ }
103
+
104
+ &.menu-main {
105
+ display: block;
106
+ width: auto;
107
+ float: right;
108
+ padding: 0;
109
+ line-height: 4rem;
110
+
111
+ @include media-breakpoint-down(md) {
112
+ width: 100%;
113
+ overflow: hidden;
114
+ // #13294 this should be covered by the styles on web-core 3.0.0
115
+ transition: max-height $foe-transition-duration-base*2 $foe-transition-easing;
99
116
  }
100
117
 
101
- ul.navbar-nav > li > a {
102
- line-height: $foe-nav-height-large-scrolled;
118
+ li.foe-has-megamenu {
119
+ &:focus-within,
120
+ &:hover {
121
+ .foe-megamenu-container {
122
+ display: block;
123
+ }
124
+
125
+ a + .open-megamenu {
126
+ &::after {
127
+ transform: rotate(45deg);
128
+ -webkit-transform: rotate(45deg);
129
+ }
130
+ }
131
+ }
132
+
133
+ div.foe-megamenu-container {
134
+ &.collapsed {
135
+ display: none;
136
+ }
137
+
138
+ &.un-collapsed {
139
+ opacity: 1;
140
+ visibility: visible;
141
+ display: block;
142
+ }
143
+ }
144
+
145
+ @include media-breakpoint-down(md) {
146
+ a {
147
+ display: inline-block;
148
+
149
+ &.is-active {
150
+ &::after {
151
+ transform: rotate(45deg);
152
+ -webkit-transform: rotate(45deg);
153
+ }
154
+ }
155
+
156
+ & + .open-megamenu {
157
+ padding: 1rem;
158
+
159
+ &::after {
160
+ position: relative;
161
+ content: '';
162
+ opacity: 1;
163
+ border: solid $foe-extradark;
164
+ border-width: 0 3px 3px 0;
165
+ display: inline-block;
166
+ padding: 3px;
167
+ transform: rotate(-45deg);
168
+ -webkit-transform: rotate(-45deg);
169
+ margin-left: .5rem;
170
+ left: 0;
171
+ bottom: .05rem;
172
+ }
173
+ }
174
+ }
175
+
176
+ div.foe-megamenu-container { /* just for mobile menu */
177
+ position: relative;
178
+ background-color: transparent;
179
+ box-shadow: none;
180
+
181
+ li.foe-has-megamenu {
182
+ &:focus-within,
183
+ &:hover {
184
+ .foe-megamenu-container {
185
+ display: block;
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
103
191
  }
104
192
  }
105
193
  }
@@ -151,10 +151,10 @@ https://www.bennadel.com/blog/4310-detecting-rendered-line-breaks-in-a-text-node
151
151
  // modify the direction of jiggle based on modifications
152
152
  switch (mod) {
153
153
  case JIGGLE_LEFT:
154
- xRandom *= -2;
154
+ xRandom *= -1;
155
155
  break;
156
156
  case JIGGLE_RIGHT:
157
- xRandom *= 2;
157
+ xRandom *= 1;
158
158
  break;
159
159
  default:
160
160
  // modify the corners less
@@ -163,10 +163,10 @@ https://www.bennadel.com/blog/4310-detecting-rendered-line-breaks-in-a-text-node
163
163
  }
164
164
  switch (mod) {
165
165
  case JIGGLE_UP:
166
- yRandom *= -2;
166
+ yRandom *= -1;
167
167
  break;
168
168
  case JIGGLE_DOWN:
169
- yRandom *= 2;
169
+ yRandom *= 1;
170
170
  break;
171
171
  default:
172
172
  // modify the corners less
@@ -310,12 +310,12 @@ https://www.bennadel.com/blog/4310-detecting-rendered-line-breaks-in-a-text-node
310
310
  };
311
311
 
312
312
  // The main event
313
- const createBackground = (action = null) => {
313
+ const createBackground = (action = null, context = document) => {
314
314
  oneRemInPx = parseFloat(
315
315
  getComputedStyle(document.documentElement).fontSize
316
316
  );
317
317
 
318
- const targets = document.querySelectorAll('[data-jaunt-factor]');
318
+ const targets = context.querySelectorAll('[data-jaunt-factor]');
319
319
 
320
320
  // Insert some jaunt
321
321
  targets.forEach((target) => {
@@ -335,9 +335,9 @@ https://www.bennadel.com/blog/4310-detecting-rendered-line-breaks-in-a-text-node
335
335
  root: document.documentElement,
336
336
  });
337
337
 
338
- const init = () => {
339
- const targets = document.querySelectorAll('[data-jaunt-factor]');
340
- createBackground('init');
338
+ const init = (context = document) => {
339
+ const targets = context.querySelectorAll('[data-jaunt-factor]');
340
+ createBackground('init', context);
341
341
  targets.forEach((target) => {
342
342
  [
343
343
  'blur',