Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 1.14 KB

Ecosystem.md

File metadata and controls

57 lines (44 loc) · 1.14 KB

Ecosystem

styled-components API for React with support for prop-based styling

import styled from 'style9-components.macro';

// Create new component
const Component = styled.div({
  color: props => props.color,
  backgroundColor: 'red'
});

// Extend existing component
const WrappedComponent = styled(Component)({
  backgroundColor: 'blue'
});

// Support for overriding the element
<Component as="a" />

JSX CSS-prop API with support for prop-based styling

<div
  css={{
    color: props.color,
    animationName: {
      from: { opacity: 0 }
    }
  }}
/>

CSS macro for converting tagged template literal to object. Can be combined with any other library

import { css, keyframes } from 'css-to-js.macro';

css`
  color: red;
  font-size: ${props.fontSize};
  ${props.isBlue && css`
    color: blue;
  `}
  animation-name: ${keyframes`
    from { opacity: 1; }
  `};
`