This module lets you use any (custom) theme setting or Drupal variable in any of your theme style sheets (CSS). It replaces all your theme style sheets by a rewritten version. Using special tags in the original style sheet you can replace a default value by any (custom) theme setting or Drupal variable. Because these tags are in fact comments the theme will still work without this module, showing the default values.

Example usage

  1. Add a custom theme setting like background_color to your theme.
  2. In your stylesheet, change this:
      background: red;

    to something like this:

      background: /*setting:background_color*/red/*setting*/;
  3. Go down your theme's settings page (admin/build/themes/settings/theme) and set the background color setting you just created, for example to green.
  4. Install this module and enjoy!.


  • New: Use any Drupal variable by writing /*variable:name*/ instead.
  • New in dev:
    Use it for modules by defining 'soft_dependencies[] = style_settings' in their .info file.
  • Themes using this module will still work without since the default value is within the comments.
  • If a theme setting is not found or set, the module will show the default (specified within the comments).
  • Automatic recognition of background images.
    Because comments cannot recide within url(...), you need to add the comments around it. The module will automaticly add url(...), and base path if needed.
  • Caching of rewritten style sheets by using a checksum derived from the theme settings array (so changes are visible imediately).
  • Relative paths inside url(...) are automaticly prefixed by the base path of the original style sheet.

Project Information