Skip to content

Instantly share code, notes, and snippets.

@jaredpalmer
Created October 19, 2017 14:33
Show Gist options
  • Save jaredpalmer/4d4fa293f3f6d8351a5e7975b22b5a51 to your computer and use it in GitHub Desktop.
Save jaredpalmer/4d4fa293f3f6d8351a5e7975b22b5a51 to your computer and use it in GitHub Desktop.
glamor-jsxstyle dirty
import React from 'react';
import { css as Style } from 'glamor';
const View = ({
component = 'div',
props,
css,
className,
children,
...rest,
}) => {
return React.createElement(
component,
{ ...props, className, ...Style({ ...rest, ...css }) },
children
);
};
export const Block = props => (
<View display="block" {...props} />
);
export const InlineBlock = props => (
<View display="inline-block" {...props} />
);
export const Inline = props => (
<View display="inline" {...props} />
);
export const Flex = props => (
<View display="flex" {...props} />
);
export const InlineFlex = props => (
<View display="inline-flex" {...props} />
);
export const Row = props => (
<Flex flexDirection="row" {...props} />
);
export const Col = props => (
<Flex flexDirection="column" {...props} />
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment