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.
- Add a custom theme setting like background_color to your theme.
- In your stylesheet, change this:
to something like this:
- 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.
- Install this module and enjoy!.
- New: Use any Drupal variable by writing /*variable:name*/ instead.
- New in dev:
Use it for a module by declaring 'soft_dependencies = style_settings' in the .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 reside within url(...), you need to add the comments around it. The module will automatically 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 immediately).
- Relative paths inside url(...) are automatically prefixed by the base path of the original style sheet.