-
Notifications
You must be signed in to change notification settings - Fork 0
/
md-card.html
81 lines (71 loc) · 1.75 KB
/
md-card.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<link rel="import" href="../polymer/polymer.html">
<dom-module id="md-card">
<style>
:host{
display: inline-block;
position: relative;
box-sizing: border-box;
background: #fff;
border-radius: 2px;
border: 1px solid #f0f0f0;
border-bottom: 1px solid #cccdd2;
min-height:150px;
margin-bottom:1em;
}
:host>header{
padding: .1em .5em;
color: #b4b5b5;
width:100%;
}
:host>section{
color: #b4b5b5;
display:-webkit-flex;
display:flex;
-webkit-flex-direction: column;
flex-direction:column;
padding: .75em;
width:100%;
}
:host hr{
border: 0;
border-top: 1px solid #e9eaed;
margin: 1.25em 0;
height: 1px;
}
</style>
<template>
<header>
<span>[[headerText]]</span>
<span id="header-icon"></span>
</header>
<hr>
<section>
<content></content>
</section>
</template>
</dom-module>
<script>
Polymer({
is: 'md-card',
properties:{
headerText:{
type:String,
value:null
},
headerIcon:{
type:String,
value:null
}
},
ready:function(){
this._setIcon();
},
_setIcon:function(){
if(this.headerIcon){
var span=this.$['header-icon'];
var icon = 'icon-' + this.headerIcon;
span.classList.add(icon);
}
}
});
</script>