Hi guys, I have written a rails plugin/gem to generate css sprite image automatically. The project repository is here: http://github.com/flyerhzm/css_sprite It is based on RMagick and you need only define a rule from what source images to a destination image, as follows: forum_icon_vertical.gif: # destination image file sources: # source image file list - good_topic.gif - mid_topic.gif - unread_topic.gif - sticky_topic.gif orient: vertical # composite gravity, vertical or horizontal span: 20 # span of space between two images Then run a rake task rake css_sprite:build So, you can see a forum_icon_vertical.gif generated in public/images directory and a css sprite rule in tmp/css_sprite.css, as follows: .good_topic backgound: url(''/images/forum_icon_vertical.gif'') no-repeat 0px 0px width: 20px height: 19px .mid_topic backgound: url(''/images/forum_icon_vertical.gif'') no-repeat 0px 39px width: 20px height: 19px .unread_topic backgound: url(''/images/forum_icon_vertical.gif'') no-repeat 0px 78px width: 19px height: 18px .sticky_topic backgound: url(''/images/forum_icon_vertical.gif'') no-repeat 0px 116px width: 19px height: 18px Hope you like it! Richard Huang
lucky in ruby
2010-Aug-24 15:01 UTC
Re: A rails plugin to generate css sprite image automatically
flyerhzm wrote:> Hi guys, > > I have written a rails plugin/gem to generate css sprite image > automatically. > > The project repository is here: http://github.com/flyerhzm/css_sprite > > It is based on RMagick and you need only define a rule from what# span of space between two images> > Then run a rake task > > rake css_sprite:build > > ..... > > Richard HuangThanks a lot dude !! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Edmond Kachale
2010-Aug-24 15:30 UTC
Re: Re: A rails plugin to generate css sprite image automatically
Cool, I have already cloned it!!! I think this link you also referred to (about *css sprite best practices*) is equally significant for most of us: http://www.huangzhimin.com/entries/190-css-sprite-best-practices --- Edmond Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) | Malawi Cell: +265 999 465 137 | +265 881 234 717 *"Many people doubt open source software and probably don’t realize that there is an alternative… which is just as good.." -- Kevin Scannell* 2010/8/24 lucky in ruby <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> flyerhzm wrote: > > Hi guys, > > > > I have written a rails plugin/gem to generate css sprite image > > automatically. > > > > The project repository is here: http://github.com/flyerhzm/css_sprite > > > > It is based on RMagick and you need only define a rule from what > # span of space between two images > > > > Then run a rake task > > > > rake css_sprite:build > > > > ..... > > > > Richard Huang > > > Thanks a lot dude !! > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
flyerhzm
2010-Aug-25 02:29 UTC
Re: A rails plugin to generate css sprite image automatically
I''m glad you like this plugin, and I also write a similar post here, http://rails-bestpractices.com/posts/43-use-css-sprite-automatically, so that you can post your comment about it. Thanks On 8月24日, 下午11时30分, Edmond Kachale <edmond.kach...-qPoFbzSWEfuuL8s4vL5bMA@public.gmane.org> wrote:> Cool, > > I have already cloned it!!! > > I think this link you also referred to (about *css sprite best practices*) > is equally significant for most of us:http://www.huangzhimin.com/entries/190-css-sprite-best-practices > --- > Edmond > Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) | > Malawi > > Cell: +265 999 465 137 | +265 881 234 717 > > *"Many people doubt open source software and probably don''t realize that > there is an alternative... which is just as good.." -- Kevin Scannell* > > 2010/8/24 lucky in ruby <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > > > flyerhzm wrote: > > > Hi guys, > > > > I have written a rails plugin/gem to generate css sprite image > > > automatically. > > > > The project repository is here:http://github.com/flyerhzm/css_sprite > > > > It is based on RMagick and you need only define a rule from what > > # span of space between two images > > > > Then run a rake task > > > > rake css_sprite:build > > > > ..... > > > > Richard Huang > > > Thanks a lot dude !! > > -- > > Posted viahttp://www.ruby-forum.com/. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sam Woodard
2011-Mar-03 14:55 UTC
Re: A rails plugin to generate css sprite image automatically
flyerhzm wrote in post #855601:> Hi guys, > > I have written a rails plugin/gem to generate css sprite image > automatically.This is awesome! I''m really glad you are creating tools like this. Just wanted to through out there that there is another gem that is similar, active_assets, but it also creates the stylesheets! Check it out at Github: http://bitly.com/eRTwU4 The latest releases only work with Rails 3, but if you need 2.3 support use 0.3.x. Cheers, Sam -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Raul Souza Lima
2011-Mar-03 15:03 UTC
Re: Re: A rails plugin to generate css sprite image automatically
One more option https://github.com/hagenburger/lemonade ;) On 3 March 2011 11:55, Sam Woodard <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> flyerhzm wrote in post #855601: > > Hi guys, > > > > I have written a rails plugin/gem to generate css sprite image > > automatically. > > This is awesome! I''m really glad you are creating tools like this. > Just wanted to through out there that there is another gem that is > similar, active_assets, but it also creates the stylesheets! > > Check it out at Github: http://bitly.com/eRTwU4 > > The latest releases only work with Rails 3, but if you need 2.3 support > use 0.3.x. > > Cheers, > Sam > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- from Brazil, Raul Souza Lima Vegetarian, geek, born in São Paulo - Brazil. http://webxperience.com.br/ http://raulsouzalima.com/blog http://www.linkedin.com/in/raulsouzalima Please don''t print this e-mail Evite imprimir este e-mail -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Maybe Matching Threads
- little fighter 2 vdragonballz 3.0 mod crashes on load sprite
- Rgl and plotmath symbols (via sprites): a trial
- pretty url
- rails-brakeman.com, an online service to find security issues in your rails projects
- [LLVMdev] Problem linking and JITing code through C++-API