In my sub theme I have the block editing setting enabled and I've added a call to block-editing.css from my subtheme.info file, however both themes (parent and sub theme) are adding block-editing.css.

Eg:

<head>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/block-editing.css" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/block-editing.css" />
</head>

I've cleared the cache which didn't have any effect. Other stylesheets are overridden as expected.

I have a feeling it's related to this function on line 109 of template.php:

<?php
  // Optionally add the block editing styles.
  if (theme_get_setting('zen_block_editing')) {
    drupal_add_css(path_to_zentheme() . '/block-editing.css', 'theme', 'all');
  }
?>

I'm not sure of the solution.

Comments

dasithds’s picture

Im not sure but try disabling the zen theme and just use the subtheme....

lets see what happens...

Dasith.

Rowanw’s picture

The sub theme is the only one enabled at this point.

dasithds’s picture

Did you develop the subtheme upon the zen theme and just change the name?

Rowanw’s picture

I followed the instructions in the readme and moved the SUBTHEME folder out of zen, then changed all the occurrences of 'SUBTHEME' to the name of my theme. Is that what you're referring to?

johnalbin’s picture

Status: Active » Postponed (maintainer needs more info)

The styles in block-editing.css are pretty basic (by design). If you need to override them, your best bet is to provide more specific rules in your mytheme.css file.

Then it doesn't matter that block-editing.css is loaded after mytheme.css. The order of loading only matters if the styles have the same specificity. http://www.w3.org/TR/CSS21/cascade.html

Is this enough info to help you out?

Rowanw’s picture

Status: Postponed (maintainer needs more info) » Active

That's not going to take away the extra stylesheet. ;)

Rowanw’s picture

A less-dirty workaround is to copy zen_preprocess_block() to the subtheme's template.php and then disable the block-editing setting in the theme settings.

johnalbin’s picture

BTW, this issue is complicated by a bug in Drupal core: http://drupal.org/node/197124

A less-dirty workaround is to copy zen_preprocess_block() to the subtheme's template.php and then disable the block-editing setting in the theme settings.

Have you tried this? I don't think it will work because if you copy zen_preprocess_block into your subtheme's subtheme_preprocess_block, the version in the main Zen theme will still get called.

Instead of conditionally including this CSS, perhaps Zen should always include the file (from inside the .info file.) If Zen did it that way you could override the block-editing.css the normal way from your subtheme's .info file.

Rowanw’s picture

When I copied zen_preprocess_block() I obviously had to change the name of the function and remove the condition that checks if the setting is enabled. It seems to work fine for now, I even modified it to work with the edit link for Views 2.

The current behaviour for loading block-editing.css is good so I'd like to see it stay if possible, but if there's no solution in sight then it's probably better to load the stylesheet from zen.info, as you suggested.

johnalbin’s picture

Assigned: Unassigned » johnalbin

#197124: Unable to ignore module’s and base theme’s stylesheets has been fixed!

So I'll work on getting a fix for this into Zen this week.

johnalbin’s picture

Status: Active » Fixed

block-editing.css has been updated. And its now listed in the .info files for easy overriding.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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