Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see the full css code in data-styled="active" on a react website

i went to this site which is a react website in there i tried to find the css file it showed me <style data-styled="active" data-styled-version="5.2.1"></style> how can i copy all the css code in the <style data-styled="active" data-styled-version="5.2.1"></style>enter image description here

i tried to inspect and try to do all the experiments but it didn't show any css i was looking

like image 801
jackson hill Avatar asked Jun 01 '26 03:06

jackson hill


1 Answers

There is a way to see the CSS generated by the Library.

document.styleSheets instance contain all the CSS Text in the DOM itself (inline, external and generated).

tryout below statement in your console.

Array.from(document.styleSheets).filter(ss => ss.ownerNode !== null && ss.ownerNode !== undefined).filter(ss => ss.ownerNode.getAttribute("data-styled")).filter(ss => ss.cssRules !== undefined && ss.cssRules !== null).forEach(ss => console.log(Array.from(ss.cssRules).map(rule => rule.cssText).reduce((r,v)=>r+v)) )

NOTE: Some webpage won't allow accessing the styleSheet which would throw a SecurityError

like image 145
Dhayal Nagaraj Avatar answered Jun 02 '26 16:06

Dhayal Nagaraj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!