File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How do you manage and version control CSS sprite? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How do you manage and version control CSS sprite?" Watch "How do you manage and version control CSS sprite?" New topic
Author

How do you manage and version control CSS sprite?

Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3112
    
  42

If your website has so many small images you better keep bundle them into CSS sprite files. I am just scratching my head trying to figure out a best to manage and version control these generated sprite images. Let's say you had a small delete button and you already bundled it in a sprite file. Now you got a better image for the same button and you want to update your sprite. What practices do you follow to get this done? Ways I can think of are..

  • Use Photoshop to edit the whole sprite image and replace the previous button with the new one.
  • Regenerate your sprite with the tool you use to generate them.

  • What do you follow as a best practice? Anything other than the above two ways?

    Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
    What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61310
        
      66

    For me it's all about Photoshop, baby!

    Coincidental timing: I've spent a lot of time this week in Photoshop, a lot of it creating and editing sprite sheets.

    With regards to version control, I keep the original layered PSD files in version control as well as checking in the exported PNGs.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Devaka Cooray
    ExamLab Creator
    Saloon Keeper

    Joined: Jul 29, 2008
    Posts: 3112
        
      42

    Thanks Bear! I was always a tool-whiz and this made me realize I can no longer be
    Eric Pascarello
    author
    Rancher

    Joined: Nov 08, 2001
    Posts: 15376
        
        6
    Just because you change the image does not mean your users will also see the changes due to caching. To get around it, you would need to add a version querystring after the image to force a new version from the cache.

     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: How do you manage and version control CSS sprite?