Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
Styled Components cannot set :hover properties

export const WatchVideoButtonWrapper = styled.div`
    position: absolute;
    bottom: 80px;
    right: 33px;
    background-color: ${(props) => props.bgColor};
    color: ${(props) => props.color};
    border-radius: 100px;
    transition: all 0.1s;
    cursor: pointer;
    fill: ${(props) => props.color};
    &:hover {
        background-color: ${(props) => props.hoverBgColor};
        color: ${(props) => props.hoverColor};
        fill: ${(props) => props.hoverColor};
    }
`;

And I am passing the props as such:

<WatchVideoButtonWrapper
            bgColor={navbar_button_background_color}
            color={navbar_button_text_and_icon_color}
            hoverBgColor={navbar_button_hover_background_color}
            hoverColor={navbar_button_hover_text_and_icon_color}
>
...
</WatchVideoButtonWrapper>

Everything works except the hover state. I want to implement a simple css animation when the div is hovered, but using styled components. I have referred to the documentation and it seems all I need is &:hover {} inside the styled component. SO... the styles load and the background color and text color is correct, but when hovered, the effect is not firing.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Have you tried placing it a a higher z-index ? may be there is a block in front of your element that is preventing the pointer from interacting with it ? just a first idea...

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!