I run into some issues when using "@media print" declarations. Print styles are most likely to always have any background images disabled, also including !important property. This module takes these properties and includes it output. If !important is used to remove background images I don't have to explain the end result. It probably affects inline media queries as well.
Another issue is when using css3 gradients for backgrounds. These are skipped by the module and overwritten on output by print styles, even without !important propery. I can imagine that this is an issue with border-image property as well.
I can think of 2 solutions in this situation. First, skip any background properties inside any "@media" declarations, or second solution, skip any background declarations without url attribute.
Comment | File | Size | Author |
---|---|---|---|
#16 | css_emimage-1293616-16-fix-media-D6.patch | 4.17 KB | mikeytown2 |
#4 | media_embedded.patch | 4.22 KB | killes@www.drop.org |
Comments
Comment #1
Gerhard Killesreiter CreditAttribution: Gerhard Killesreiter commented#1395762: CSS Embedded Images - jQuery mobile and @media queries issue was marked as a duplicate of this issue.
It seems as if emiage would ignore @media declaration. In the .emimage.css files there are none even if the normal css files did have some.
Comment #2
Gerhard Killesreiter CreditAttribution: Gerhard Killesreiter commentedincreasing priority.
I guess it comes down to extending the undocumented regexp in _css_emimage_text_processor
Comment #3
bcobin CreditAttribution: bcobin commentedConfirmed here - images break with @media queries.
Comment #4
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedHere's a patch that could use some testing.
Comment #5
C. Lee CreditAttribution: C. Lee commentedWhich version should I apply the patch for? I checked out the repository and I can't find _css_emimage_text_processor() in HEAD revision. I used this command to check out: git clone --branch 7.x-1.x http://git.drupal.org/project/css_emimage.git
Comment #6
romansta CreditAttribution: romansta commentedIt works!I applied the patch to version 7.x-1.2. I use the AdaptiveTheme, that uses @media queries.Comment #7
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedDoes this patch really work for anybody? After some more serious testing, I think it doesn't.
I also have to admit that there is probably no easy patch for this.
A better and more foolproof approach would be to put the parts with @media declarations into separate files and don't pipe them through this module.
Comment #8
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedAlso the patch is for the D6 version.
Comment #9
cainrus CreditAttribution: cainrus commentedPatch is not working with adaptive media css rules.
Comment #10
cainrus CreditAttribution: cainrus commentedPatch is not solving issue for latest released drupal version.
Comment #11
mikeytown2 CreditAttribution: mikeytown2 commentedCan I get a test case for this? Input CSS, expected result, actual result?
The issue from what I'm gathering is the @media declaration is not being appended to the rule containing the base64 datastream, correct?
I'll be investigating this using jQuery mobile as a test case.
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedLooking at what's going on and _css_emimage_build_external() needs to be aware of the media query. Patch in #4 doesn't do this.
Comment #13
mikeytown2 CreditAttribution: mikeytown2 commentedHave this fixed inside of _css_emimage_build_external with the help of http://stackoverflow.com/questions/14145620/regular-expression-for-media...
Cleaning it up and will commit it to the fork #1968998: Get a 7.x version out that works with Advagg 7.x-2x
Comment #14
mikeytown2 CreditAttribution: mikeytown2 commentedPushed the fix.
Comment #15
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedIs there a chance for a D6 backport?
Comment #16
mikeytown2 CreditAttribution: mikeytown2 commentedUntested but should work
Comment #17
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedMuch appreciated! I'll do some testing