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

115
Views
Los estilos anidados ignoran el estilo del componente con estilo

Estoy usando componentes con estilo a través de cdn. Si no anido estilos, mis componentes tienen estilo. Si trato de anidar, ninguno de los estilos tiene efecto.

 const AComponent = () => { return ( <StyledComponent> <p>Some Text</p> </StyledComponent> ) } // using this shows a red background color const StyledComponent = styled.div` background-color: red; ` // using this doesn't style anything - not even a red background color const StyledComponent = styled.div` background-color: red; p { color: black; } `
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Probé con un poco de giro y encontré que el siguiente código funcionaba.

 export const StyledComponent = styled.div` background-color: red; & > p { color: green; } `;

Aquí está el enlace de apoyo para la explicación https://github.com/styled-components/styled-components/issues/330

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!