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

130
Views
Access / read adoptedStyleSheets

For a project, I would like to access all adoptedStyleSheets that got passed to a document or shadow root. I don't have any reference to stylesheet itself in this scenario.

const sheet = new CSSStyleSheet();
someShadowRoot.adoptedStyleSheets = [ sheet ];

Is there any documented way to access or read the adoptedStyleSheets?

For more information, I'm talking about https://web.dev/constructable-stylesheets/

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

0

Simply printing the adoptedStyleSheets didn't work, so I did not proceed further. It turned out that iterating through the array did actually do the trick.

for (let i = 0; i < document.adoptedStyleSheets.length; i++) {
    console.log(document.adoptedStyleSheets[i]);
}

Thanks to @Justinas for pointing out the obvious.

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!