@uqds/header 0.0.5-alpha.0 → 0.0.6-alpha.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@uqds/header`
2
2
 
3
- > Header component
3
+ > New Header component
4
4
 
5
5
  ## Usage
6
6
 
@@ -23,8 +23,6 @@ npm i @uqds/header
23
23
  ```shell
24
24
  @uqds/header
25
25
  ├─ @uqds/core
26
- ├─ @uqds/grid
27
- │ └─ @uqds/core
28
- └─ @uqds/icon
26
+ └─ @uqds/grid
29
27
  └─ @uqds/core
30
- ```
28
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uqds/header",
3
- "version": "0.0.5-alpha.0",
4
- "description": "Header component",
3
+ "version": "0.0.6-alpha.0",
4
+ "description": "The POC UQ Header component package",
5
5
  "keywords": [
6
6
  "uqds",
7
7
  "uq",
@@ -12,9 +12,6 @@
12
12
  "css",
13
13
  "header"
14
14
  ],
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
15
  "author": {
19
16
  "name": "University of Queensland",
20
17
  "email": "webservices@uq.edu.au",
@@ -28,6 +25,9 @@
28
25
  "files": [
29
26
  "src/*"
30
27
  ],
28
+ "scripts": {
29
+ "prepare": "gulp -f ../../gulpfile.js --cwd=. prepare"
30
+ },
31
31
  "repository": {
32
32
  "type": "git",
33
33
  "url": "git+https://github.com/uq-its-ss/design-system.git"
@@ -36,9 +36,13 @@
36
36
  "url": "https://github.com/uq-its-ss/design-system/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@uqds/core": "^0.0.5-alpha.0",
40
- "@uqds/grid": "^0.0.5-alpha.0",
41
- "@uqds/icon": "^0.0.5-alpha.0"
39
+ "@uqds/core": "^0.0.6-alpha.0",
40
+ "@uqds/form": "^0.0.6-alpha.0",
41
+ "@uqds/grid": "^0.0.6-alpha.0",
42
+ "@uqds/icon": "^0.0.6-alpha.0"
43
+ },
44
+ "devDependencies": {
45
+ "gulp": "^4.0.2"
42
46
  },
43
- "gitHead": "0d2250c3ff44460d2902ea08102e6423b3fcc3aa"
47
+ "gitHead": "b412d33b296d9f6c92725aae602e3c9913a1c6a1"
44
48
  }
package/src/js/header.js CHANGED
@@ -1,54 +1,53 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * Header module
4
+ * NewHeader module
5
5
  * @file Handles interaction behaviour for the Header. Does not output any
6
6
  * HTML elements.
7
7
  * TODO: make this class configurable
8
8
  */
9
9
 
10
- class header {
10
+ class newHeader {
11
11
  constructor() {
12
12
  this.init();
13
13
  }
14
14
 
15
15
  init() {
16
- this.toggle = document.querySelector('.uq-header__search-toggle-button');
17
- this.search = document.querySelector('.uq-header__search');
18
- this.searchInput = document.querySelector('.uq-header__search-query-input');
19
- this.meta = document.querySelector('meta.uq-header__mq--desktop');
20
- this.navigation = document.querySelector('.uq-header__navigation');
21
16
 
22
- if (this.meta == null) {
23
- this.meta = document.createElement('meta');
24
- this.meta.classList.add('uq-header__mq--desktop');
25
- document.head.appendChild(this.meta);
26
- };
17
+ this.body = document.querySelector('body');
18
+ this.menuToggle = document.querySelector('.nav-primary__menu-toggle');
19
+ this.searchToggle = document.querySelector('.nav-primary__search-toggle');
20
+ this.searchLabel = document.querySelector('.search-toggle__label');
21
+ this.searchBlock = document.querySelector('.uq-header__search');
22
+ this.searchInput = document.querySelector('.uq-header__search-query-input');
27
23
 
28
- this.mqLarge = window.getComputedStyle(this.meta).getPropertyValue('font-family');
29
- this.mqLarge = this.mqLarge.trim().slice(1, -1); // browsers re-quote string style values
30
- this.mqLargeList = window.matchMedia(this.mqLarge);
24
+ // REFACTOR
31
25
 
32
- this.toggle.addEventListener('click', () => {
33
- this.handleToggle();
26
+ this.menuToggle.addEventListener('click', () => {
27
+ this.body.classList.toggle('no-scroll');
28
+ this.menuToggle.classList.toggle('nav-primary__menu-toggle--is-open');
29
+ this.searchToggle.classList.remove('nav-primary__search-toggle--is-open');
30
+ this.searchBlock.classList.remove('uq-header__search--is-open');
34
31
  });
35
- }
36
-
37
- handleToggle() {
38
- this.toggle.classList.toggle('uq-header__search-toggle-button--icon-close');
39
- this.search.classList.toggle('uq-header__search--open');
40
- this.navigation.classList.toggle('uq-header__navigation--open');
41
32
 
42
- if (this.search.classList.contains('uq-header__search--open')) {
43
- if (this.mqLargeList.matches) {
44
- this.searchInput.focus();
33
+ this.searchToggle.addEventListener('click', () => {
34
+ this.searchToggle.classList.toggle('nav-primary__search-toggle--is-open');
35
+ this.searchBlock.classList.toggle('uq-header__search--is-open');
36
+ this.menuToggle.classList.remove('nav-primary__menu-toggle--is-open');
37
+ if (this.searchBlock.classList.contains('uq-header__search--is-open')) {
38
+ window.setTimeout(() => this.searchInput.focus(), 50);
45
39
  } else {
46
- this.toggle.blur();
40
+ window.setTimeout(() => this.searchInput.blur(), 50);
41
+ this.searchToggle.blur();
47
42
  }
48
- } else {
49
- this.toggle.blur();
50
- }
43
+ if ( this.searchLabel.innerHTML === "Search") {
44
+ this.searchLabel.innerHTML = "Close";
45
+ } else {
46
+ this.searchLabel.innerHTML = "Search";
47
+ }
48
+ });
51
49
  }
50
+
52
51
  };
53
52
 
54
- export {header as default};
53
+ export {newHeader as default};
package/src/js/main.js ADDED
@@ -0,0 +1,4 @@
1
+ import header from './header';
2
+ export {
3
+ header
4
+ };
@@ -1,391 +1,785 @@
1
1
  @use '@uqds/core/src/scss/global' as core;
2
- @use '@uqds/grid/src/scss/global' as grid;
3
2
  @use "@uqds/icon/src/scss/global" as icon-constants;
4
- @use '@uqds/form/src/scss/global' as form;
3
+ @use '@uqds/grid/src/scss/global' as grid;
5
4
  @use 'global' as *;
6
5
 
7
- .uq-header {
8
- background: core.$uq-purple;
9
- background: core.$uq-purple-gradient;
10
- box-sizing: border-box;
11
- font-family: core.$font-body;
12
- font-weight: core.$font-weight-thin;
13
- line-height: core.$line-height;
14
-
15
- &__container {
16
- @include grid.layout-containment;
17
- position: relative;
18
- padding: core.$space core.$space-s 0;
19
- display: grid;
20
- grid-template-columns: auto auto;
21
- grid-template-areas:
22
- "logo toggle"
23
- "search search"
24
- "nav nav";
25
- justify-items: center;
26
-
27
- @media #{core.$screen-lg-up} {
28
- padding: core.$space-m core.$space 0;
29
- gap: core.$space-m;
30
- grid-template-columns: auto auto min-content;
31
- grid-template-areas:
32
- "logo nav toggle"
33
- "search search search";
34
- }
6
+ .uq-header {
7
+
8
+ background: core.$uq-purple; //linear-gradient(90deg, $uq-purple 0%, 87%, #962A8B 100%);
9
+ display: grid;
10
+ align-items: center;
11
+ grid-template-columns: auto;
12
+ grid-template-areas:
13
+ "mainheader"
14
+ "secondarynav";
15
+ position: relative;
16
+
17
+ @media #{core.$screen-lg-up} {
18
+ grid-template-areas:
19
+ "secondarynav"
20
+ "mainheader";
21
+ }
22
+
23
+ &__container {
24
+
25
+ display: grid;
26
+ align-items: center;
27
+ grid-template-columns: 1fr 15fr 1fr;
28
+ grid-area: mainheader;
29
+ grid-template-areas:
30
+ "menutoggle logo searchtoggle"
31
+ "mainnav-mobile mainnav-mobile mainnav-mobile";
32
+
33
+ @media #{core.$screen-lg-up} {
34
+ max-width: 73.25rem;
35
+ margin-left: auto;
36
+ margin-right: auto;
37
+ grid-template-areas:
38
+ "logo mainnav searchtoggle";
39
+ padding-left: core.$space;
40
+ padding-right: core.$space;
35
41
  }
42
+ }
36
43
 
37
- &__logo {
38
- grid-area: logo;
39
- justify-self: start;
40
-
41
- img {
42
- height: 2.625rem;
43
- vertical-align: middle;
44
- }
44
+ &__menu-toggle {
45
+ grid-area: menutoggle;
45
46
 
46
- &--large {
47
- display: none;
47
+ @media #{core.$screen-lg-up} {
48
+ display: none;
49
+ }
50
+ }
48
51
 
49
- @media only screen and (min-width: 78.5rem) {
50
- display: block;
51
- }
52
- }
52
+ &__search-toggle {
53
+ grid-area: searchtoggle;
54
+ height: 100%;
55
+ text-align: right;
56
+ color: core.$uq-white;
53
57
 
54
- &--small {
55
- @media only screen and (min-width: 78.5rem) {
56
- display: none;
57
- }
58
- }
58
+ @media #{core.$screen-lg-up} {
59
+ height: auto;
59
60
  }
60
61
 
61
- &__navigation {
62
- grid-area: nav;
62
+ .search-toggle__label {
63
+ display: none;
63
64
 
64
- @media #{core.$screen-lg-up} {
65
- justify-self: end;
66
- display: flex;
67
- }
68
-
69
- &-container {
70
- -webkit-column-count: 3;
71
- -moz-column-count: 3;
72
- column-count: 3;
73
- list-style: none;
74
- margin-bottom: core.$space;
75
- padding: core.$space-none;
76
- height: 0;
77
- overflow: hidden;
78
- width: 100%;
79
-
80
- @media #{core.$screen-lg-up} {
81
- justify-self: end;
82
- display: flex;
83
- align-content: flex-end;
84
- align-items: center;
85
- justify-content: center;
86
- gap: core.$space-m;
87
- margin: core.$space-none;
88
- height: auto;
89
- visibility: visible;
90
- overflow: initial;
91
-
92
- li {
93
- margin: core.$space-none;
94
- }
95
- }
96
- }
65
+ @media #{core.$screen-lg-up} {
66
+ display: block;
67
+ font-family: core.$roboto;
68
+ font-size: core.$font-size;
69
+ text-align: right;
70
+ width: 3.2rem;
71
+ }
72
+ }
73
+ }
97
74
 
98
- &--open {
99
- width: 100%;
75
+ & .nav-primary__toggle {
76
+ background: none;
77
+ border: none;
78
+ padding: 1.75rem core.$space-l;
79
+ height: 100%;
100
80
 
101
- @media #{core.$screen-lg-up} {
102
- width: auto;
103
- }
81
+ @media #{core.$screen-lg-up} {
82
+ padding: 1rem 0 1rem 1.5rem;
83
+ height: auto;
84
+ }
85
+ }
86
+
87
+ & .nav-primary__menu-toggle {
88
+ cursor: pointer;
89
+ color: core.$uq-white;
90
+ position: relative;
91
+ text-indent: -9999px;
92
+ white-space: nowrap;
93
+
94
+ &::before {
95
+ content: "";
96
+ background-image: url(icon-constants.get-icon("standard--navigation-menu", core.$uq-white));
97
+ background-repeat: no-repeat;
98
+ width: 1.5rem;
99
+ height: 1.5rem;
100
+ transform: translate(50%, 50%);
101
+ position: absolute;
102
+ top: .625rem;
103
+ right: core.$space-l;
104
+ }
104
105
 
105
- .uq-header__navigation-container {
106
- height: auto;
107
- visibility: visible;
108
- overflow: initial;
109
- }
110
- }
106
+ &--is-open {
107
+ &::before {
108
+ background-image: url(icon-constants.get-icon("standard--x", core.$uq-white));
109
+ }
110
+ }
111
+ }
112
+
113
+ & .nav-primary__search-toggle {
114
+ cursor: pointer;
115
+ color: core.$uq-white;
116
+ position: relative;
117
+
118
+ &::before {
119
+ content: "";
120
+ background-image: url(icon-constants.get-icon("standard--search", core.$uq-white));
121
+ background-repeat: no-repeat;
122
+ width: 1.5rem;
123
+ height: 1.5rem;
124
+ transform: translate(50%, 50%);
125
+ position: absolute;
126
+ top: .625rem;
127
+ right: core.$space-l;
128
+
129
+ @media #{core.$screen-lg-up} {
130
+ top: 0.1rem;
131
+ left: -1rem;
132
+ }
133
+ }
134
+
135
+ @media #{core.$screen-lg-up} {
136
+ &:hover {
137
+ color: #d4c8de;
138
+ text-decoration: underline;
139
+ }
140
+ }
141
+
142
+ &--is-open {
143
+
144
+ &::before {
145
+ background-image: url(icon-constants.get-icon("standard--x", core.$uq-white));
146
+ }
147
+ }
148
+
149
+ }
150
+
151
+ &__logo {
152
+ grid-area: logo;
153
+
154
+
155
+ & a {
156
+ display: grid;
157
+ padding: 1rem 0;
158
+ }
159
+
160
+ & img {
161
+ height: 32px;
162
+
163
+ @media #{core.$screen-lg-up} {
164
+ height: 40px;
165
+ }
166
+ }
167
+ }
168
+
169
+ // __nav-primary
170
+
171
+ &__nav-primary {
172
+ grid-area: mainnav;
173
+ display: none;
174
+ width: 100%;
175
+ z-index: 99;
111
176
 
112
-
177
+ @media #{core.$screen-lg-up} {
178
+ display: block;
179
+ }
180
+ }
181
+
182
+ &__nav-primary-container {
113
183
 
114
- &-link {
115
- color: core.$uq-white;
116
- font-size: core.$font-size-s;
117
- font-weight: core.$font-weight-thin;
118
- text-decoration: none;
119
-
120
- &:hover,
121
- &:focus {
122
- color: core.$uq-white;
123
- text-decoration: underline;
124
- }
125
- }
184
+ @media #{core.$screen-lg-up} {
185
+ padding: 0 0 0 core.$space-xl;
186
+ }
187
+ }
188
+
189
+ &__nav-primary-list {
190
+ list-style-type: none;
191
+ margin: 0;
192
+ padding-left: 0;
193
+ display: flex;
194
+ justify-content: flex-start;
195
+ align-items: stretch;
196
+ flex-direction: column;
197
+
198
+ @media #{core.$screen-lg-up} {
199
+ align-items: center;
200
+ flex-direction: row;
126
201
  }
127
202
 
128
- &__search {
129
- grid-area: search;
130
- height: 0;
131
- overflow: hidden;
132
- visibility: hidden;
133
- transition: height .25s, padding-top .25s, padding-bottom .25s;
134
-
135
- &--open {
136
- height: auto;
137
- visibility: visible;
138
- overflow: initial;
139
- padding-top: core.$space-m;
140
- padding-bottom: core.$space;
141
- width: 100%;
142
- }
203
+ & li {
204
+ margin: 0;
205
+ padding-right: 2rem;
143
206
 
144
- &-toggle {
145
- grid-area: toggle;
146
- justify-self: end;
147
-
148
- &-button {
149
- margin: core.$space-s core.$space-none core.$space-none core.$space-none;
150
- padding: core.$space-xs;
151
- border: 0;
152
- width: 1.5rem;
153
- height: 1.5rem;
154
- background-color: transparent;
155
- text-indent: -100vw;
156
- overflow: hidden;
157
- position: relative;
158
- cursor: pointer;
159
- background-position: center center;
160
-
161
- @media #{core.$screen-lg-up} {
162
- margin: .75rem core.$space-none core.$space-none core.$space-none;
163
- }
164
-
165
- &::before {
166
- content: "";
167
- position: absolute;
168
- display: block;
169
- top: 0;
170
- left: 0;
171
- width: 100%;
172
- height: 100%;
173
- background-size: 100%;
174
- background-image: url(icon-constants.get-icon('standard--search', core.$uq-white));
175
- }
176
-
177
- &--icon-close {
178
- &::before {
179
- background-image: url(icon-constants.get-icon('standard--close', core.$uq-white));
180
- }
181
- }
182
- }
207
+ &:hover {
208
+ & > .uq-header__megamenu {
209
+ height: auto;
210
+ visibility: visible;
183
211
  }
184
212
 
185
- &-title {
186
- color: core.$uq-white;
187
- font-family: core.$merriweather;
188
- font-size: core.$font-size;
189
- font-style: italic;
190
- font-weight: core.$font-weight-normal;
191
- margin-bottom: form.$form-spacing;
192
- line-height: core.$line-height-h;
193
- padding: 0;
194
-
195
- @media #{core.$screen-lg-up} {
196
- display: inline-block;
197
- float: left;
198
- vertical-align: baseline;
199
- }
200
-
201
- @media #{core.$screen-xl-up} {
202
- font-size: core.$font-size-l;
203
- }
213
+ & .uq-header__nav-primary-link {
214
+ border-bottom: 4px solid white;
204
215
  }
216
+ }
205
217
 
206
- fieldset {
207
- border: 0;
208
- padding: 0;
209
- margin: 0;
210
- }
218
+ & .uq-header__nav-primary-link--active {
219
+ border-bottom: 4px solid white;
220
+ }
221
+ }
222
+ }
223
+
224
+ &__nav-primary-link {
225
+ display: block;
226
+ color: core.$uq-white; //core.$uq-purple;
227
+ text-decoration: none;
228
+ padding: core.$space core.$space-m;
229
+ transition: background-color .25s,border-color .25s;
230
+ font-weight: 400;
231
+ position: relative;
232
+ border-bottom: 4px solid core.$uq-purple;
233
+
234
+ &:hover {
235
+ color: core.$uq-white;
236
+ text-decoration: none;
237
+ }
238
+
239
+
240
+ @media #{core.$screen-lg-up} {
241
+ padding: core.$space-l core.$space-s;
242
+ }
243
+ }
244
+
245
+ .nav-primary-link--has-dropdown {
246
+ padding: core.$space-l core.$space-m core.$space-l core.$space-s;
247
+
248
+ &::after {
249
+ content: "";
250
+ background-image: url(icon-constants.get-icon("standard--chevron-down-sml", core.$uq-white));
251
+ background-repeat: no-repeat;
252
+ width: core.$space;
253
+ height: core.$space;
254
+ transform: translateY(50%);
255
+ position: absolute;
256
+ top: 1.7rem;
257
+ right: 1.75rem;
258
+
259
+ @media #{core.$screen-lg-up} {
260
+ right: .25rem;
261
+ }
262
+ }
263
+ }
264
+
265
+ .mega-menu {
266
+ display: none;
267
+ background-color: core.$uq-white;
268
+ list-style-type: none;
269
+ margin: 0;
270
+ padding-left: 0;
211
271
 
212
- input[type="radio"] {
213
- color: core.$uq-white;
214
- border-radius: 50%;
215
- appearance: none;
216
- display: inline-block;
217
- border: form.$form-checkbox-border-width solid form.$form-border-color;
218
- cursor: pointer;
219
- height: form.$form-checkbox-size;
220
- width: form.$form-checkbox-size;
221
- vertical-align: top;
222
- position: absolute;
223
-
224
- &:focus {
225
- border-color: form.$form-focus-color;
226
- box-shadow: 0 0 0 1px form.$form-focus-color;
227
- outline: none;
228
- }
229
-
230
- + label {
231
- color: core.$uq-white;
232
- display: inline-block;
233
- font-size: core.$font-size-s;
234
- font-weight: core.$font-weight-normal;
235
- line-height: core.$line-height-h;
236
- margin-bottom: core.$space-none;
237
- margin-left: core.$space-s;
238
- margin-right: form.$form-spacing;
239
- padding-top: core.$space-xs;
240
- padding-left: core.$space-m;
241
- vertical-align: top;
242
- cursor: pointer;
243
- }
244
-
245
- &:checked {
246
- border-width: 0.125rem;
247
- border-color: core.$uq-white;
248
-
249
- &::after {
250
- border-radius: 50%;
251
- background-color: core.$uq-white;
252
- content: "";
253
- display: block;
254
- position: absolute;
255
- top: 3px;
256
- left: 3px;
257
- height: form.$form-checkbox-size - 10px;
258
- width: form.$form-checkbox-size - 10px;
259
- }
260
-
261
- &:focus {
262
- border-color: form.$form-focus-color;
263
- box-shadow: 0 0 0 1px form.$form-focus-color;
264
- }
265
- }
272
+ & li {
273
+
274
+ & a {
275
+ padding-left: core.$space-xxl;
276
+ color: core.$uq-purple;
277
+ }
278
+ }
279
+
280
+ & ul {
281
+ list-style-type: none;
282
+ margin: 0;
283
+ padding-left: 0;
284
+
285
+ & li {
286
+ & a {
287
+ padding-left: core.$space-ul;
266
288
  }
289
+ }
290
+ }
291
+ }
292
+
293
+ &__nav-secondary {
294
+ background-color: #48206c;
295
+ grid-area: secondarynav;
296
+ }
297
+
298
+ &__nav-secondary-container {
299
+ @media #{core.$screen-lg-up} {
300
+ text-align: right;
301
+ max-width: 73.25rem;
302
+ margin-left: auto;
303
+ margin-right: auto;
304
+ }
305
+ }
306
+
307
+ &__nav-secondary-list {
308
+ list-style-type: none;
309
+ margin: 0;
310
+ padding-left: 0;
311
+ display: flex;
312
+ justify-content: flex-start;
313
+ align-items: stretch;
314
+ flex-direction: column;
315
+
316
+ @media #{core.$screen-lg-up} {
317
+ justify-content: flex-end;
318
+ align-items: center;
319
+ flex-direction: row;
320
+ }
321
+ }
322
+
323
+ &__nav-secondary-item {
324
+ margin: 0;
325
+ }
326
+
327
+ &__nav-secondary-link {
328
+ display: block;
329
+ color: white;
330
+ padding: core.$space core.$space-m;
331
+
332
+ @media #{core.$screen-lg-up} {
333
+ font-size: core.$font-size-s;
334
+ padding: .625rem core.$space;
335
+ }
336
+
337
+ &:hover {
338
+ color: #d4c8de;
339
+ }
340
+ }
341
+
342
+ &__search {
343
+
344
+ background: core.$uq-purple;
345
+ position: absolute;
346
+ width: 100%;
347
+ top: 3.95rem;
348
+ z-index: 20;
349
+ box-shadow: 0 .75rem core.$space-m rgb(24 24 24 / 20%);
350
+ transition: max-height .2s ease-in-out, transform .2s ease-in-out;//, visibility .2s ease;
351
+ transform: translateY(-1rem);
352
+ max-height: 0;
353
+ overflow: hidden;
354
+
355
+ @media #{core.$screen-lg-up} {
356
+ top: 8.3rem;
357
+ }
358
+
359
+ &--is-open {
360
+ transform: translateY(0);
361
+ max-height: 50vh;
362
+ }
363
+ }
364
+
365
+ &__search-container {
267
366
 
268
- &-range {
269
- display: block;
270
- margin-bottom: core.$space;
271
-
272
- @media #{core.$screen-lg-up} {
273
- display: inline-block;
274
- margin-left: core.$space;
275
- line-height: 1.4;
276
- }
367
+ padding: 0 core.$space-m;
368
+
369
+ @media #{core.$screen-lg-up} {
370
+ padding-left: core.$space;
371
+ padding-right: core.$space;
372
+ max-width: 73.25rem;
373
+ margin-left: auto;
374
+ margin-right: auto;
375
+ padding-top: 0;
376
+ padding-bottom: 1rem;
377
+ }
378
+ }
379
+
380
+ &__search-query {
381
+ position: relative;
382
+ display: inline-block;
383
+ max-width: 100%;
384
+ min-width: 100%;
385
+ border-radius: 5px;
386
+ background-position: core.$space;
387
+ padding-top: core.$space;
388
+ padding-bottom: core.$space;
389
+ }
390
+
391
+ &__search-query-input {
392
+ margin: 0 !important;
393
+ padding: .75rem core.$space !important;
394
+ }
395
+
396
+ &__search-query-button {
397
+ background-clip: padding-box;
398
+ background-color: core.$uq-white;
399
+ border-radius: 5px;
400
+ border: 2px solid transparent;
401
+ color: core.$uq-purple;
402
+ display: inline-block;
403
+ font-size: core.$font-size;
404
+ height: 2.75rem;
405
+ line-height: 1.5;
406
+ margin-bottom: 0;
407
+ margin-right: 0;
408
+ overflow: hidden;
409
+ position: absolute;
410
+ right: core.$space-s;
411
+ text-decoration: none;
412
+ text-indent: 0;
413
+ top: calc(50% - 1.375rem);
414
+ transition: color .2s,background-color .2s,border-color .2s;
415
+ width: 2.75rem;
416
+
417
+ &::before {
418
+ content: "";
419
+ position: absolute;
420
+ display: block;
421
+ width: core.$space-m;
422
+ height: core.$space-m;
423
+ top: core.$space-s;
424
+ left: core.$space-s;
425
+ background-size: 100%;
426
+ background-image: url(icon-constants.get-icon("standard--search", core.$uq-purple));
427
+ }
428
+ }
429
+
430
+ &__search-query-submit {
431
+ color: transparent;
432
+ position: relative;
433
+ display: block;
434
+ width: 100%;
435
+ height: 100%;
436
+ margin: core.$space-none;
437
+ border: core.$space-none;
438
+ background-color: transparent;
439
+ z-index: 3;
440
+ cursor: pointer;
441
+ outline-offset: -2px;
442
+ font-size: core.$font-size;
443
+ }
444
+
445
+ &__search-range {
446
+
447
+ display: inline-block;
448
+
449
+ & label {
450
+ color: core.$uq-white;
451
+ }
452
+ }
453
+
454
+ .uq-header__search-radio {
455
+ &:checked {
456
+ border-color: core.$uq-white;
457
+
458
+ &:focus {
459
+ border-color: core.$uq-white;
277
460
  }
278
461
 
279
- &-query {
280
- position: relative;
281
- display: inline-block;
282
- max-width: 100%;
283
- min-width: 100%;
284
- border-radius: 2px;
462
+ &::after {
285
463
  background-color: core.$uq-white;
286
- background-position: 1rem;
287
- margin-bottom: core.$space-s;
288
-
289
- @media #{core.$screen-xl-up} {
290
- margin-bottom: core.$space-m;
291
- }
292
-
293
- &-input {
294
- background: transparent;
295
- margin: core.$space-none !important;
296
- width: 100%;
297
- padding: .75rem 1rem;
298
- border: 1px solid #e2e2e2;
299
- border-radius: 2px;
300
- box-shadow: none;
301
- font-family: sans-serif;
302
- font-size: core.$font-size;
303
- line-height: 1;
304
- color: core.$uq-neutral-dark80;
305
- height: auto;
306
- outline: none;
307
-
308
- &:focus {
309
- border-color: core.$link;
310
- outline: none;
311
- }
312
- }
313
-
314
- &-button {
315
- background-clip: padding-box;
316
- background-color: core.$uq-white;
317
- border-radius: 5px;
318
- border: 2px solid transparent;
319
- color: core.$uq-purple;
320
- display: inline-block;
321
- font-size: core.$font-size;
322
- height: 2.75rem;
323
- line-height: core.$line-height;
324
- margin-bottom: core.$space-none;
325
- margin-right: core.$space-none;
326
- overflow: hidden;
327
- position: absolute;
328
- right: 0;
329
- text-decoration: none;
330
- text-indent: 0;
331
- top: calc(50% - 1.375rem);
332
- transition: color .2s, background-color .2s, border-color .2s;
333
- width: 2.75rem;
334
-
335
- &:hover {
336
- background-color: core.$uq-white;
337
- border-color: core.$uq-purple;
338
- color: core.$uq-purple
339
- }
464
+ }
465
+ }
466
+ }
467
+
468
+ &__search-label {
469
+ font-size: .8rem !important;
470
+ line-height: 1.7 !important;
471
+
472
+ @media #{core.$screen-lg-up} {
473
+ font-size: core.$font-size !important;
474
+ line-height: 1.4 !important;
475
+ }
476
+ }
477
+
478
+ &__nav-primary,
479
+ &__nav-secondary {
480
+ @media #{core.$screen-lg-down} {
481
+ display: none;
482
+ }
483
+ }
484
+
485
+ &__megamenu {
486
+ position: absolute;
487
+ top: 8.3rem;
488
+ left: 0;
489
+ width: 100%;
490
+ z-index: 30;
491
+ height: 0;
492
+ visibility: hidden;
493
+ }
494
+
495
+ &__megamenu-container {
496
+ max-width: 73.25rem;
497
+ margin-left: auto;
498
+ margin-right: auto;
499
+
500
+ padding: core.$space core.$space-xxl core.$space-xl core.$space-xxl;
501
+ background: core.$uq-white;
502
+ box-shadow: 0 0.75rem core.$space-m rgb(24 24 24 / 20%);
503
+ border-radius: 0 0 .25rem .25rem;
340
504
 
341
- &::before {
342
- content: "";
343
- position: absolute;
344
- display: block;
345
- width: 1.5rem;
346
- height: 1.5rem;
347
- top: .5rem;
348
- left: .5rem;
349
- background-size: 100%;
350
- background-image: url(icon-constants.get-icon('standard--search', core.$uq-purple));
351
- }
352
- }
353
-
354
- &-submit {
355
- color: transparent;
356
- position: relative;
357
- display: block;
358
- width: 100%;
359
- height: 100%;
360
- margin: core.$space-none;
361
- border: 0;
362
- background-color: transparent;
363
- z-index: 3;
364
- cursor: pointer;
365
- outline-offset: -2px;
366
- font-size: core.$font-size;
367
- }
368
- }
369
- }
370
-
371
- // Visibility utility classes
372
- .hidden {
373
- display: none;
374
- }
375
-
376
- .visually-hidden {
377
- position: absolute !important;
378
- overflow: hidden;
379
- clip: rect(1px,1px,1px,1px);
380
- width: 1px;
381
- height: 1px;
382
- word-wrap: normal;
505
+ @media #{core.$screen-xl-up} {
506
+ max-width: 77.25rem;
507
+ }
508
+ }
509
+
510
+ .megamenu__row {
511
+ display: grid;
512
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
513
+ }
514
+
515
+ .megamenu__overview-link {
516
+ display: block;
517
+ padding: core.$space core.$space-none;
518
+ color: core.$uq-purple;
519
+ }
520
+
521
+ .megamenu__heading {
522
+ color: core.$uq-purple;
523
+ font-weight: 500;
524
+ padding-top: core.$space-xs;
525
+ padding-bottom: core.$space-xs;
526
+
527
+ &:nth-of-type(2) {
528
+ padding-top: core.$space-xl;
529
+ }
530
+ }
531
+
532
+ .megamenu__menu {
533
+ & ul {
534
+ list-style-type: none;
535
+ margin: core.$space-none;
536
+ padding-left: core.$space-none;
537
+
538
+ & li {
383
539
  margin: core.$space-none;
384
- padding: core.$space-none;
540
+
541
+ & a {
542
+ display: inline-block;
543
+ padding-top: core.$space-s;
544
+ color: core.$uq-purple;
545
+ }
546
+ }
547
+ }
548
+ }
549
+ }
550
+
551
+ :root {
552
+ --app-height: 100%;
553
+ }
554
+
555
+ body.no-scroll {
556
+ position: fixed;
557
+ @media #{core.$screen-lg-up} {
558
+ position: relative;
559
+ }
560
+ }
561
+
562
+ // Slide mobile menu
563
+
564
+ .slide-menu {
565
+ width:100%;
566
+ max-width:100%;
567
+ background-color:#FFFFFF;
568
+ height: calc(var(--app-height) - 4.3rem);
569
+ display:none;
570
+ box-sizing:border-box;
571
+ transition:transform .3s ease-in-out;
572
+ transform:translateX(100%);
573
+ will-change:transform;
574
+ z-index:1000;
575
+ grid-area: mainnav-mobile;
576
+ position:fixed;
577
+ top: 4.3rem;
578
+ right:core.$space-none;
579
+ overflow-y:auto;
580
+ overflow-x:hidden;
581
+ font-size: core.$font-size;
582
+ color:core.$uq-purple;
583
+
584
+ @media #{core.$screen-lg-up} {
585
+ display: none !important;
586
+ }
587
+
588
+ .slide-menu__slider {
589
+ width:100%;
590
+ transform:translateX(0);
591
+ transition:transform .3s ease-in-out;
592
+ will-change:transform;
593
+ }
594
+
595
+ ul {
596
+ position:relative;
597
+ width:100%;
598
+ margin:core.$space-none;
599
+ padding-left:core.$space-none;
600
+ list-style:none;
601
+ background-color: core.$uq-white;
602
+
603
+ ul {
604
+ position:absolute;
605
+ top:core.$space-none;
606
+ left:100%;
607
+ display:none;
608
+
609
+ a {
610
+ padding: .75rem core.$space-m .75rem core.$space-xxl;
611
+ }
612
+ }
613
+
614
+ a {
615
+ display:block;
385
616
  }
617
+ }
618
+
619
+ li {
620
+ margin-bottom: core.$space-none;
386
621
 
387
- // JS helpers:
388
- &__mq--desktop {
389
- font-family: "#{core.$screen-lg-up}";
622
+ &:hover {
623
+ background-color:#f1f1f1;
390
624
  }
625
+
626
+ }
627
+
628
+ .slide-menu__control {
629
+ padding-top: 1rem;
630
+ padding-bottom: 1rem;
631
+ }
632
+
633
+ a {
634
+ cursor:pointer;
635
+ padding: .75rem core.$space-m;
636
+ text-decoration:none;
637
+ font-size: core.$font-size;
638
+ color:core.$uq-purple;
639
+ position: relative;
640
+
641
+ &:hover {
642
+ color:core.$uq-purple;
643
+ background-color:#f1f1f1;
644
+ }
645
+ }
646
+
647
+ & .slide-menu__backlink {
648
+ font-weight: 500;
649
+ padding-left: core.$space-xxl;
650
+
651
+ &::before {
652
+ content: "";
653
+ background-image: url(icon-constants.get-icon("standard--chevron-left-sml", core.$uq-purple));
654
+ background-repeat: no-repeat;
655
+ width: 1.5rem;
656
+ height: 1.5rem;
657
+ transform: translateY(50%);
658
+ position: absolute;
659
+ left: 1.25rem;
660
+ top: core.$space-xs;
661
+ }
662
+ }
663
+
664
+ &__decorator {
665
+
666
+ &::before {
667
+ content: "";
668
+ background-image: url(icon-constants.get-icon("standard--chevron-right-sml", core.$uq-purple));
669
+ background-repeat: no-repeat;
670
+ width: 1.5rem;
671
+ height: 1.5rem;
672
+ transform: translateY(50%);
673
+ position: absolute;
674
+ right: 1.5rem;
675
+ top: core.$space-xs;
676
+ }
677
+ }
678
+
679
+ /* Controls */
680
+ .controls {
681
+ display:flex;
682
+ margin-bottom:core.$space;
683
+ }
684
+
685
+ .btn {
686
+ padding:.75rem core.$space-m;
687
+ flex:1 0 auto;
688
+ font-size:90%;
689
+ color:core.$uq-purple;
690
+ background-color:core.$uq-white;
691
+ text-transform:uppercase;
692
+
693
+ border:none;
694
+ cursor:pointer;
695
+ font-family:inherit;
696
+ line-height:1;
697
+
698
+ &:first-of-type {
699
+ text-align:left;
700
+
701
+ &:before {
702
+ content:"⮜ this";
703
+ margin-right:.5rem;
704
+ }
705
+ }
706
+
707
+ &:last-of-type {
708
+ text-align:right;
709
+
710
+ &:before {content:"✕";
711
+ margin-right:.5rem;
712
+ }
713
+ }
714
+ }
715
+
716
+ .uq-header__nav-secondary-item {
717
+ background-color:#48206C;
718
+
719
+ &:hover {
720
+ background-color:#48206C;
721
+ }
722
+ }
723
+
724
+ .uq-header__nav-secondary-link {
725
+ color:core.$uq-white;
726
+
727
+ &:hover {
728
+ color:core.$uq-white;
729
+ background-color:#48206C;
730
+ }
731
+ }
732
+
733
+ .uq-header__newglobal-nav-parent {
734
+ font-weight: 500;
735
+ }
736
+
737
+ .uq-header__newglobal-nav-item {
738
+ background-color:core.$uq-purple;
739
+ }
740
+
741
+ .uq-header__newglobal-nav-link {
742
+ color:core.$uq-white;
743
+ background-color:core.$uq-purple;
744
+
745
+ &:hover {
746
+ color:core.$uq-white;
747
+ background-color:core.$uq-purple;
748
+ }
749
+ }
750
+
751
+ .uq-header__newglobal-nav-link .slide-menu__decorator::before {
752
+ content: "";
753
+ background-image: url(icon-constants.get-icon("standard--chevron-right-sml", core.$uq-white));
754
+ }
391
755
  }
756
+
757
+ /* LOCAL SITE NAVIGATION MODIFIERS */
758
+
759
+ .global-mobile-nav {
760
+
761
+ .uq-site-header__title-container {
762
+ margin: 0;
763
+ padding-left: 0rem;
764
+ padding-right: 0rem;
765
+ }
766
+
767
+ .uq-site-header__title {
768
+ padding: 1rem 1.5rem;
769
+ font-size: 1rem;
770
+ font-weight: 500;
771
+
772
+ &:hover {
773
+ background: none;
774
+ }
775
+ }
776
+
777
+ &__audience-link {
778
+ font-weight: 500;
779
+ }
780
+
781
+ }
782
+
783
+ .uq-site-header__navigation-toggle {
784
+ display: none;
785
+ }
@@ -1 +1,6 @@
1
+ @use '@uqds/core/src/scss/global' as core;
2
+
1
3
  // Variables, functions, and mixins
4
+ $site-footer-color: mix(core.$uq-white, core.$uq-purple, 75%);
5
+ $site-footer-link-color: core.$uq-white;
6
+ $site-footer-font-size: .875rem;
@@ -0,0 +1 @@
1
+ @use 'component';