-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxenon-section.html
31 lines (30 loc) · 1.17 KB
/
xenon-section.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
<link rel="import" href="../polymer/polymer.html"/>
<dom-module id="xenon-section">
<template>
<style>
#section { background-size:cover; background-position: center; display:flex; justify-content: center; align-items:center; height:inherit; }
#wrap { box-sizing: border-box; padding:4px; display:flex; max-width:1000px; flex-wrap:wrap; flex-direction:row; width:100%; }
#wrap ::content > * { flex:1 1 340px; margin:4px; box-sizing: border-box; }
</style>
<div id="section" style="{{style}}"> <!-- full width wrapper -->
<div id="wrap"> <!-- content area limited width -->
<content></content>
</div>
</div>
</template>
<script>
Polymer({
is:"xenon-section",
properties: {
/* style for the wrapper element */
style: { type:String },
/* src background image */
src: { type:String, observer:"_setSrc" }
},
/* set the background image */
_setSrc: function(value) {
this.$.section.style.backgroundImage = "url('" + value + "')";
}
});
</script>
</dom-module>