Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda