As I faced similar issue than https://drupal.org/node/1945270, I think the first step is to add background picture support.
Adding sprite can then be for instance automatic (https://drupal.org/project/spritesheets) or manual.
But adding the background feature with automatic CSS is possible.
I attach a patch that does so. Basic version.
What it does
- adds a "background image of span" option in admin
- handles this option by adding a span in tags, with relevant classes
- automatically rebuild languageicons CSS file when form s saved so that enabled language icons (and only them) are automatically handled.
it is then possible to add generic rule such as
span.language-icon:hover {box-shadow:2px 2px 5px 2px #666;}
not that for my usage, I also added in theme style.css file the following rules, to support box-shadow on hovering
span.language-icon {
height: 18px;
background-position: center center !important;
margin: 3px 0;
}
what it does not
you have to manually clear the cache if CSS file is updated
Note: this is really basic patch but it does what it promises :D
| Comment | File | Size | Author |
|---|---|---|---|
| 0001-Language-icon-update-240.patch | 5.26 KB | JulienThomas |
Comments
Comment #1
JulienThomas commentedOkay so I will review this at this patch makes D7 crashes under IE8.
Likely to be the background pictures on spans ...
Comment #2
JulienThomas commentedOkay so following update fix it
For the CSS
Comment #3
JulienThomas commentedOkay so I tried the update with CSS Embedded Images (https://drupal.org/project/css_emimage) and this works ... perfectly.
The Sprite generation issue mentioned in https://drupal.org/node/1945270 is simply ... bypassed!
Comment #4
OnkelTem commentedI just want to announce a module which can be used for totally automatic sprites generation.
I've just uploaded. Its called Sprites.
It generates sprites from images of a specific image style, replaces affected IMG tags with SPAN with identification CSS classes and generates required CSS definitions for applying background to SPANS.
Sandbox link: https://drupal.org/sandbox/onkeltem/2191795
Please check out and review. Thanks.