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

42
Views
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
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!