I'm using a subtheme of Corolla 2.x and sometimes my main column is narrowed. It's about half the normal size.

This is because on my site adaptivetheme/adaptivetheme/css/at.layout.css is called after the generated file files/at_css/mycorollasubtheme.responsive.layout.css with my settings.

adaptivetheme/adaptivetheme/css/at.layout.css contains the following CSS statement:

.sidebar-first .content-inner {
  margin-left: 180px;
}

This adds always a big left margin if the order of the CSS files is reversed.

I'm using a workaround to avoid this problem in my subtheme. I've added the following section in mycorollasubtheme_preprocess_html().

  // Copied from adaptivetheme/adaptivetheme/inc/template.process.inc adaptivetheme_preprocess_html()
  // Load the media queries layout CSS files
  global $theme;
  $filename = $theme . '_mediaqueries_css';
  $file = variable_get($filename);
  $path = "public://at_css";
  if (!empty($file)) {
    $filepath = $path . '/' . $file;
    drupal_add_css($filepath, array(
      'preprocess' => variable_get('preprocess_css', '') == 1 ? TRUE : FALSE,
      'group' => CSS_THEME,
      'media' => 'screen',
      'every_page' => TRUE,
      'weight' => 10, // generated file should be loaded after at.layout.css which contains the backup layout (issue with .sidebar-first .content-inner)
      )
    );
  }

Noteworthy, I'm using the 'weight' => 10 to ensure that the theme specific file is loaded after the general at.layout.css.

Adding a weight could also be a fix in adaptivetheme/adaptivetheme/inc/template.process.inc adaptivetheme_preprocess_html().

The CSS files of my site:

@import url("http://mysite.stage/modules/system/system.menus.css?lx2nzd");
@import url("http://mysite.stage/modules/system/system.messages.css?lx2nzd");
@import url("http://mysite.stage/modules/system/system.theme.css?lx2nzd");</style>
<style>@import url("http://mysite.stage/misc/ui/jquery.ui.core.css?lx2nzd");
@import url("http://mysite.stage/misc/ui/jquery.ui.theme.css?lx2nzd");
@import url("http://mysite.stage/modules/overlay/overlay-parent.css?lx2nzd");
@import url("http://mysite.stage/modules/contextual/contextual.css?lx2nzd");</style>
<style>@import url("http://mysite.stage/modules/book/book.css?lx2nzd");
@import url("http://mysite.stage/modules/comment/comment.css?lx2nzd");
@import url("http://mysite.stage/modules/field/theme/field.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/mollom/mollom.css?lx2nzd");
@import url("http://mysite.stage/modules/node/node.css?lx2nzd");
@import url("http://mysite.stage/modules/poll/poll.css?lx2nzd");
@import url("http://mysite.stage/modules/search/search.css?lx2nzd");
@import url("http://mysite.stage/modules/user/user.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/views/css/views.css?lx2nzd");</style>
<style>@import url("http://mysite.stage/modules/shortcut/shortcut.css?lx2nzd");
@import url("http://mysite.stage/modules/toolbar/toolbar.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/codefilter/codefilter.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/ctools/css/ctools.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/elf/css/elf.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/typogrify/typogrify.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/tweetbutton/tweetbutton.css?lx2nzd");
@import url("http://mysite.stage/sites/all/modules/views_infinite_scroll/css/views_infinite_scroll.css?lx2nzd");</style>

<link type="text/css" rel="stylesheet" href="http://mysite.stage/sites/mysite.ch/files/at_css/mycorollasubtheme.responsive.layout.css?lx2nzd" media="screen" />
<style>@import url("http://mysite.stage/sites/all/themes/adaptivetheme/adaptivetheme/css/at.base.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/adaptivetheme/adaptivetheme/css/at.layout.css?lx2nzd");</style>
<link type="text/css" rel="stylesheet" href="http://mysite.stage/sites/all/themes/corolla/css/corolla.responsive.style.css?lx2nzd" media="screen" />
<link type="text/css" rel="stylesheet" href="http://mysite.stage/sites/all/themes/corolla/css/corolla.responsive.gpanels.css?lx2nzd" media="screen" />
<style>@import url("http://mysite.stage/sites/all/themes/adaptivetheme/adaptivetheme/css/at.messages.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/html-elements.css?lx2nzd");</style>
<link type="text/css" rel="stylesheet" href="http://mysite.stage/sites/all/themes/mycorollasubtheme/css/mycorollasubtheme.responsive.style.css?lx2nzd" media="screen" />
<style>@import url("http://mysite.stage/sites/all/themes/corolla/css/forms.css?lx2nzd");</style>
<link type="text/css" rel="stylesheet" href="http://mysite.stage/sites/all/themes/mycorollasubtheme/css/mycorollasubtheme.responsive.gpanels.css?lx2nzd" media="screen" />
<style>@import url("http://mysite.stage/sites/all/themes/corolla/css/tables.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/page.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/articles.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/comments.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/fields.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/blocks.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/navigation.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/corolla/css/corolla.settings.style.css?lx2nzd");
@import url("http://mysite.stage/sites/mysite.ch/files/color/mycorollasubtheme-23a9822e/colors.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/mycorollasubtheme/css/mycorollasubtheme.css?lx2nzd");</style>
<style media="print">@import url("http://mysite.stage/sites/all/themes/corolla/css/print.css?lx2nzd");
@import url("http://mysite.stage/sites/all/themes/mycorollasubtheme/css/mycorollasubtheme-print.css?lx2nzd");</style>

I'm using Drupal 7.10, Adaptive Theme 2.1 and Corolla 7.x-2.2.
I'm running PHP 5.3.8.
I'm using Firefox 9. I've seen this issue also with earlier versions of Firefox.

I don't know if this is really an issue of Adaptive Theme. Maybe it's a problem of Drupal core or a module. I don't know what is reversing the order of adaptivetheme/adaptivetheme/css/at.layout.css and files/at_css/mycorollasubtheme.responsive.layout.css.

I'll keep an eye on that problem. If I find more I'll let you know.

Comments

scito’s picture

Issue summary: View changes

Mentioning browser Firefox

scito’s picture

Status: Active » Closed (duplicate)

It's not an issue of Adaptive Theme. I'm facing the symptoms Drupal core and Views problem.

Views is readding the CSS files in views/plugins/views_plugin_cache.inc:

  /**
   * Restore out of band data saved to cache. Copied from Panels.
   */
  function restore_headers() {
    if (!empty($this->storage['head'])) {
      drupal_add_html_head($this->storage['head']);
    }
    if (!empty($this->storage['css'])) {
      foreach ($this->storage['css'] as $args) {
        drupal_add_css($args['data'], $args);
      }
    }
    if (!empty($this->storage['js'])) {
      foreach ($this->storage['js'] as $key => $args) {
        if ($key != 'settings') {
          drupal_add_js($args['data'], $args);
        }
        else {
          foreach ($args as $setting) {
            drupal_add_js($setting, 'setting');
          }
        }
      }
    }
  }

However, the order of insertions of CSS files is calculated in drupal_add_css() through the total size of the $css array. The size remains at the same value in the second pass by Views. Thus, the files get the same weight and the order of the additions is lost.

$options['weight'] += count($css) / 1000;

I'll create a new issue for Views.

scito’s picture

scito’s picture

Issue summary: View changes

Adding PHP version