@ucd-lib/theme-elements 1.1.4 → 1.2.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.
@@ -122,8 +122,8 @@ ${this.isDemo ? html`
122
122
  </div>
123
123
  <div class="mobile-bar__fixed-site-name"><a href=${this.siteUrl}>${this.siteName}</a></div>
124
124
  <div class="mobile-bar__university">
125
- <a href="https://www.ucdavis.edu/">
126
- <img class="ucd-logo" src='data:image/svg+xml;utf8,${this._ucdLogo('gold')}'>
125
+ <a href="https://www.ucdavis.edu/" aria-label="UC Davis main website link">
126
+ <img class="ucd-logo" src='data:image/svg+xml;utf8,${this._ucdLogo('gold')}' alt="UC Davis main website link">
127
127
  </a>
128
128
  </div>
129
129
  </div>
@@ -131,8 +131,8 @@ ${this.isDemo ? html`
131
131
  <div id="branding-bar-container">
132
132
  <div class="header__bar">
133
133
  <div class="header__university">
134
- <a href="https://www.ucdavis.edu/">
135
- <img class="ucd-logo" src='data:image/svg+xml;utf8,${this._ucdLogo()}'>
134
+ <a href="https://www.ucdavis.edu/" aria-label="UC Davis main website link">
135
+ <img class="ucd-logo" src='data:image/svg+xml;utf8,${this._ucdLogo()}' alt="UC Davis main website link">
136
136
  </a>
137
137
  </div>
138
138
  </div>
@@ -142,7 +142,7 @@ ${this.isDemo ? html`
142
142
  ` : html`
143
143
  <div class="site-branding">
144
144
  <div class="site-branding__figure" ?hidden=${!this.figureSrc}>
145
- <a href="${this.siteUrl}" class=""><img src=${this.figureSrc} class="site-logo" alt="Site Logo" /></a>
145
+ <a href="${this.siteUrl}" class="" aria-label="UC Davis Library website link"><img src=${this.figureSrc} class="site-logo" alt="Site Logo" /></a>
146
146
  </div>
147
147
  <div class="site-branding__body">
148
148
  <h1 class="site-branding__site-name" ?hidden=${!this.siteName}>
@@ -17,9 +17,6 @@ export function styles() {
17
17
  button[disabled] {
18
18
  pointer-events: none;
19
19
  }
20
- .submenu-toggle__icon {
21
- min-width: 40%;
22
- }
23
20
  @media (min-width: 992px) {
24
21
  nav.primary-nav--mega li.depth-0 > ul.menu {
25
22
  opacity: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucd-lib/theme-elements",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "description": "Custom elements for the UCD brand theme",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,207 @@
1
+ import { LitElement } from 'lit';
2
+ import {render, styles} from "./ucdlib-header.tpl.js";
3
+
4
+ import {
5
+ MutationObserverController,
6
+ PopStateObserverController,
7
+ WaitController } from '../../utils/controllers';
8
+
9
+ /**
10
+ * @class UcdlibHeader
11
+ * @classdesc Component class for displaying the site header
12
+ *
13
+ * @property {String} siteName - Name of website to display
14
+ * @property {Boolean} silenceWarnings - Console warnings will be silences
15
+ * @property {Boolean} opened - Whether header is open in the mobile view
16
+ * @property {Boolean} preventFixed - Navbar will not be fixed to top of screen in desktop view
17
+ * @property {Number} mobileWidth - Screen width for mobile header display, defaults to 755
18
+
19
+ * @example
20
+ * <ucdlib-header site-name="A UC Davis Website" mobile-width="42">
21
+ * <ucd-theme-primary-nav>
22
+ * <a href="#">LINK 1</a>
23
+ * <a href="#">LINK 2</a>
24
+ * <a href="#">LINK 3</a>
25
+ * </ucd-theme-primary-nav>
26
+ * </ucdlib-header>
27
+ *
28
+ */
29
+ export default class UcdlibHeader extends LitElement {
30
+
31
+ static get properties() {
32
+ return {
33
+ siteName: {type: String, attribute: "site-name"},
34
+ opened: {type: Boolean},
35
+ silenceWarnings: {type: Boolean, attribute: 'silence-warnings'},
36
+ preventFixed: {type: Boolean, attribute: "prevent-fixed"},
37
+ mobileWidth: {type: Number, attribute: "mobile-width"},
38
+ isDemo: {type: Boolean, attribute: "is-demo"},
39
+ _transitioning: {type: Boolean, state: true},
40
+ _hasPrimaryNav: {type: Boolean, state: true},
41
+ _hasSearch: {type: Boolean, state: true},
42
+ _components: {type: Object, state: true}
43
+ };
44
+ }
45
+
46
+ static get styles() {
47
+ return styles();
48
+ }
49
+
50
+ constructor() {
51
+ super();
52
+ this.render = render.bind(this);
53
+
54
+ this.mutationObserver = new MutationObserverController(this);
55
+ this.wait = new WaitController(this);
56
+ new PopStateObserverController(this, "_onLocationChange");
57
+
58
+ this.siteName = "";
59
+ this.opened = false;
60
+ this.silenceWarnings = false;
61
+ this.mobileWidth = 755;
62
+ this.isDemo = false;
63
+
64
+ this._transitioning = false;
65
+ this._hasPrimaryNav = false;
66
+ this._hasSearch = false;
67
+ this._animationDuration = 500;
68
+ this._slottedComponents = {};
69
+ }
70
+
71
+ /**
72
+ * @method _onLocationChange
73
+ * @description Called when url changes by popstate controller
74
+ */
75
+ _onLocationChange(){
76
+ this.close();
77
+ }
78
+
79
+ /**
80
+ * @method open
81
+ * @description Opens header menu in mobile
82
+ * @returns {Promise}
83
+ */
84
+ async open(){
85
+ if ( this._transitioning || this.opened ) return false;
86
+
87
+ this.opened = true;
88
+ this._transitioning = true;
89
+ await this.wait.wait(this._animationDuration);
90
+ this._transitioning = false;
91
+ return true;
92
+ }
93
+
94
+ /**
95
+ * @method close
96
+ * @description Closes heaader menu in mobile
97
+ * @returns {Promise}
98
+ */
99
+ async close(){
100
+ if ( this._transitioning || !this.opened ) return false;
101
+
102
+ this.opened = false;
103
+ this._transitioning = true;
104
+ await this.wait.wait(this._animationDuration);
105
+ this._transitioning = false;
106
+ return true;
107
+ }
108
+
109
+ /**
110
+ * @method _onBtnClick
111
+ * @private
112
+ * @description Attached to menu open/close button
113
+ */
114
+ async _onBtnClick(){
115
+ let didToggle;
116
+ if ( this.opened ) {
117
+ didToggle = await this.close();
118
+ } else {
119
+ didToggle = await this.open();
120
+ }
121
+ if ( didToggle ) {
122
+ this.dispatchEvent(new CustomEvent('toggle', {
123
+ detail : {open: this.opened}
124
+ }));
125
+ }
126
+ }
127
+
128
+ /**
129
+ * @method _getNavbarClasses
130
+ * @description Get classes to be assigned to the navbar container
131
+ * @private
132
+ * @returns {Object}
133
+ */
134
+ _getNavbarClasses(){
135
+ let classes = {
136
+ "l-navbar": true,
137
+ "header__navbar": true
138
+ };
139
+
140
+ if (this.opened) {
141
+ classes['menu--open'] = true;
142
+ } else {
143
+ if ( !this._transitioning ) classes['menu--hidden'] = true;
144
+ classes['menu--closed'] = true;
145
+ }
146
+
147
+ return classes;
148
+ }
149
+
150
+ /**
151
+ * @method _getHeaderClasses
152
+ * @description Get classes to be assigned to the header element
153
+ * @private
154
+ * @returns {Object}
155
+ */
156
+ _getHeaderClasses(){
157
+ let classes = {
158
+ "l-header": true,
159
+ "header": true
160
+ };
161
+
162
+ classes['fixed-mobile'] = !this.preventFixed;
163
+ classes['fixed-desktop'] = !this.preventFixed;
164
+
165
+ return classes;
166
+ }
167
+
168
+ /**
169
+ * @method _ucdLogo
170
+ * @description Returns URI-encoded svg string of UC Davis logo
171
+ * @private
172
+ * @param {String} color - Color of logo. 'blue', 'gold' or 'white'.
173
+ * @returns {String}
174
+ */
175
+ _ucdLogo(color="blue"){
176
+ const colors = {
177
+ "blue": "#022851",
178
+ "gold": "#FFBF00",
179
+ "white": "#FFFFFF"
180
+ };
181
+ return encodeURIComponent(
182
+ `<svg xmlns="http://www.w3.org/2000/svg" width="100" height="16.157"><path fill="${colors[color]}" d="M58.865 4.877c.101.661 1.101 5.405 1.101 5.405h-2.194l1.093-5.405zm-8.328 11.03h5.806l.438-1.947h4.144l.554 1.947h5.806L61.846.403h-6.087l-5.222 15.504zM36.284.402h5.624c5.107 0 9.007 2.277 9.007 7.974 0 4.591-3.18 7.529-7.645 7.529l-6.986-.009V.402zm5.524 11.052h.376c1.843 0 3.207-1.072 3.207-3.096 0-2.179-1.21-3.395-3.234-3.395h-.349v6.491zM32.941.888l.296 2.545c.071.604.426 2.052-.011 1.858-.276-.121-.502-.776-.726-1.36-.114-.295-.658-1.695-.801-1.799-.685-.501-2.401-1.064-3.561-1.069-3.521-.013-5.847 2.509-5.847 6.982 0 3.208 1.582 7.061 5.607 7.061 1.441 0 4.201-.443 4.952-2.436.339-.9.65-1.703.876-1.459.166.177-.05.899-.15 1.289-.474 1.847-.501 2.406-.65 2.479-1.818.885-4.15 1.178-6.191 1.178-6.485 0-8.726-3.678-8.726-7.354 0-6.379 4.032-9.021 10.286-8.791 1.58.058 3.163.334 4.646.876M13.784 1.171L12.745.819c-.35-.306.075-.391.075-.391s1.5.271 5.24-.036c0 0 .328.062.103.319l-1.228.511c-.798.338-.798.143-.798.994l-.007 7.902c0 6.178-6.47 6.039-7.73 6.039-.6 0-6.488 0-6.488-4.961V2.834c0-1.46.159-1.419-.338-1.591L.071.695S-.183.347.269.368c1.227.06 3.004.316 7.133.024 0 0 .362.085.125.342l-1.201.339c-.95.414-.825.098-.849 1.045l.028 8.248c0 2.021 1.07 4.524 4.395 4.524 4.585 0 4.627-3.854 4.627-4.71l.009-8.167c.049-.77-.052-.551-.752-.842M87.65 14.715l1.6-4.111.281.23c.982.781 2.316 1.443 3.574 1.471 1.127.023 1.676-.268 1.527-1.191-.113-.693-.916-.812-1.417-.91l-1.103-.213c-2.143-.39-3.941-1.673-3.941-4.104 0-3.677 3.262-5.737 6.544-5.737 1.726 0 3.306.424 4.786 1.36L98.11 5.156c-.762-.533-1.918-1.285-3.377-1.337-.482-.018-1.58.229-1.229 1.312.152.462.833.657 1.252.755l1.241.292c2.325.526 4.003 1.81 4.003 4.432 0 3.699-3.281 5.529-6.542 5.529-1.901 0-4.106-.527-5.808-1.424M80.979.403h5.492v15.504h-5.492zM74.684.402h5.72l-5.843 15.503h-4.644L64.09.402h5.704l2.442 9.354z"/></svg>`);
183
+
184
+ }
185
+
186
+ /**
187
+ * @method _onChildListMutation
188
+ * @description Fires when there are changes to this element's non-shadow DOM children
189
+ * @private
190
+ */
191
+ _onChildListMutation(){
192
+ let primaryNav = this.querySelector('ucdlib-primary-nav');
193
+ if ( primaryNav ) {
194
+ primaryNav.setAttribute('slot', 'primary-nav');
195
+ this._hasPrimaryNav = true;
196
+ this._slottedComponents.primaryNav = primaryNav;
197
+ } else {
198
+ if ( !this.silenceWarnings ) {
199
+ console.warn("No 'ucdlib-primary-nav' child element found!");
200
+ }
201
+ this._hasPrimaryNav = false;
202
+ }
203
+ }
204
+
205
+ }
206
+
207
+ customElements.define('ucdlib-header', UcdlibHeader);
@@ -0,0 +1,283 @@
1
+ import { html, css } from 'lit';
2
+ import { classMap } from 'lit/directives/class-map.js';
3
+ // import { ifDefined } from 'lit/directives/if-defined.js';
4
+
5
+ import headingStyles from "@ucd-lib/theme-sass/1_base_html/_headings.css.js";
6
+ import headerStyles from "@ucd-lib/theme-sass/4_component/_header.css.js";
7
+ import headerLayoutStyles from "@ucd-lib/theme-sass/5_layout/_l-header.css.js"
8
+ import brandingStyles from "@ucd-lib/theme-sass/4_component/_site-branding.css.js"
9
+ import mobileBarStyles from "@ucd-lib/theme-sass/4_component/_mobile-bar.css.js";
10
+ import navToggleStyles from "@ucd-lib/theme-sass/4_component/_nav-toggle.css.js"
11
+ // import offCanvasStyles from "@ucd-lib/theme-sass/4_component/_nav-off-canvas.css.js"
12
+
13
+ export function styles() {
14
+ const elementStyles = css`
15
+ :host {
16
+ display: block;
17
+ }
18
+ [hidden] {
19
+ display: none !important;
20
+ }
21
+ button {
22
+ cursor: pointer;
23
+ }
24
+
25
+ #nav-bar .ucd-logo {
26
+ height: 1.25rem;
27
+ position: relative;
28
+ top: .95rem;
29
+ margin: 0 1rem;
30
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="16.157"><path fill="white" d="M58.865 4.877c.101.661 1.101 5.405 1.101 5.405h-2.194l1.093-5.405zm-8.328 11.03h5.806l.438-1.947h4.144l.554 1.947h5.806L61.846.403h-6.087l-5.222 15.504zM36.284.402h5.624c5.107 0 9.007 2.277 9.007 7.974 0 4.591-3.18 7.529-7.645 7.529l-6.986-.009V.402zm5.524 11.052h.376c1.843 0 3.207-1.072 3.207-3.096 0-2.179-1.21-3.395-3.234-3.395h-.349v6.491zM32.941.888l.296 2.545c.071.604.426 2.052-.011 1.858-.276-.121-.502-.776-.726-1.36-.114-.295-.658-1.695-.801-1.799-.685-.501-2.401-1.064-3.561-1.069-3.521-.013-5.847 2.509-5.847 6.982 0 3.208 1.582 7.061 5.607 7.061 1.441 0 4.201-.443 4.952-2.436.339-.9.65-1.703.876-1.459.166.177-.05.899-.15 1.289-.474 1.847-.501 2.406-.65 2.479-1.818.885-4.15 1.178-6.191 1.178-6.485 0-8.726-3.678-8.726-7.354 0-6.379 4.032-9.021 10.286-8.791 1.58.058 3.163.334 4.646.876M13.784 1.171L12.745.819c-.35-.306.075-.391.075-.391s1.5.271 5.24-.036c0 0 .328.062.103.319l-1.228.511c-.798.338-.798.143-.798.994l-.007 7.902c0 6.178-6.47 6.039-7.73 6.039-.6 0-6.488 0-6.488-4.961V2.834c0-1.46.159-1.419-.338-1.591L.071.695S-.183.347.269.368c1.227.06 3.004.316 7.133.024 0 0 .362.085.125.342l-1.201.339c-.95.414-.825.098-.849 1.045l.028 8.248c0 2.021 1.07 4.524 4.395 4.524 4.585 0 4.627-3.854 4.627-4.71l.009-8.167c.049-.77-.052-.551-.752-.842M87.65 14.715l1.6-4.111.281.23c.982.781 2.316 1.443 3.574 1.471 1.127.023 1.676-.268 1.527-1.191-.113-.693-.916-.812-1.417-.91l-1.103-.213c-2.143-.39-3.941-1.673-3.941-4.104 0-3.677 3.262-5.737 6.544-5.737 1.726 0 3.306.424 4.786 1.36L98.11 5.156c-.762-.533-1.918-1.285-3.377-1.337-.482-.018-1.58.229-1.229 1.312.152.462.833.657 1.252.755l1.241.292c2.325.526 4.003 1.81 4.003 4.432 0 3.699-3.281 5.529-6.542 5.529-1.901 0-4.106-.527-5.808-1.424M80.979.403h5.492v15.504h-5.492zM74.684.402h5.72l-5.843 15.503h-4.644L64.09.402h5.704l2.442 9.354z"/></svg>') no-repeat;
31
+ width: 7.7rem;
32
+ background-size: 7.7rem;
33
+ }
34
+
35
+ #nav-bar .logo-container:hover .ucd-logo {
36
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="16.157"><path fill="%23022851" d="M58.865 4.877c.101.661 1.101 5.405 1.101 5.405h-2.194l1.093-5.405zm-8.328 11.03h5.806l.438-1.947h4.144l.554 1.947h5.806L61.846.403h-6.087l-5.222 15.504zM36.284.402h5.624c5.107 0 9.007 2.277 9.007 7.974 0 4.591-3.18 7.529-7.645 7.529l-6.986-.009V.402zm5.524 11.052h.376c1.843 0 3.207-1.072 3.207-3.096 0-2.179-1.21-3.395-3.234-3.395h-.349v6.491zM32.941.888l.296 2.545c.071.604.426 2.052-.011 1.858-.276-.121-.502-.776-.726-1.36-.114-.295-.658-1.695-.801-1.799-.685-.501-2.401-1.064-3.561-1.069-3.521-.013-5.847 2.509-5.847 6.982 0 3.208 1.582 7.061 5.607 7.061 1.441 0 4.201-.443 4.952-2.436.339-.9.65-1.703.876-1.459.166.177-.05.899-.15 1.289-.474 1.847-.501 2.406-.65 2.479-1.818.885-4.15 1.178-6.191 1.178-6.485 0-8.726-3.678-8.726-7.354 0-6.379 4.032-9.021 10.286-8.791 1.58.058 3.163.334 4.646.876M13.784 1.171L12.745.819c-.35-.306.075-.391.075-.391s1.5.271 5.24-.036c0 0 .328.062.103.319l-1.228.511c-.798.338-.798.143-.798.994l-.007 7.902c0 6.178-6.47 6.039-7.73 6.039-.6 0-6.488 0-6.488-4.961V2.834c0-1.46.159-1.419-.338-1.591L.071.695S-.183.347.269.368c1.227.06 3.004.316 7.133.024 0 0 .362.085.125.342l-1.201.339c-.95.414-.825.098-.849 1.045l.028 8.248c0 2.021 1.07 4.524 4.395 4.524 4.585 0 4.627-3.854 4.627-4.71l.009-8.167c.049-.77-.052-.551-.752-.842M87.65 14.715l1.6-4.111.281.23c.982.781 2.316 1.443 3.574 1.471 1.127.023 1.676-.268 1.527-1.191-.113-.693-.916-.812-1.417-.91l-1.103-.213c-2.143-.39-3.941-1.673-3.941-4.104 0-3.677 3.262-5.737 6.544-5.737 1.726 0 3.306.424 4.786 1.36L98.11 5.156c-.762-.533-1.918-1.285-3.377-1.337-.482-.018-1.58.229-1.229 1.312.152.462.833.657 1.252.755l1.241.292c2.325.526 4.003 1.81 4.003 4.432 0 3.699-3.281 5.529-6.542 5.529-1.901 0-4.106-.527-5.808-1.424M80.979.403h5.492v15.504h-5.492zM74.684.402h5.72l-5.843 15.503h-4.644L64.09.402h5.704l2.442 9.354z"/></svg>') no-repeat;
37
+ width: 7.7rem;
38
+ background-size: 7.7rem;
39
+ }
40
+
41
+ .logo-container {
42
+ display: flex;
43
+ background-color: #13639E;
44
+ clip-path: polygon(1rem 0px, 110% 0px, 110% 102%, 0% 102%);
45
+ }
46
+
47
+ .logo-container::before {
48
+ width: 1rem;
49
+ margin-left: 0.5rem;
50
+ background-color: #14447A;
51
+ content: "";
52
+ transform: skewX(-16deg);
53
+ }
54
+
55
+ .logo-link::before {
56
+ width: 1rem;
57
+ color: white;
58
+ }
59
+
60
+ .logo-container:hover {
61
+ background-color: #FFBF00;
62
+
63
+ }
64
+ .logo-link img {
65
+ fill: #FFFFFF;
66
+ }
67
+ .logo-container:hover img {
68
+ fill: #022851;
69
+ }
70
+
71
+ .site-name-container {
72
+ margin: auto 0;
73
+ }
74
+
75
+ .site-branding__site-name a,
76
+ .site-branding__site-name a:hover {
77
+ color: #FFBF00;
78
+ text-decoration: none;
79
+ }
80
+
81
+ .site-branding__site-name a {
82
+ font-size: 1.5rem;
83
+ padding: 1rem;
84
+ }
85
+
86
+ `;
87
+
88
+ return [
89
+ headingStyles,
90
+ headerStyles,
91
+ headerLayoutStyles,
92
+ brandingStyles,
93
+ mobileBarStyles,
94
+ navToggleStyles,
95
+ elementStyles
96
+ ];
97
+ }
98
+
99
+ export function render() {
100
+ return html`
101
+ ${this.isDemo ? html`
102
+ <style>
103
+ .l-navbar { top: auto !important}
104
+ </style>
105
+ ` : html``}
106
+
107
+ <style>
108
+ @media (min-width: ${this.mobileWidth}px) {
109
+ .l-header .mobile-bar {
110
+ display: none;
111
+ }
112
+ }
113
+
114
+ @media (max-width: ${this.mobileWidth - 1}px) {
115
+ .fixed-mobile .mobile-bar {
116
+ position: fixed;
117
+ width: 100%;
118
+ z-index: 1000;
119
+ top: 0;
120
+ }
121
+ .fixed-mobile .off-canvas {
122
+ position: fixed;
123
+ overflow: auto;
124
+ z-index: 1000;
125
+ top: 55px;
126
+ }
127
+ .fixed-mobile .l-header__branding {
128
+ margin-top: 55px;
129
+ }
130
+ .branding-bar-mobile-links {
131
+ display: block;
132
+ }
133
+ .site-branding__site-name,
134
+ .logo-container {
135
+ display: none !important;
136
+ }
137
+ }
138
+
139
+ @media (min-width: ${this.mobileWidth}px) {
140
+ .fixed-desktop .l-navbar {
141
+ position: fixed;
142
+ z-index: 1000;
143
+ top: 0;
144
+ right: 0;
145
+ left: 0;
146
+ width: 100%;
147
+ }
148
+ }
149
+
150
+ .l-header .l-navbar {
151
+ position: relative;
152
+ z-index: 830;
153
+ height: 100%;
154
+ min-height: 3.25rem;
155
+ }
156
+ @media (max-width: ${this.mobileWidth - 1}px) {
157
+ .l-header .l-navbar {
158
+ position: absolute;
159
+ top: 3.25rem;
160
+ left: 0;
161
+ }
162
+ .off-canvas--left {
163
+ left: 0;
164
+ }
165
+ .off-canvas {
166
+ position: absolute;
167
+ z-index: 830;
168
+ width: 70vw;
169
+ min-width: 15rem;
170
+ height: 100%;
171
+ background: #fff;
172
+ transition: all 0.3s;
173
+ }
174
+ .off-canvas__container {
175
+ position: static;
176
+ }
177
+ .menu--hidden .off-canvas__container {
178
+ display: none;
179
+ }
180
+ .off-canvas--fixed, .l-header--fixed .off-canvas {
181
+ position: fixed;
182
+ z-index: 1000;
183
+ overflow: auto;
184
+ }
185
+ .off-canvas--fixed .off-canvas__container, .l-header--fixed .off-canvas .off-canvas__container {
186
+ padding-bottom: 9rem;
187
+ }
188
+ .menu--closed .off-canvas--left {
189
+ transform: translateX(-105%);
190
+ }
191
+ .l-header .mobile-bar {
192
+ display: flex;
193
+ align-items: center;
194
+ overflow: hidden;
195
+ min-height: 3.25rem;
196
+ background-color: #022851;
197
+ }
198
+ }
199
+ @media (min-width: ${this.mobileWidth}px) {
200
+ .l-header .l-navbar {
201
+ width: 100%;
202
+ height: auto;
203
+ }
204
+ .l-header--fixed .l-navbar.is-fixed {
205
+ position: fixed;
206
+ z-index: 1000;
207
+ top: 0;
208
+ right: 0;
209
+ left: 0;
210
+ width: 100%;
211
+ }
212
+ .menu--hidden .off-canvas__container {
213
+ display: grid;
214
+ }
215
+ .l-nav-horizontal {
216
+ display: grid;
217
+ grid-template-areas: "nav search quick";
218
+ grid-template-columns: 1fr max-content max-content;
219
+ }
220
+ .l-nav-horizontal__primary-nav {
221
+ grid-area: nav;
222
+ }
223
+ .l-nav-horizontal__search-popup {
224
+ z-index: 3;
225
+ grid-area: search;
226
+ }
227
+ .l-nav-horizontal__search-popup .search-popup__open {
228
+ position: relative;
229
+ }
230
+ .l-nav-horizontal__quick-links {
231
+ z-index: 2;
232
+ grid-area: quick;
233
+ }
234
+ .site-branding__site-name {
235
+ font-size: 2rem !important;
236
+ }
237
+ }
238
+ </style>
239
+
240
+ <header class=${classMap(this._getHeaderClasses())}>
241
+ <div class="mobile-bar">
242
+ <div class="mobile-bar__nav-toggle">
243
+ <button
244
+ @click=${this._onBtnClick}
245
+ class="nav-toggle ${this.opened ? 'nav-toggle--active' : ''}"
246
+ aria-controls="primary-nav"
247
+ aria-expanded="${this.opened ? 'true' : 'false'}"
248
+ aria-label="Toggle Main Menu">
249
+ <span class="nav-toggle__icon nav-toggle__icon--menu">Menu</span>
250
+ </button>
251
+ </div>
252
+ <div class="mobile-bar__fixed-site-name"><a href="/">${this.siteName}</a></div>
253
+ <div class="mobile-bar__university">
254
+ <a href="https://www.ucdavis.edu/" aria-label="UC Davis main website link">
255
+ <img class="ucd-logo" src='data:image/svg+xml;utf8,${this._ucdLogo('gold')}' alt="UC Davis main website link">
256
+ </a>
257
+ </div>
258
+ </div>
259
+
260
+ <div class="${classMap(this._getNavbarClasses())}" id="nav-bar">
261
+ <div class="l-container--navigation off-canvas off-canvas--left">
262
+ <div class="off-canvas__container l-nav-horizontal">
263
+ <div class="site-name-container">
264
+ <h1 class="site-branding__site-name" ?hidden=${!this.siteName}>
265
+ <a href="/">${this.siteName}</a>
266
+ </h1>
267
+ </div>
268
+ <div>
269
+ <slot name="primary-nav"></slot>
270
+ </div>
271
+ <div class="logo-container">
272
+ <a class="logo-link" href="https://www.ucdavis.edu/" aria-label="UC Davis main website link">
273
+ <div class="ucd-logo"></div>
274
+ </a>
275
+ </div>
276
+
277
+ </div>
278
+ </div>
279
+ </div>
280
+ </header>
281
+
282
+
283
+ `;}