Flag Sprite Maker
Make flag sprites effortlessly from a total of 260 flags.
- Requires
imagemagick
:- OSX (using homebrew):
brew install imagemagick
- Ubuntu:
sudo apt-get install imagemagick --fix-missing
- OSX (using homebrew):
Generate
- Move all the flags you want to contact to a sprite from
flags/
- Note: If you want other names than the full country name simply rename the files
-
Run
# All arguments are optional ./make_sprite.sh <path_to_flags> <desired_class_name>
-
The files will be available in
output/
HTML Usage
Include the generated css file and then in your HTML-template you can write.
<a href="#" class="flag-sprite Sweden"></a>
<a href="#" class="flag-sprite Germany"></a>
Notes
Though it might be tempting to generate a sprite with all the flags included, don't unless you need them all. The flag-sprite for all countries will be ~250Kb.
Thanks to jaymzcd for the gist, which I've modified slightly.