Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

styled components conditional hover

import { css, styled } from 'styled-components'

styled.div`
   ${props => props.shouldHover && css`
      &:hover {
        background: 'red';
      }
   `}
`
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #styled #components #conditional #hover
ADD COMMENT
Topic
Name
5+1 =