Audrey Hepburn drinking a cup of tea and looking at her extended pinky.

This project provides classes based on information Drupal knows about.

We will try to follow Drupal's CSS guidelines.

Currently it offers:

  • region machine names as classes on blocks
  • block type as classes on custom blocks
  • page--content-item class pages with a standalone full content item (node).
  • page--content-item--[content-type] (node bundle) class to standalone full content item (node) pages.

And plans:

  • view display machine names on views

Please make your own suggestions or requests!

Exactly what classes it provides is liable to change until a release candidate or at least a stable release is reached. Until then (and after!) feel free to mine it for examples of preprocessors you can put in your own theme.

Note that the Classy core theme does not provide any preprocessors, and adds all of its themes through templates. By contrast, this extension adds classes which will be added to the attributes core-respecting template output anyway. This reduces the need for templates that differ only in the classes they add (though we absolutely suggest templates as the answer to most of the world's problems).

Class it up is meant to be required by themes, whether custom or contrib, which will be enforceable when this core issue finally lands: #474684: Allow themes to declare dependencies on modules

See also

Supporting organizations: 
Gave a reason for being, as the importance of sensible preprocessors increases for a hosted service without PHP access allowed.
Sponsored time, provided code.

Project information

Releases