There are many things that I love about Drupal, but they way it incorporates jQuery is not one of them. Drupal 7 core comes with, and is tied to, a particular version of jQuery – 1.4.4. That came out in November of 2010. Since then, from a jQuery perspective, Drupal has been frozen in time.
“But wait,” you say, “what about the jQuery Update module?” That is true, that module will do the job, but in a lot of situations, at too much of a cost. jQuery Update replaces jQuery across the whole site – which, unfortunately, breaks a lot of site admin tasks. Check the issue queue for proof.
There is a lot of excitement in the Drupal world right now around Drupal 8 – and for good reason. There are some huge advances being made on the project – Views in Core! A new template engine! Symfony! Mobile administration! Config management! The list goes on.
However, today, I wanted to praise something that may not really get mentioned a lot, but I think will be appreciated by almost everyone who builds Drupal sites (ESPECIALLY those new to Drupal): the file structure!
As has been pointed out in other places, Drupal and Codekit don’t play well out of the box. Codekit, specifically, can’t inject SASS changes into a Drupal site without refreshing the page. “Live Editing” is one of it’s primary features.
Codekit is one of the main reasons I decided to really get into SASS at all. I’m coming from years of using CSSEdit, and am very, very used to a workflow involving live editing. Edit/save/refresh was always just way too slow.
So, being that I mainly work in Drupal these days, not having live SASS injection was a real bummer. I had to eventually try out LiveReload, which did work, but it wasn’t as elegant as Codekit.
As was pointed out by Nick Comito, what you needed to do was to link directly to your compiled style sheet after the normal Drupal styles, then voila – Codekit works perfectly.
I took what he suggested, and whipped up a Gist using the path_to_theme variable.
Looks like, though, someone else was having this same issue. Graham Bates helpfully contacted me through the Gist and pointed out that he had created a simple module – Link CSS, that does this for you.
I’ve tested it out, and sure enough, Codekit works like a dream with Drupal – check it out!