1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-28 12:50:05 +02:00
copilot/packages/ui-toolkit/src/basealign/index.js

21 lines
467 B
JavaScript
Raw Normal View History

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}`;