sondr3 / generator-jekyllized

A Yeoman generator for Jekyll to rapidly build sites using Gulp
MIT License
326 stars 35 forks source link

Support BrowserSync CSS injection #143

Closed paulozoom closed 8 years ago

paulozoom commented 8 years ago

I noticed this existed before, with a .pipe($.if(!argv.prod, browserSync.stream())) call in the styles task, but a fresh generation of jekyllized fully reloads the page when the CSS changes, which makes the process of designing in the browser very slow.

Is there any chance this could come back?

sondr3 commented 8 years ago

Slow? On my machine the difference is so small that before I can move my eyes to my second monitor it has fully refreshed. But maybe, I just couldn't get it to work at all last time with the structural changes to the temporary directories, feel free to take a stab at it too. I'll take a look when I get back home.

paulozoom commented 8 years ago

@sondr3 In my experience it was slower for sure, but more than that, a full refresh will close any modals, collapse any expanded menus, and clear any filled-out forms, things that direct injection of CSS would avoid.

sondr3 commented 8 years ago

That's true, hadn't considered that. I'll look into it tonight! I just remember it not working properly last time.

sondr3 commented 8 years ago

I've looked into this and the changes are either so trivial I'm completely overlooking them or I'm going to have to do some changes to how it generates the CSS and JS, I'll figure something out.

paulozoom commented 8 years ago

Thanks so much for taking a look!

On Wed, Jul 27, 2016 at 6:32 AM, Sondre Nilsen notifications@github.com wrote: I've looked into this and the changes are either so trivial I'm completely overlooking them or I'm going to have to do some changes to how it generates the CSS and JS, I'll figure something out.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/sondr3/generator-jekyllized/issues/143#issuecomment-235481427] , or mute the thread [https://github.com/notifications/unsubscribe-auth/AAEPM2csit_oc4jN2rEb6YckILTMwkKgks5qZt9GgaJpZM4JKcrd] .

sondr3 commented 8 years ago

Done! I've published a new version of the generator to NPM so you can install it again and run yo jekyllized:update to get the new configuration. You'll have to delete styles.js, scripts.js and browsersync.js because I had to merge them into assets.js 😃