Skip to content

πŸ‘¨β€πŸŽ¨ Flag utility for emotion CSS-in-JS to conditionally apply styles

License

Notifications You must be signed in to change notification settings

karolisgrinkevicius/styled-conditions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘¨β€πŸŽ¨
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

About

πŸ‘¨β€πŸŽ¨ Flag utility for emotion CSS-in-JS to conditionally apply styles

Resources

License

Stars

Watchers

Forks

Packages

No packages published