_menu--horizontal.scss 18.3 KB
Newer Older
1
2
$menu-horizontal-bg: gesso-grayscale(gray-2);
$menu-horizontal-bar-font: gesso-font-family(book);
3
$menu-horizontal-sub-font: gesso-font-family(system);
4
5
6
$menu-horizontal-sub-font-bold: gesso-font-family(systembold);
$menu-horizontal-bar-font-size: rem(gesso-font-size(-2));
$menu-horizontal-sub-font-size: rem(gesso-font-size(-2));
7
$menu-horizontal-drop-bg: #f7f7f7;
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Colors
$faculties: 'org-default', 'org-ahs', 'org-art', 'org-eng', 'org-env', 'org-mat', 'org-sci', 'org-school';
@each $faculty in $faculties {
  @if $faculty == org-default{
    .#{$faculty} {
      .uw-horizontal-nav {
        .uw-site-home__link{
          background-color:gesso-brand(org-default,uw-black, lvl4);
          svg{
            fill:gesso-brand(org-default,uw-gold,primary);
          }
          &:focus{
            background-color: gesso-brand(org-default,uw-white,lvl1);
            svg{
              fill:gesso-brand(org-default,uw-gold,primary);
            }
          }
          &:hover{
            background-color:gesso-brand(org-default,uw-gold,primary);
            svg{
              fill:gesso-brand(org-default,uw-black, lvl4);
            }
          }
        }

        .menu--horizontal {
34
          > .is-active-trail {
35
36
37
38
39
40
41
42
43
44
45
46
47
            background-color: gesso-grayscale(gray-3);
            color: gesso-brand(org-default, uw-black, lvl4);
            >  .menu--link.active{
              ~ .menu{
                .menu--item{
                  &__parent{
                    a{
                      border-bottom: 1px solid gesso-brand(org-default,uw-black,lvl4);
                    }
                  }
                }
              }
            }
48
          }
49
50
51
          li {
            > a{
              color: gesso-brand(org-default,uw-black,lvl4);
52
              &:focus{
53
54
                background-color:  gesso-grayscale(gray-3);
                color: gesso-brand(org-default,uw-black,lvl4);
55
              }
56
              &.active{
57
58
                background-color:  gesso-grayscale(gray-3);
                color: gesso-brand(org-default,uw-black,lvl4);
59
60
              }
              &:hover{
61
                background-color: gesso-brand(org-default,uw-white,lvl1);
62
63
64
                color: gesso-brand(org-default,uw-black,lvl4);
              }
            }
65
66
            .menu--subnav{
              a{
67
                background-color:transparent;
68
                border-bottom:1px solid transparent;
69
                text-decoration:none;
70
71
                &:focus {
                  background-color: inherit;
72
                  border-bottom: 1px solid  gesso-brand(org-default,uw-black,lvl4);
73
74
                  color: gesso-brand(org-default,uw-black,lvl4);
                }
75
                &.active{
76
                  background-color:inherit;
77
                  border-bottom:1px solid  gesso-brand(org-default,uw-black,lvl4);
78
                  color: gesso-brand(org-default,uw-black,lvl4);
79
80
81
82
83
                  &::after{
                    display:none;
                  }
                  &:hover{
                    background-color:inherit;
84
                    border-bottom:1px solid  gesso-grayscale(gray-3);
85
86
                    color: gesso-brand(org-default,uw-black,lvl4);
                  }
87
                }
88
89
                &:hover{
                  background-color:inherit;
90
                  border-bottom:1px solid  gesso-grayscale(gray-3);
91
92
                  color: gesso-brand(org-default,uw-black,lvl4);
                }
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
              }
            }
          }
        }
      }
    }
  }
  @else {
    .#{$faculty} {
      .uw-horizontal-nav {
        .uw-site-home__link{
          background-color:gesso-brand($faculty, lvl4);
          svg{
            fill:gesso-brand(org-default,uw-white,lvl1);
          }
          &:focus{
            background-color: gesso-brand(org-default,uw-white,lvl1);
            svg{
              fill:gesso-brand($faculty, lvl4);
            }
          }
          &:hover{
            background-color:gesso-brand(org-default,uw-white,lvl1);
            svg{
              fill:gesso-brand($faculty, lvl4);
            }
          }
        }

        .menu--horizontal {
124
          > .is-active-trail {
125
126
127
128
129
130
131
132
133
134
135
136
137
138
            background-color: gesso-grayscale(gray-3);
            color: gesso-brand(org-default, uw-black, lvl4);
            >  .menu--link.active{
              ~ .menu{
                .menu--item{
                  &__parent{
                    a{
                      border-bottom: 1px solid gesso-brand($faculty, lvl4);
                      color: gesso-brand($faculty, lvl4);
                    }
                  }
                }
              }
            }
139
          }
140
141
142
          li {
            > a{
              color: gesso-brand(org-default,uw-black,lvl4);
143
144
145
146
              &:focus{
                background-color:  gesso-grayscale(gray-3);
                color: gesso-brand(org-default,uw-black,lvl4);
              }
147
              &.active{
148
149
                background-color:  gesso-grayscale(gray-3);
                color: gesso-brand(org-default,uw-black,lvl4);
150
151
              }
              &:hover{
152
                background-color: gesso-brand(org-default,uw-white,lvl1);
153
154
155
                color: gesso-brand(org-default,uw-black,lvl4);
              }
            }
156
157
            .menu--subnav{
              a{
158
159
160
                background-color:transparent;
                border-bottom:1px solid transparent;
                text-decoration:none;
161
162
                &:focus {
                  background-color: inherit;
163
                  border-bottom:1px solid gesso-brand($faculty, lvl4);
164
                  color: gesso-brand(org-default,uw-black,lvl4);
165
                }
166
                &.active{
167
                  background-color:inherit;
168
169
170
171
                  border-bottom:1px solid gesso-brand($faculty, lvl4);
                  color: gesso-brand($faculty, lvl4);
                  &::after{
                    display:none;
172
                  }
173
174
                  &:hover{
                    background-color:inherit;
175
                    border-bottom:1px solid  gesso-grayscale(gray-3);
176
177
                    color: gesso-brand(org-default,uw-black,lvl4);
                  }
178
                }
179
180
181
182
183
184
                &:hover{
                  background-color:inherit;
                  border-bottom:1px solid  gesso-grayscale(gray-3);
                  color: gesso-brand(org-default,uw-black,lvl4);
                }

185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
              }
            }
          }
        }
      }
    }
  }
}

