mirror of
https://github.com/yldio/copilot.git
synced 2024-12-27 20:30:04 +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}`;
|