purgecss icon indicating copy to clipboard operation
purgecss copied to clipboard

Allow CLI to read the CSS from stdin

Open mhhollomon opened this issue 4 years ago • 4 comments

I would like for there to be a way that the purgecss CLI could read the CSS from stdin.

I would like to be able to do something like:

tailwind build site/mystyles.css | purgecss --css - -c purgeccs.config.js -o build/mystyles.css

Maybe there is a way to do this, but I couldn't see it after looking at the code.

My other two options are

  1. use a temp file in the middle
  2. write my own wrapper for purgecss.

mhhollomon avatar Jan 03 '20 00:01 mhhollomon

If it helps anyone else, I created purgecss_stdin as a (very) simple wrapper around the API to read CSS from stdin. It can write to either stdout or to a file.

mhhollomon avatar Jan 03 '20 16:01 mhhollomon

Thanks, could be useful. I'll look into the PR this week and if we could include the purgecss_stdin option to the CLI.

Ffloriel avatar Jan 07 '20 23:01 Ffloriel

I'll be happy to create a PR for this issue as well, but wanted to build it on top of the other one.

mhhollomon avatar Jan 08 '20 18:01 mhhollomon

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 23 '22 00:05 github-actions[bot]