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

45
Vistas
Why does the hidden root of the web component (custom component) always copy the style of the root itself?

I create and use a web component.

and I give a little style to the web component. After that, the web component always injects its own style into the shadow root.

This is the code.

 <custom-element style="width: 50%; border: 1px solid red" />

And I can see this dom structure in elements tab of devTool

 <custom-element style="width: 50%; border: 1px solid red">
 #shadow-root
 <div style="width: 50%; border: 1px solid red">
 ~~~~
 </div>
</custom-element>

But I want to style only the custom element. Or give a style just for the shadow root. How can I do this?

over 2 years ago · Carlos Garzón Colorado
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