-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathbutton.js
42 lines (37 loc) · 863 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
import React from 'react';
import { render } from 'react-dom';
import { styled, StyletronProvider } from 'styletron-react';
import Styletron from 'styletron-client';
const Container = styled('div', {
textAlign: 'center',
});
const Button = styled('button', {
backgroundColor: '#ff0000',
width: '320px',
padding: '20px',
borderRadius: '5px',
border: 'none',
outline: 'none',
':hover': {
color: '#fff',
},
':active': {
position: 'relative',
top: '2px',
},
'@media (max-width: 480px)': {
width: '160px',
},
});
const App = () => (
<Container>
<Button>Click me!</Button>
</Container>
);
const styleElements = document.getElementsByClassName('_styletron_hydrate_');
render(
<StyletronProvider styletron={new Styletron(styleElements)}>
<App />
</StyletronProvider>,
document.getElementById('content')
);