-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathbutton.js
46 lines (42 loc) · 876 Bytes
/
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
44
45
46
import React from 'react';
import Style from 'react-inline-style';
let styles = Style.define({
container: {
textAlign: 'center'
},
button: {
backgroundColor: '#ff0000',
width: '320px',
padding: '20px',
borderRadius: '5px',
border: 'none',
outline: 'none',
hover: {
color: '#fff'
},
pressed: {
position: 'relative',
top: '2px'
}
}
});
styles = styles.global({
'@media (max-width: 480px)': {
'button': {
width: '160px !important'
}
}
})
const Button = React.createClass({
mixins: [styles()],
render() {
return (
<div style={this.style('container')}>
<button style={this.style('button', 'button.hover:hover', 'button.pressed:pressed')}>
Click me!
</button>
</div>
);
}
});
React.render(<Button />, document.getElementById('content'));