1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-15 15:50:06 +02:00
copilot/packages/styled-is/src/index.js

14 lines
506 B
JavaScript
Raw Normal View History

2017-06-16 23:46:36 +03:00
import { css } from 'styled-components';
export default (...names) => (...args) => props =>
names.every(name => props[name]) ? css(...args) : css``;
export const isNot = (...names) => (...args) => props =>
names.every(name => !props[name]) ? css(...args) : css``;
export const isOr = (...names) => (...args) => props =>
names.some(name => props[name]) ? css(...args) : css``;
export const isSomeNot = (...names) => (...args) => props =>
names.some(name => !props[name]) ? css(...args) : css``;