-
Notifications
You must be signed in to change notification settings - Fork 0
/
mat-button.js
43 lines (37 loc) · 920 Bytes
/
mat-button.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
class MatButton extends HTMLElement {
constructor() {
super();
}
get styles() {
return `
mat-button {
display: inline-block;
color: white;
background-color: blueviolet;
padding: 0 2rem;
font-size: 1rem;
border-radius: 2px;
letter-spacing: .5px;
text-align: center;
text-decoration: none;
height: 36px;
line-height: 36px;
cursor: pointer;
box-shadow:
0 2px 2px 0 rgba(0,0,0,0.14),
0 1px 5px 0 rgba(0,0,0,0.12),
0 3px 1px -2px rgba(0,0,0,0.2)
}
`
}
applyStyles() {
let styleElement = document.createElement('style')
styleElement.innerHTML = this.styles;
document.head.appendChild(styleElement);
}
connectedCallback() {
console.log('Mat Button');
this.applyStyles();
}
}
customElements.define('mat-button', MatButton);