This is related to #320390: Remove hard coded blueprint width in template functions, replace with system for dynamic custom column widths, but I'm more interested in what to do with the blueprint/framework folder.

That is, let's say I want to sub-theme Blueprint, but use my own custom grid. If I use lib/compress.rb in the blueprint framework folder, it replaces blueprint/*.css, which would affect all sub-themes. If I only wanted it to affect one sub-theme, what's the proper way to do it? Here are the two options I came up with:

1. Copy the whole blueprint theme folder, and change the .info/theme files to make my own custom theme. This works, but it ignores Drupal's sub-theme functionality; essentially I'm forking the Blueprint theme every time I want to change the grid.
2. Have lib/compress.rb output the CSS into my sub-theme folder, and specify these new CSS files in my sub-theme's .info file. This also works, but the parent theme's CSS files are still included even though they are completely obviated by the sub-theme's CSS files.

The ideal scenarios seem to be modifications of these two options:

1. Place my own version of the Blueprint CSS framework folder in the sub-theme, and have it use that version instead of the parent theme's version.
2. Unset the CSS files the parent theme loads when I use my own custom version of those CSS files.

Is there a way to do either one of these? Or is there a better way to have a sub-theme with a custom grid?

Comments

mark trapp’s picture

Category: support » feature

After some guess-and-checking, I got what I'm looking for. Drop a copy of the Blueprint CSS framework folder in the subtheme, run lib/compress.rb from there, then add the following lines to the sub-theme's .info file:

stylesheets[screen,projection][] = framework/blueprint/screen.css
stylesheets[print][] = framework/blueprint/print.css

You also have to add page.tpl.php to the sub theme and change line 14's $path_parent to the sub_theme's path. I did this by changing $path_parent to $path and added the following to BPSTARTER_preprocess_page():

$vars['path'] = base_path() . drupal_get_path('theme', 'BPSTARTER') . '/';

Would it be possible to change $path_parent to $path in page.tpl.php in the committed version of Blueprint? Assuming there aren't any complications, it would mitigate the need to override all of page.tpl.php just to use a custom grid.

designerbrent’s picture

I think that's about the best way to approach that. Redeclaring the css in the .info file will effectively unset the old styles and replace them with the new ones from the sub-theme. As for the $path_parent and $path, I'm afraid for now you will either have to change them out in the page.tpl.php or redeclare them in BPSTARTER_preprocess_page().

designerbrent’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.