Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp uncss and Gulp postcss #858

Closed
axlright opened this issue Nov 21, 2018 · 10 comments
Closed

Gulp uncss and Gulp postcss #858

axlright opened this issue Nov 21, 2018 · 10 comments

Comments

@axlright
Copy link
Collaborator

Hello team from a wayward-and-wanting-to-return former contributor. It's been a while since I've been helping with this repo and I'd very much like to get back to helping. I'm not sure if you all are using the Slack channel that was once set up. Let me know the best way to find out where the team is discussing goals that I may be able to help with.

Per this specific "issue" - I've been using UnCss via gulp-uncss to remove all unused css from stylesheets on projects I'm building with UnderStrap.

The results have been fantastic - I'm getting final compiled stylesheets down to 70kb - 80kb including all plugins, all custom styles and all of Bootstrap. Combining this with CriticalCSS has meant I get great Lighthouse audit scores and fast loading websites.

I'm happy to document my uncss process if it's helpful for anyone.

gulp-uncss works fine with my workflow but it's been deprecated as it's now a plugin / part of PostCSS

Here's the actual question of this issue - I'm not super smart with this kind of thing so I'm reaching out to find out whether / in what ways UnderStrap uses or may plan to use PostCSS to minify, autoprefix or do any other post compiling work. If UnderStrap does use or plans to use PostCSS, I can potentially wrap my uncss workflow into the PostCSS process. If not, I can keep using it as a stand-alone but deprecated process.

Any advice is appreciated and please point me in a direction where I can get back to helping the team.

Thanks!!

-Alex

@0dp
Copy link
Collaborator

0dp commented Nov 21, 2018

Hi Alex,
Welcome back!
I am personally all up for improving on the gulp workflow, but think that first and foremost we should get gulp updated to v4. But as you might know, that project (Gulp4 upgrade)seems stalled (we are all busy people)

In the gulp4 branch you can see I've upgraded to PostCSS so making a set of tasks like you describe should be a walk in the park. We just need to move forward with upgrading to Gulp4 IMHO

@axlright
Copy link
Collaborator Author

Thanks Johan. Is there anything I can do to help?

-Alex

@0dp
Copy link
Collaborator

0dp commented Nov 21, 2018

The gulp4 branch needs to be updated so it is on par with understrap master branch.
Then the gulp4 tasks needs to be battle tested. I've worked on a few sites using that setup and it worked just fine for me. But others reported issues with browsersync refresh issues etc.

As soon an we can get everything stable then we can push to get it merged or at least get more testers on it.

Then I think we should look into your code optimization setup and get it running as a defacto part of understrap

@axlright
Copy link
Collaborator Author

Thanks @0dp I'll pull the gulp4 branch and work on testing it. I have a ton of UnderStrap projects I can use to test it thanks to all the team's awesome work.

Have a nice holiday for all those in the States and have a nice holiday from all those in the States for everyone else 😄

-Alex

@0dp
Copy link
Collaborator

0dp commented Nov 23, 2018

My wife is American so thanks, I still can't move from last nights feast

@0dp
Copy link
Collaborator

0dp commented Dec 28, 2018

Hey @axlright take a look at this PR #883

@0dp
Copy link
Collaborator

0dp commented Dec 30, 2018

If you take a look it uses postcss and we can expand on the features you'd like to see

@axlright
Copy link
Collaborator Author

@0dp Thank you I will take a look ASAP and I really appreciate all the hard work you've put into the Gulp4 integration. I'm working on learning Gutenberg blocks (ugh) and getting styling applied to the backend for Gutenberg blocks (ugh) and also the new Gulp4 workflow. Can't sit still for a minute 😸

@Thomas-A-Reinert
Copy link
Contributor

This should be included within the "master" fork by now, right? So i´ll close this right now. In case I`m wrong - PLEASE REOPEN!

@axlright
Copy link
Collaborator Author

Thanks @Thomas-A-Reinert I haven't taken the time to incorporate the non-deprecated postcss version of uncss mostly because the deprecated version works okay and because the child theme isn't on gulp4 yet (that I know of). I'll test and upgrade as the time comes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants