css module incompatible with print module
schildi - December 27, 2008 - 18:43
| Project: | CSS |
| Version: | 5.x-1.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
The created styles always have type "theme". When used for devices other than screen (eg. for printing), styles defined for theming (type "theme") are disabled (see module "print").
In my case modifying line (function theme_css_import in css.module)
drupal_add_css('?q=css/get/' . $nid, 'type', 'all', FALSE);to
drupal_add_css('?q=css/get/' . $nid, 'module', 'all', FALSE);helped.

#1
Well.. let's clarify a bit.
Rules defined trough CSS modules are linked using media="all" .. this means that they will be parsed for each media type (printing as well).
The problem you are referring is another.
If print module is installed users are able to see two versions of the node: the normal one and the printer friendly one.
The print module generates the printer friendly version applying his own theming rules (without calling the theme added CSS).
So rules defined in CSS module are not being linked while opening the printer friendly page generated by print module.
Unfortunately the fix you suggest is IMHO not optimal because by changing to 'module', css module rules will be linked before theme css rules: consequence of this is the fact that users of the css module will not able to override a css rule defined in a theme css.
For example: if I want to use CSS module to change the color of the links defined in the theme, I will not be able to do that if we use 'module' linking in drupal_add_css.
Does anyone have suggestion on how to fix this one?
#2
Hi,
I had sidelined this for a while. Give me the weekend and I'll come up with something
~ Whispero