forked from BrightspaceUILabs/navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d2l-navigation-main-header.js
73 lines (63 loc) · 1.72 KB
/
d2l-navigation-main-header.js
1
2
3
4
5
6
7
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { navigationSharedStyle } from './d2l-navigation-shared-styles.js';
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
/**
`d2l-navigation-main-header`
Polymer-based web component for the larger, upper section of the navigational element
@demo demo/navigation-main-header.html
*/
class D2LNavigationMainHeader extends PolymerElement {
static get template() {
const template = html`
${navigationSharedStyle}
<style>
:host {
display: block;
}
.d2l-navigation-header-container {
align-items: center;
display: flex;
height: 90px;
}
@media (max-width: 767px) {
.d2l-navigation-header-container {
height: 72px;
}
}
div ::slotted(.d2l-navigation-header-left),
div ::slotted(.d2l-navigation-header-right) {
align-items: center;
display: flex;
height: 100%;
}
div ::slotted(.d2l-navigation-header-left) {
flex: 0 1 auto;
}
div ::slotted(.d2l-navigation-header-right) {
flex: 0 0 auto;
}
.d2l-navigation-gutter {
display: inline-block;
flex: 1 1 auto;
min-width: var(--d2l-navigation-margin-regular);
}
@media (max-width: 615px) {
.d2l-navigation-gutter {
min-width: var(--d2l-navigation-margin-regular) / 2;
}
}
</style>
<div class="d2l-navigation-centerer">
<div class="d2l-navigation-gutters">
<div class="d2l-navigation-header-container">
<slot name="left"></slot>
<div class="d2l-navigation-gutter"></div>
<slot name="right"></slot>
</div>
</div>
</div>
`;
template.setAttribute('strip-whitespace', '');
return template;
}
}
customElements.define('d2l-navigation-main-header', D2LNavigationMainHeader);