blob: 168954bcedd5bb05151b443918540496d9dd09d3 [file] [log] [blame] [edit]
window.getMatchedCSSRules = (el, css = el.ownerDocument.styleSheets) =>
[].concat(...[...css].map(s => [...s.cssRules||[]])).filter(r => el.matches(r.selectorText));