Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

React - macro component conditional rendering for CSS properties with emotion props

0 votes
10 views
added Apr 28 in React by lcjr Second Warrant Officer (5,360 points)
edited 4 days ago by lcjr
import styled from '@emotion/styled';
import { keyframes } from '@emotion/react';

const bounce = keyframes`
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
`;

const Button = styled.button`
  border: 0;
  background: 0 0;
  padding: 10px 14px 5px;
  color: ${props => props.theme.colors.primary}; 
  height: 40px;  
  border: 1px solid ${props => props.theme.type === "theme1" ? 'transparent' : props.theme.colors.primary};
  &:after {
    content:'${props => props.theme.type === "theme1" ? '' : 'share'}';
  }
`;

export default Button;

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...