-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdees-section-fullheight.html
49 lines (45 loc) · 1.23 KB
/
dees-section-fullheight.html
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
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../dees-style-shared/dees-style-shared.html">
<!--
`dees-section-fullheight`
a fullheight section
@demo demo/index.html
-->
<dom-module id="dees-section-fullheight">
<template>
<style include="dees-style-shared">
:host {
display: block;
background-image: url(https://images.unsplash.com/photo-1440557653082-e8e186733eeb);
background-size: cover;
background-position: center;
width: 100%;
min-height: var(--host-height);
overflow: auto;
}
</style>
<slot></slot>
</template>
<script>
class deesSectionFullheight extends Polymer.Element {
static get is() { return 'dees-section-fullheight'; }
static get properties() {
return {
height: {
type: Number,
value: undefined
}
};
}
ready() {
super.ready()
let elementHeight = window.innerHeight
this.updateStyles({
"--host-height": elementHeight.toString() + 'px'
})
return elementHeight
}
}
window.customElements.define(deesSectionFullheight.is, deesSectionFullheight);
</script>
</dom-module>