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

377
Views
Detect css changes (mutationObserver on styleSheet css)

Is there a way to detect stylesheet changes ? MutationObserver only tracks inline css changes on the element.

html

<div class="exampleClass"></div>

js

let config = {
    attributes: true,
    // attributeFilter: ["style"],
  };

  let mutationCallback = function(mutationsList) {
    mutationsList.forEach((mutation, i) => {
      console.log(mutation);
    });
  };
  let observer = new MutationObserver(mutationCallback);
  observer.observe(document.querySelector('.exampleClass'), config);

If I modify the element throught js with

document.querySelector(‘exampleClass’).style.top = '10px'

or the webconsole inspector directly on the node, the mutation observer callback is called, but if the class (not the node itself) is modified in the webconsole inspector there is no callback

about 4 years ago · Juan Pablo Isaza
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!