roborourke / wp-less

Provides a LESS compiler compatible with wp_enqueue_style() for rapid CSS development in themes and plugins.
MIT License
217 stars 55 forks source link

Add ability to refresh-compile via AJAX #49

Closed lkraav closed 9 years ago

lkraav commented 11 years ago

Problem to be solved is not having to reload the whole page to see changes in the LESS file.

I am imagining a wp-less built-in, but probably optionally loadable (filter?), JS component, that binds a keyboard key (F9 + filter?) to trigger an AJAX request for wp-less to recompile specified stylesheets. Then it would make the browser reload all or just the specified stylesheets in the fashion of http://livejs.com

Stylesheets array should probably be injected to the page as JS variable during initial page load. It's probably the best way to know exactly what stylesheets the user is working with.

This focuses on having a server-only work environment. Obviously for locally controlled environments it's possible to combine a reasonable light-reload solution from various existing pieces.

Thoughts? Anyone else interested?

lkraav commented 9 years ago

Everyone is solving it with tooling, like grunt, Robo, etc so it probably makes sense to do the same. Rolling with browsersync.io for this is looking pleasant.