forked from robinweser/fela
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrenderer.js
35 lines (30 loc) · 943 Bytes
/
renderer.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
import { createRenderer } from 'fela'
import prefixer from 'fela-plugin-prefixer'
import fallbackValue from 'fela-plugin-fallback-value'
import unit from 'fela-plugin-unit'
import lvha from 'fela-plugin-lvha'
import validator from 'fela-plugin-validator'
import logger from 'fela-plugin-logger'
import perf from 'fela-perf'
import beautifier from 'fela-beautifier'
export default () => {
const renderer = createRenderer({
plugins: [prefixer(), fallbackValue(), unit(), lvha(), validator(), logger({ logMetaData: true })],
enhancers: [perf(), beautifier()]
})
renderer.renderStatic(
{
width: '100%',
height: '100%',
margin: 0,
padding: 0,
fontFamily: 'Lato'
},
'html,body,#app'
)
renderer.renderStatic({ display: 'flex' }, 'div')
renderer.renderFont('Lato', [
'https://fonts.gstatic.com/s/lato/v11/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff'
])
return renderer
}