mirror of
https://github.com/yldio/copilot.git
synced 2024-12-28 12:50:05 +02:00
21 lines
467 B
JavaScript
21 lines
467 B
JavaScript
|
import unitcalc from 'unitcalc';
|
||
|
import styled from 'styled-components';
|
||
|
import camelCase from 'camel-case';
|
||
|
|
||
|
const aligns = ['vertical-align'];
|
||
|
|
||
|
const alignsFromProps = props =>
|
||
|
aligns
|
||
|
.filter(align => props[camelCase(align)])
|
||
|
.map(
|
||
|
align => `
|
||
|
${align}: ${props[camelCase(align)]};
|
||
|
`
|
||
|
)
|
||
|
.join(';\n');
|
||
|
|
||
|
export default Component =>
|
||
|
Component.extend
|
||
|
? Component.extend`${alignsFromProps}`
|
||
|
: styled(Component)`${alignsFromProps}`;
|