-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfela.js
63 lines (57 loc) · 1.24 KB
/
fela.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { createRenderer } from 'fela';
import webPreset from 'fela-preset-web';
// add your renderer configuration here
const renderer = createRenderer({
plugins: [...webPreset],
});
renderer.renderFont('Streamster', ['static/Streamster.ttf']);
renderer.renderFont('Minecrafter', ['static/Minecrafter.ttf']);
renderer.renderStatic({ boxSizing: 'border-box' }, '*');
renderer.renderStatic(
{
position: 'relative',
top: 0,
left: 0,
width: '100%',
height: '100%',
},
'html',
);
renderer.renderStatic(
{
position: 'relative',
top: 0,
left: 0,
width: '100%',
minHeight: '100%',
padding: 0,
margin: 0,
'-webkit-font-smoothing': 'subpixel-antialiased',
fontFamily: 'Minecrafter, cursive',
fontSize: '14px',
fontWeight: 200,
lineHeight: 1.5,
color: '#1F1F1F',
overflow: 'hidden',
},
'body',
);
renderer.renderStatic(
{
display: 'flex',
flexDirection: 'column',
alignItems: 'stretch',
width: '100%',
minHeight: '100vh',
},
['#__next', '#__next>div'],
);
export function getRenderer() {
return renderer;
}
export function getMountNode() {
if (typeof window !== 'undefined') {
return document.getElementById('fela-stylesheet');
}
return undefined;
}