Skip to content
πŸ‘¨β€πŸŽ¨ Flag utility for emotion CSS-in-JS to conditionally apply styles
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
lib Initial Jul 12, 2019
.eslintrc
.gitignore
.prettierrc
.travis.yml
LICENSE
README.md
package-lock.json
package.json

README.md

πŸ‘¨β€πŸŽ¨
Styled Conditions

npm npm bundle size (minified + gzip) Travis CI Build PRs Welcome

Ultra-lightweight dependency-free flag utility for emotion CSS-in-JS to conditionally apply css depending on React props including support for styled-system.

Install

npm i --save styled-conditions

Usage

import styled from '@emotion/styled';
import { is } from 'styled-conditions';

const Button = styled(MyComponent)`
  ${is('black')`
    color: black;
  `}

  ${isNot('devil')`
    color: ${props => props.theme.colors.colorForAngels};
  `}
`;

License

MIT

You can’t perform that action at this time.