Simple react component to center children vertically.
yarn add react-centpn
import Center from 'react-centpn'
export default () =>
<div {...{ style: { position: 'relative', height: '100%' } }}>
<Center {...{ top: -20 }}>
<div {...{ style: { height: 100 } }}></div>
</Center>
</div>
Used as calc(50% - ${contentHeight / 2} + (props.top))
.
props.top
as number will be processed ${props.top}px
.