Skip to content

Instantly share code, notes, and snippets.

@zachharkey
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachharkey/9b39d7a31864213ee0fa to your computer and use it in GitHub Desktop.
Save zachharkey/9b39d7a31864213ee0fa to your computer and use it in GitHub Desktop.

Trying to out-specify problematic upstream Drupal 6 styles at the theme level is a nightmare. Instead we will just replace them with SASS _partials.

For example, to override "/modules/system/system.css"

  1. Add a stub to theme.info to prevent loading. Note: The path doesn't matter, as long as the file name matches the default stylesheet won't load. Don't forget to clear your cache.

    stylesheets[all][] = kill/system.css

  2. Copy the original CSS file to theme and rename it as a SASS partial. To keep things simple, I keep all of these files in a single "drupal" subfolder and renamed to reflect the original path. In this case the file would be:

    /scss/drupal/_modules-system-system.scss

  3. Import this partial into the main SASS file.

    @import "drupal/_modules-system-system.scss";

Now you can safely hack these files into submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment