Git Product home page Git Product logo

css-spriter's Introduction

CSS Spriter, a sprite generator

[ PNG, PNG, PNG ]  (°_°)
[ PNG, PNG, PNG ]  (° )
[ PNG, PNG, PNG ] )°)
[ PNG, PNG, )°)
[ PNG, )°)
[ )°)

 \(°_°)/ -> SPRITES!!!

Description

It takes your PNG’s, chews them up and spits out sprites!

point bin/css-spriter at a directory, and watch it sprite away!

CSS-Spriter uses Chunky PNG for it’s PNG manipulation. Not only is it super fast, but the library is a great example of fast, efficient ruby programming.

Chunky PNG is written in pure ruby, this means you can sprite up anything using MRI, JRuby, or Rubinius.

Installation - standalone

sudo gem install css-spriter

Usage - standalone

css-spriter <directory>

If you point the sprite command at a directory tree by default it will construct sprites for each of the sub directories and generate a single css to access all of the sprites which is placed in the root of the directory tree

For a full list of options:

css-spriter -h

Installation - Rails plugin

script/plugin install git://github.com/aberant/css-spriter.git

Usage - Rails plugin

CSS-Spriter assumes all of your sprites are located in the directory public/images/sprites. This directory should contain sub-directories for each sprite you wish to create. The css class names for an image in a sprite will take the form <directory_name>_<image_name>. Here is an example:

sprites /
  cars /
    ford.png
    chevy.png
  planes /
    boeing.png
    cesna.png

Running the sprite:generate task does all the work. Each sprite directory (cars, planes) will now contain a sprite.png. Spittle will also generate a sprites.css stylesheet in public/stylesheets/ that you should include in your layout. If you wished to use the ford image from the cars sprite you would give the ‘cars_ford’ class to the desired element in the view. That’s it!

Check out examples/sprites if you want to see what CSS-Spriter can do without doing any work.

Features

  • automatically generates sprites from a set of PNG images

  • automatically generates css classes to access images within the sprite

  • customizable css templates

  • Rails plugin & rake tasks (sprite:generate & sprite:cleanup)

  • Supports varying dimensions in source images

  • Does not regenerate sprites that have not changed

  • supports mixing RGB and RGBA color types

Roadmap - by priority

  • allow a global css template override

  • allow per-sprite and global configuration

Authors

  • aberant - Colin Harris

  • tjennings - Tyler Jennings

Credits

  • thanks to mattpuchlerz for the socially acceptable project name

css-spriter's People

Contributors

aberant avatar tjennings avatar redsquirrel avatar

Stargazers

Israel Batista avatar Oli Peate avatar Cristian Ferrari avatar purwandi avatar Jürgen Brüder avatar Tom Elam avatar Mattias Pfeiffer avatar Oğuz Çelikdemir avatar  avatar Meedani avatar  avatar Daniel Ribeiro avatar Benjamin Fleischer avatar Matt avatar Mike Wabst avatar Michael Nygard avatar Eric Hartmann avatar Olivier Kouamé avatar Ethan Gunderson avatar David Everitt avatar Tomislav Car avatar Marcin Domański avatar Tobias Steiner avatar G Maldonado avatar John McCaffrey avatar Peter P. Gengler avatar Salim Batlouni avatar Jason Arora avatar Joe Lind avatar Scott Lepich avatar keiki avatar  avatar Mario Gutierrez avatar Andy Slocum avatar Allan Branch avatar  avatar  avatar Stephen St. Martin avatar Adam Walters avatar mifan avatar Scott Barr avatar Clément Joubert avatar rcbaxter avatar Lance Ennen avatar Chris Ricca avatar Willem de Ru avatar Carmelyne Thompson avatar Marcio Castilho avatar Vidal Graupera avatar Ariel Pillet avatar Mike Zaschka avatar Justin MacCarthy avatar Jim Neath avatar Kevin Triplett avatar Vesa Vänskä avatar Allen Bargi avatar Nikolay Kolev avatar  avatar Gavin Stark avatar  avatar Anders Törnqvist avatar Shawn Roske avatar Timothy Johnson avatar Tom McKelvey avatar Matt Jones avatar Dave Giunta avatar Matt Todd avatar Bryan Helmkamp avatar

Watchers

 avatar  avatar James Cloos avatar  avatar

css-spriter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.