God I love Firebug

2009 April 29
tags: ,
by Karen

So I’ve been tweaking our intranet instance of Drupal this week trying to make improvements to the interface and display. In particular I’ve been customizing several templates related to the Event Module. I don’t like how the calendars display because I think they include some redundant information and don’t use the space effectively. The problem is that when you are changing templates in Drupal particular CSS related changes, lots of potential files come into play. This is in part due to the modular construction of Drupal. So when a page loads several stylesheets come into play: the ones from all the modules you have installed, and the stylesheet from your theme. While this is great in theory because it makes the styles build on top of one another, it can make debugging a little challenging because you’ve got several stylesheet to look at. The solution? Most Drupal developers will tell you to use the Devel module. This is a fabulous module which is really helpful when you are developing in Drupal, particularly for creating themes or creating/changing templates, it is sort of slight overkill for simple CSS debugging.

A much better solution and one which is multi-purpose is to use Firebug. Firebug is a Firefox extension which helps you to test and debug CSS and javascript. Using the Inspect button, you can select a particular element on the screen and see what styles are being applyed to it and what files contains those styles. You can also dynamically turn on or off styles to see if this affects the change you want without having to edit the CSS. Its a fast and efficient way to debug stuff. It has many other features that my developers love but for me when they showed me the CSS debugging I was in heaven.

3 Responses leave one →
  1. 2009 April 30
    Jon Gorman permalink

    I actually use both web developer and firebug. Web Developer seems a little more stable and also has some nice css editing features. I use firebug more for poking around the dom and when I’m trying to get a sense of a page.

  2. 2009 May 2

    There’s also a “Drupal For Firebug” module that lets Firebug display Drupal debugging info: http://drupal.org/project/drupalforfirebug

  3. 2009 June 22

    Total agreement. Firebug has become indispensable. The already mentioned “web developer” is great too. Here’s my list of never-be-without Firefox webdev plugins:

    You need the color fast:
    Colorzilla https://addons.mozilla.org/en-US/firefox/addon/271

    You don’t want to copy someone else’s crap markup:
    Copy Plain Text https://addons.mozilla.org/en-US/firefox/addon/134

    You can’t remember the entire CSS dictionary:
    CodeBurner http://tools.sitepoint.com/codeburner/

    You need a measuring tape for the screen:
    Measure It https://addons.mozilla.org/en-US/firefox/addon/539

    You don’t want to crank up Photoshop:
    Pixlr https://addons.mozilla.org/en-US/firefox/addon/9924

    Validation, live-editing of CSS, and more:
    Web Developer Toolbar https://addons.mozilla.org/en-US/firefox/addon/60

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS