This patch makes image.module use the stylesheet_import theme function to include its CSS file (e.g image.css)
This enables theme makers to override any CSS files included and include their own instead as demonstrated here, for example.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | image-module-stylesheet-inclusion.diff | 765 bytes | Stefan Nagtegaal |
| image_stylesheet_import.patch | 575 bytes | AmrMostafa |
Comments
Comment #1
AmrMostafa commentedsorry, correcting the status.
Comment #2
AmrMostafa commentedsorry, correcting the status.
Comment #3
AmrMostafa commentedComment #4
seanrLooks good to me. I think this is ready to be committed (but I'll let the module author make that status change, of course). I've produced a patch which does the same for 4.7 (posted in a separate issue).
Comment #5
Stefan Nagtegaal commenteddrupal_set_html_head() shouldn't being used for inclusion of stylesheet. For that purpose drupal_add_style() was introduced.
See attached patch, and yup.. It's ready to rock and roll!
Comment #6
TDobes commentedno no no no no
First of all, this is a duplicate of bug 53072. (I suppose since this one is older, technically 53072 is the duplicate.)
Secondly, theme_add_style should NEVER NEVER NEVER be used for including a module-specific stylesheet. Doing so prevents properly-written themes from overriding the module CSS if they so choose. Please see my (exceptionally wordy) explanation from a core issue.
Perhaps there should be a handbook page about this or something? or maybe I should do a documentation patch?
Comment #7
TDobes commentedTo clarify:
* Yes, we should use theme('stylesheet_import') -- and a patch has landed which does this.
* No, we should not use theme_add_style... and no module ever should unless it's trying to OVERRIDE the theme for some reason (i.e. CSS that was manually entered or created by the end user)
Comment #8
AmrMostafa commentedI Agree. Thanks for the clarification and my apologies for the mistake.