News for hackers. Stuff that matters.
Re:Show HN: Generate a concatenated file of all CSS used on ... by xnx on Monday September 25, 2023 @03:09PM (#37648999)
Could come in handy. Does Chrome Devtools have a way to do this?
Re:Show HN: Generate a concatenated file of all CSS used on ... by brianzelip on Monday September 25, 2023 @03:12PM (#37649021)
Re:Show HN: Generate a concatenated file of all CSS used on ... by geuis on Monday September 25, 2023 @03:13PM (#37649034)
Can we get the link changed to the GitHub repo? There's no such link on the given page.

There's also no additional info such as if this works on SPA type websites, or if it's just doing naive curl scraping. How does it handle link depth determination?

Lots of questions, few answers.

Re:Show HN: Generate a concatenated file of all CSS used on ... by bdcravens on Monday September 25, 2023 @03:59PM (#37649724)
Should work on "SPA" sites, though it uses PhantomJS, a "dead" project. It loads a page, listens for CSS mimetypes to build an array of URLs to pull down and concat.

https://github.com/MikaeI/mouthful/blob/master/mouthful.js

Re:Show HN: Generate a concatenated file of all CSS used on ... by mrieck on Monday September 25, 2023 @03:31PM (#37649309)
It just intercepts any files of "text/css" mime types appends them all together while also including the content of <style> tags.

If anyone wants something more specific that gets a section's CSS and all associated styles, I built an extension for that called SnipCSS.

https://chrome.google.com/webstore/detail/snipcss/hbdnoadcma...

My extension doesn't download or parse CSS stylesheets to get styles, I use the Devtools protocol https://chromedevtools.github.io/devtools-protocol/tot/CSS/

Re:Show HN: Generate a concatenated file of all CSS used on ... by bdcravens on Monday September 25, 2023 @03:55PM (#37649678)
Last commit was in 2019, and it uses PhantomJS to query a page, which shutdown development in 2018

https://github.com/ariya/phantomjs/issues/15344