I think the following code should realize, the responsive.custom.css file is never aggregated.

File at_core.submit.responsive.inc

// If the Cascading media queries CSS file is enabled, load these styles first
if ($values['enable_custom_media_queries'] === 1) {
  $responsive_css = drupal_load_stylesheet($path_to_responsive_css . 'responsive.custom.css', FALSE);
  $responsive_styles[] = $responsive_css . "\n";
}

The FALSE parameter is responsible for the exclusion of aggregation.
 
But, if CSS aggregation enabled, the responsive.custom.css is aggregated.
The result: CSS formatting in this file are ignored.
 
My quick solution is to deactivate the option Enable the responsive.custom.css file in the theme configuration and include the CSS file manually in the template.php of the subtheme.
With this usage scenario the responsive.custom.css formatting makes sense if CSS aggregation enabled.

Comments

Jeff Burnz’s picture

Priority: Major » Normal

The result: CSS formatting in this file are ignored

I'm not really sure what you mean by this.

Do you mean the CSS does not apply, i.e. is this a specificity thing - if so, yes this could be the case, I wouldn't mind seeing some specifics here if possible.

The code you posted above is getting the stylesheet from your theme and loading it into a variable - itself a big array that includes all the other breakpoint specific responsive stylesheets in the theme, which is then output as a file, usually in default/files/adaptivetheme/yoursubtheme/yoursubtheme.responsive.styles.css.

In effect AT has its own aggregation system for pulling together all the responsive style sheets into a just a few files. It does this every time you save the theme settings (builds a new set of files), loading of files is seperated in load.inc and there is a whole bunch of functions and logic around loading assets depending on your settings and whether CSS aggregation is on or off. Note that in the near future AT will rewrite/rebuild all these files when you clear the cache, as well as when you save the theme settings - we need a module to to that, please see this issue: #1995938: Adaptivetheme should recompile aggregated mobile CSS during cache-clear without theme-settings resave

When CSS aggregation is OFF AT loads all the responsive stylesheet files individually in media queries, when CSS aggregation is ON its the other way around - AT loads a single responsive styles CSS file (as opposed to layout which loads separately) with media queries written inline into the actual CSS files - this offers best performance when CSS aggregation is on, and ease of development when aggregation is off (people unfamiliar with media queries can drop CSS in the breakpoint stylesheets and it will work good enough for many sites).

yoursubtheme.responsive.styles.css is the file that gets compressed/aggregated by Drupal core, and which Adaptivetheme loads for the sub theme in at_load_subtheme_responsive_styles() - its at this point specificity can be an issue, because during the submit/file writing phase the custom stylesheet is written out first, maybe it should be last.

I'm gonna leave this as a bug for now, I personally have not run into the issue, however I tend to use one system or the other - either all in the breakpoint specific stylesheets or all in the responsive.custom.css, rarely have I used both in a theme.

Jeff Burnz’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)