On Github twolfson / hack-and-tell-spritesmith
Created by Todd Wolfson / @twolfsn / github/twolfson
If you are familiar with this, disregard it.
The above are CSS spritesheets for Google and Twitter Bootstrap respectively.
- As sprite is each image separate image. The entirety is known as a spritesheet. - These are known as CSS sprite sheet and what we will be talking for the next 4 1/2 minutes.Spritesheet and variable maintenance is either:
I was maintaining CSS by hand, a JavaScript guru, and a Windows user.
I was the perfect candidate.
During my initial research, I found two node modules which would suit my needs:
`gm` would handle Windows as it available as an `.exe`. `node-canvas` would handle Unix as it compiles when installed via `npm`.
gm was the harder of the 2 engines.
It required "trial and error" to get transparency working.
In the end, it all came together and we were making sprites =D
The next step was to write a grunt wrapper and call it a day.
However, I pondered modularity and if/where I could draw lines.
I wound up writing 5 modules and am considering even more.
grunt-spritesmith, spritesmith, layout json2css, json-content-demux
3 engines; phantomjs, gm, node-canvas
4 algorithms; top-down, left-right, diagonal, alt-diagonal
5 CSS variable formats; JSON, SASS, SCSS, LESS, Stylus
1 third party project written on top of spritesmith
Still looking for a hosted solution for no external dependencies
Created by Todd Wolfson / @twolfsn / github/twolfson