.uw-horizontal-nav{
  @include uw-full-width;
  background:$menu-horizontal-bg;
  &--wrapper{
    @include uw-contained-width;
    display:grid;
200
    padding:0;
201
202
203
    position:relative;
    @include medium{
      grid-template-columns: 3rem auto;
204
      padding:0 gesso-spacing(xs);
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
    }

  }
  &--home{
    display:none;
    @include medium{
      display:block;
      grid-column: 1/2;
      padding:gesso-spacing(xxs);
      .uw-site-home__link{
        border:1px solid $menu-horizontal-bg;
        border-radius:50%;
        display:block;
        height:2rem;
        outline:none;
        width:2rem;
        svg{
          height:2rem;
          padding-left:gesso-spacing(xxs);
          padding-top:gesso-spacing(xxs);
          width:2rem;
        }
      }
    }
  }
  &--menu {
    @include uw-full-width;
    @include medium{
      grid-column: 2/3;
    }

    .menu {
237
      margin-left:inherit;
238
239
240
      &--link{
        position:relative;
      }
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
      .menu--item{
        a{
          cursor:pointer;
          outline:none;
          outline-offset: unset;

        }
      }
      // Top Level <ul> flex top items
      &--horizontal {
        @include uw-full-width;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        font-family: $menu-horizontal-bar-font;
        font-size: $menu-horizontal-bar-font-size;
        justify-content: flex-start;
        width: 100%;
        > .menu--item{
260
261
262
263
          border-bottom:1px solid  gesso-grayscale(gray-3);
          @include medium{
            border-bottom:inherit;
          }
264
          width:100%;
265

266
267
268
269
270
271
272
273
          @include medium{
            width:auto;
          }
          a{
            display:inline-block;
            line-height:1.25rem;
            padding:gesso-spacing(xs);
            text-decoration:none;
274
275
            width: 100%;

276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
          }
          &.has-submenu {
            > a{
                padding-right:gesso-spacing(md);
                position:relative;

                &::after {
                  content:'\e906';
                  display:block;
                  font-family: gesso-font-family(iconfont);
                  position:absolute;
                  right:gesso-spacing(xs);
                  text-align: center;
                  top:gesso-spacing(xs);
                  transform: scale(0.75, 0.75);
                 @include medium{
                   transform: scale(0.75, 0.75) rotate(90deg);
                 }
              }
            }
          }
297
298
299
300
          .no-scroll & {
            &[aria-expanded="true"]{

              > a{
301
                border-left:1px solid gesso-grayscale(gray-3);
302
303
304
305
306
307
308
                display:inline-block;
                height:2.25rem;
                overflow:hidden;
                position:absolute;
                right:0;
                top:0;
                width:2rem;
309
310
                // Puts the content at z-index 7
                z-index: gesso-z-index(dropdown);
311
312
313
314
315
316
317
318
319
                span{
                  display:none;
                }
                &::after {
                  transform: scale(0.75, 0.75) rotate(180deg);
                }
              }
            }
          }
320
321
322
323
324
325
326
327
328
        }
      }


      // hide all menus that are classed subnav
      &--subnav {
        display: none;
        font-size: $menu-horizontal-sub-font-size;
        text-transform: none;
329
        width:100%;
330
        li{
331
332
333
          animation: fadeIn ease 0.2s;
        }

334
      }
335
336


337
      .submenu-active {
338
        // Change the height of the tray based on the class assigned by the count of items.
339
        &.has-submenu--small .menu--subnav{
340
            @include medium {
341
              min-height: 12rem;
342
343
            }
          }
344
        &.has-submenu--medium .menu--subnav{
345
          @include medium {
346
            min-height: 24rem;
347
          }
348
        }
349
        &.has-submenu--large .menu--subnav{
350
351
          min-height:50rem;
          @include large {
352
            min-height: 36rem;
353
          }
354
        }
355
        .menu--subnav{
356
          //background: $menu-horizontal-drop-bg;
357
358
359
360
361
          display:block;
          // Figure out better way than 100 vh? double check phones
          height:calc(100vh - 7rem);
          position: absolute;
          top:0;
362
363
          // Puts the dropdown at z-index 7
          z-index: gesso-z-index(dropdown);
364
365
366
367
368
369
          ~ .menu--subnav{
            position: absolute;
            top:inherit;
          }
          @include medium {
            @include uw-contained-width;
370
            //align-items: flex-start;
371
372
            background: $menu-horizontal-drop-bg;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10), 0 6px 6px rgba(0, 0, 0, 0.13);
Martin Leblanc's avatar
Martin Leblanc committed
373
374
375
376
377
378
379
            display: flex;
            flex-flow: wrap;
            flex-direction: row;
            flex-wrap: wrap;
            //display: grid;
            //gap:0.5rem;
            //grid-template-columns: repeat(4, minmax(0,1fr));
380
            height:auto;
381
382
383
384
            left: 3rem;
            overflow-y:inherit;
            padding:2.5rem 0.5rem 1rem;
            top: 100%;
385
            width:calc(100% - 6rem);
386
387
            // Puts the dropdown at z-index 7
            z-index: gesso-z-index(dropdown);
388

389
          }
390

391
392
393
394
395
396
397
398
399
400
401
          .menu--subnav{
            align-items: inherit;
            background:inherit;
            box-shadow:none;
            column-count:inherit;
            display:inherit;
            flex-flow: inherit;
            flex-direction: inherit;
            flex-wrap:inherit;
            height:inherit;
            left:inherit;
402
            margin:0;
403
404
405
406
407
408
409
            max-height:inherit;
            min-height:inherit;
            padding-top:inherit !important;
            position:inherit;
            top:inherit;
            width:inherit;
            z-index:inherit;
410
          }
411

412
          .menu--item{
413
414
            display:block;
            position:relative;
415
416
417
            .menu--subnav{
              padding:0;
            }
418

419
            a{
420
421
              font-family:$menu-horizontal-sub-font-bold;
              font-weight:400;
422
423
424
425
426
427
428
429
430
              padding:gesso-spacing(xs);
              padding-right: 24px;
              .no-scroll &{
                border-bottom:1px solid #e6e6e6;
              }
              @include medium{
                padding:gesso-spacing(xs);

              }
431
            }
432
433
434
435
436
437
438
            .no-scroll & {
              &__parent{
                border-bottom:1px solid #e6e6e6;
                padding:0;
                a{

                  border-bottom: 1px solid transparent;
439

440
                }
441
              }
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
              .menu--item {
                a {
                  font-family:$menu-horizontal-sub-font;
                  font-weight:200;
                  padding-left: gesso-spacing(sm);
                }

                .menu--item {
                  a {
                    font-family:$menu-horizontal-sub-font;
                    font-weight:200;
                    padding-left: gesso-spacing(lg);
                  }
                  .menu--item {
                    a {
                      font-family:$menu-horizontal-sub-font;
                      font-weight:200;
                      padding-left: gesso-spacing(xl);
                    }
                  }
                }
              }
            }
465

466
            @include medium {
Martin Leblanc's avatar
Martin Leblanc committed
467
              flex:1 0 50%;
468
              height:auto;
Martin Leblanc's avatar
Martin Leblanc committed
469
              max-width: 50%;
470
              padding-left: gesso-spacing(xs);
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
              &:nth-of-type(1){
                background: rgba(16, 207, 246, 1);
                &::after{
                  bottom:0;
                  content:'1';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(2){
                background: rgba(232, 25, 95, 1);
                &::after{
                  bottom:0;
                  content:'2';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(3){
                background: rgba(209, 117, 232, 1);
                &::after{
                  bottom:0;
                  content:'3';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(4){
                background: rgba(144, 255, 136, 1);
                &::after{
                  bottom:0;
                  content:'4';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(5){
                background: rgba(255, 201, 136, 1);
                &::after{
                  bottom:0;
                  content:'5';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(6){
                background: rgb(115, 118, 27);
                &::after{
                  bottom:0;
                  content:'6';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(7){
                background: rgb(94, 232, 129);
                &::after{
                  bottom:0;
                  content:'7';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
              &:nth-of-type(8){
                background: rgb(82, 74, 72);
                &::after{
                  bottom:0;
                  content:'8';
                  display: block;
                  position:absolute;
                  right:0;
                }
              }
551
552
553
              .menu--item{
                font-family:$menu-horizontal-sub-font;
                font-weight:200;
554
                margin-top:inherit;
555
                max-width:inherit;
556
                padding-left: gesso-spacing(sm);
557
558
                a{
                  font-family:$menu-horizontal-sub-font;
559
                  padding:gesso-spacing(xxs);
560
                }
561
562
563
564
565
566
567
                .menu--item{
                  margin-top:inherit;
                  padding-left: gesso-spacing(sm);
                  a{
                    font-family:$menu-horizontal-sub-font;
                    font-weight:200;
                  }
568
569
570
571
572
573
574
575
                  .menu--item{
                    margin-top:inherit;
                    padding-left: gesso-spacing(sm);
                    a{
                      font-family:$menu-horizontal-sub-font;
                      font-weight:200;
                    }
                  }
576
                }
577
              }
578

579
580
            }
            @include large {
Martin Leblanc's avatar
Martin Leblanc committed
581
582
583
              flex:1 0 24%;
              height:auto;
              max-width: 24%;
584
585
586
587
588
589
590
591
592
593
594
595
596
597
              padding-left: gesso-spacing(sm);
            }
            &__parent{
              padding:gesso-spacing(xxs) 0 gesso-spacing(xxs) gesso-spacing(xs);
              .menu--link-parent {
                display:inline-block;
                position:relative;
                width:auto;
                &::after {
                  content:'\e3b5';
                  display:block;
                  font-family: gesso-font-family(iconfont);
                  font-size:rem(gesso-font-size(0));
                  position:absolute;
598
                  right:0;
599
                  text-align: center;
600
                  top:gesso-spacing(xs);
601
602
603
                }
              }
              @include medium {
604
                //flex: 1 0 100%;
605
606
607
608
609
610
611
612
                max-width:inherit;
                padding:gesso-spacing(xs) 0 gesso-spacing(xs) gesso-spacing(sm);
                position: absolute;
                .menu--link-parent {

                  font-size:rem(gesso-font-size(-1));
                  margin:0 0 gesso-spacing(xxs) 0;
                  &::after {
613
                    right:-1rem;
614
615
616
617
618
619
620
                  }

                }
              }
              top:0;
              width:100%;
            }
621
622
623
624
625
          }
        }
      }
    }
  }
Liam Morland's avatar
Liam Morland committed
626
}