gulp-watch-less - Watch LESS files and their @imports for changes

I've recently released a new plugin aptly named gulp-watch-less, which will monitor your .less files using the excellent gulp-watch task, and output changed files to the stream whenever the file itself or any of it's @imports have changed.

It's usage is pretty straight forward, using the same signature as the underlying gulp-watch plugin:

Running gulp less will compile all .less files, and watch for changes to those watched and their @imports. Simple! It will also monitor the original files for changes to @import statements (additions, deletions, path updates etc) to ensure the associated files are watched correctly!

You can get the plugin using the usual npm install gulp-watch-less or visit the GitHub project for more documentation or to report an issue.

Big thanks to Vsevolod Strukchinsky for the modifying his existing (and awesome!) gulp-watch plugin to make this possible.

Happy building!

LESS - Generate a deep list of all a file's @imports

Code sample Sometimes it's useful to get a list of all @imports for a given .less file, especially if you want to watch those files for changes in your gulp or grunt build steps. We can easily achieve this using the LESS parser itself! Disclaimer... this relies on internal implementation

Read more

Knockout + Bootstrap 3 - Buttons and the `enable` binding

By default, Knockout's enable (and hence disable binding, since they share identical but opposite logic) simply set/remove the disabled attribute. While this work's great with Bootstrap 3's <button />-type elements, it doesn't go so well when using the alternative <a role='button' /> syntax. The problem

Read more

Durandal - Type cast queryString parameters

By default, Durandal's router.parseQueryString method will simply provide all query parameters as strings, which isn't ideal if you're working with data heavily. We can work around this by overwriting and enhancing the parseQueryString method, type casting variables into their correct types. This is useful for primitive data types, but

Read more

Knockout `value` binding and &lt;input type="number" /&gt;

The problem Knockout's default value binding is great in most cases, but when using the new HTML5 <input type="number" /> element, it will always return an empty string when the input is a non-number i.e. contains anything but 0-9 and a decimal! This is actually a byproduct

Read more

ui.draggable.exclusive - Exclusive draggables

Shout out to to my friend and colleague Steve Henderson who came up with the original concept behind this idea! UI.Draggable(s)... they're not exclusive! jQuery UI's draggable and droppable component's are great, and are used widely throughout the web to provide consistent, well tested drag/drop functionality across

Read more

CKEDITOR `key` event - modifier keys

When subscribing to the key event on a given CKEDITOR instance, the property will be the sum of both the associated keyCode and any pressed modifier keyCodes e.g. ctrl/shift/alt keys as noted on the official documentation keyCode : Number A number representing the key code

Read more