-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
43 lines (36 loc) · 810 Bytes
/
index.tsx
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
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createTheme } from '../.';
const Theme = createTheme({
color: {
lightPrimary: '#fff',
darkPrimary: '#000',
}
});
const DarkTheme = createTheme({
color: {
lightPrimary: '#000',
darkPrimary: '#fff',
}
})
const style = document.createElement('style');
style.innerHTML = `
:root {
${Theme.css.string}
}
@media (prefers-color-scheme: dark) {
:root {
${DarkTheme.css.string}
}
}
`
document.head.appendChild(style)
const App = () => {
return (
<div style={{ backgroundColor: Theme.color.lightPrimary, color: Theme.color.darkPrimary }}>
<h1>It Works</h1>
</div>
);
};
ReactDOM.render(<App />, document.getElementById('root'));