Answers for "how to apply a few styles properties depends on condition styled-components"

0

conditionally changing styled components based on props

const Text = styled.p`
  color: ${(props) => (props.red ? 'red' : 'blue')};
`
Posted by: Guest on May-27-2021
0

how to use in styled components the same settings of another element

import styled, { css } from ‘styled-components’;

const baseInputStyles = css`
  padding: 0.5em;
`;

const StyledA = styled.a`
  ${baseInputStyles}
`;

const StyledButton = styled.button`
  ${baseInputStyles}
  /* make changes as needed*/
`;
Posted by: Guest on December-07-2021

Code answers related to "how to apply a few styles properties depends on condition styled-components"

Code answers related to "Javascript"

Browse Popular Code Answers by Language