Code review comment for lp:~edwin-grubbs/launchpad/auto-gen-sprites

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Summary
-------

Added the ability to easily generate the sprite image file
and the css using it. The immediate benefit is to increase the
margin between the images, so that elements that wrap to multiple
lines will not show the next sprite in the file.

Implementation details
----------------------

Added sprite_image and sprite_css targets. sprite_css is a dependency
of css_combine, so it is automatically built for "make run" unless
build/style-3-0.css already exists.
    Makefile

Added bin/sprite-util to support the Makefile targets.
    buildout-templates/bin/sprite-util.in

The SpriteUtil class:
    lib/lp/services/spriteutils.py

The icing/style-3-0.css file was moved to the icing/build/
directory, since it is now autogenerated, and this will
help prevent people from opening and editing it instead
of sprite-3-0.css.in.
    buildout-templates/bin/combine-css.in

"make sprite_css" takes this file and icon-sprites.positioning
as inputs to generate icing/build/style-3-0.css.
    lib/canonical/launchpad/icing/style-3-0.css.in

These two files are automatically generated by "make sprite_image".
    lib/canonical/launchpad/icing/icon-sprites
    lib/canonical/launchpad/icing/icon-sprites.positioning

Testing:
    lib/lp/services/doc/sprites.txt
    lib/lp/services/tests/test_doc.py
    lib/lp/services/tests/testfiles/template.css

Since the margin has increased, more results can be shown
in the picker.
    lib/canonical/launchpad/browser/vocabulary.py

The search field at the bottom of all the launchpad pages had
an search sprite stuck at the end of the form element. It wasn't
clickable, and the css for ".footer .lp-arcana .search-icon"
seemed unnecesarily specific to that usage.
    lib/lp/app/templates/base-layout-macros.pt

Tests
-----

./bin/test -vv -t sprites

Demo and Q/A
------------

* Open http://launchpad.dev/bazaar
    * Check that all the sprites look right.
    * Check that you can click on the search icon in the footer.

« Back to merge proposal