Skip to content

How to make theming in Drupal easier

2 min read

Drupal is an amazing web framework. You can build almost any type of website with it super easily. Just check out Zack’s screencast for an example of this.

But it’s not just point and click, with a plethora of hooks, one can easily create a complex module for Drupal in a matter of minutes (hours, if you count the time needed for debugging ;-)). And with the new JS library in 4.7, creating Javascript rich modules is quite easy too. Talk about easy programming!

Can we ask for anything else?

Oh wait, we forgot the other half, the design. Ooops. Yeah, that’s a bit harder with Drupal. But I think we can make it better.

There are lots of ways to make it better but I want to focus on just one: CSS.

The CSS in Drupal is more of a hinderence than help most of the time unfortanutly. This is in stark contrast to the rest of Drupal, as everything else is super useful. It tries to set up a standard set of CSS classes but fails in many areas. And it has no help for doing CSS layouts, the focal point of almost all new designs today.

But there is hope. Yahoo has just released their grids CSS. It’s basically a library that makes it super easy to create consistent layouts across browsers. In addition to this layout CSS is a fonts CSS that makes it very easy to specificy consistent fonts and sizes across browsers, along with a reset CSS file that basically normalizes HTML elements and properties across browsers (think same margin and padding for UL elements). How dandy!

So there you have it, 3 CSS files that make it super easy to create a consistent theme across browsers, without having to resort to this same tedious task over and over for each theme.

This is perfect for Drupal.

What I’m proposing is that we integrate these 3, super small, CSS files into Drupal. We’ll refactor drupal.css and create a new file, default.css, which houses these default, cross browser styles.

From there, themers would be able to make use of these CSS classes to build website themes much faster, better aligning the time to make a theme with the time to make a module.

But this is only the first step in making theming for Drupal easier… we still need to work on semantic HTML, per module CSS files and so forth, but this is certainly a great start.

codeDrupal

Related Posts

Members Public

The Future of Automotive Mobility will be Powered by Open Source Software

Automotive companies are shifting from bending metal to bending bits. Soon they will be offering software and services to complement their manufactured metal. In order to win in the market, they will need to embrace open-source software to build leverage and enhance their offering.

Members Public

How to Host Your Static Website on Amazon S3: Step-by-Step Guide

1. Login to your Amazon AWS account 2. Create a new hosted zone for your domain using Route 53 3. Copy the NS records for this zone to your domain provider (e.g., GoDaddy) 4. Edit your domain on your domain registrar (e.g., GoDaddy) by clicking Set Nameservers 5.

Members Public

Book Review: Drupal 7 Module Development

Well, it’s been a while my Drupal friends, almost 18 months… dusting off this old Drupal 6 blog and time to start posting again. And what better way to get started again than by talking about Drupal 7, by far the best release of Drupal. And with almost 7