{ "info": { "author": "Patrice Neff ", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Multimedia :: Graphics :: Graphics Conversion" ], "description": "Nikwus: Automated CSS Sprite Generation\n=======================================\n\nNikwus is a tool to automatically create CSS sprites. It works by parsing a CSS\nfile and adding all the background images it can find to a sprite image.\n\nThe CSS is rewritten to use that generated image and all background positions\nare written.\n\nTo make best use of Nikwus, some custom CSS rules will have to be added to the\nCSS file.\n\n\nUsage\n-----\n\nNikwus is used as a library from existing Python code. The public method\n``nikwus.sprite`` is provided and it takes three arguments:\n\n- ``directory``: The image directory where the sprites are written to.\n- ``cssfile``: The file name of the CSS file to process. The default sprite\n will have the same name as this file with the ``css`` extension changed to\n ``png``.\n- ``outfile`` (optional): The file name where to write the converted CSS file\n to. If this is not provided, the original CSS file is overwritten.\n\n\nExample::\n\n nikwus.sprite('img/icons/', 'css/main.css')\n\n\nCustom Rules\n------------\n\nThe following rules can be used in CSS files to change the behavior of Nikwus.\n\n``-sprite-name``\n~~~~~~~~~~~~~~~~\n\nMultiple sprites can be generated by using ``-sprite-name``. Every image that\ndoes not specify this will go into the default sprite.\n\nExample::\n\n .icon.world {\n background: url(world.png) no-repeat;\n /* Put login-related icons into a separate sprite for fast loading */\n -sprite-name: login;\n }\n\n\n``-sprite-selector``\n~~~~~~~~~~~~~~~~~~~~\n\nBy default Nikwus will repeat the full background, including the sprite URL on\neach CSS rule. By using a sprite selector this can be avoided and only the\nbackground position will be set.\n\nThe selector can also be used for generating Retina versions, see the chapter\non Retina below.\n\n\nExample::\n\n .icon {\n /* This becomes the container for the default sprite */\n -sprite-selector: default;\n }\n .login-icon {\n /* Login icons are put into a separate sprite, that will be configured\n on this CSS rule */\n -sprite-selector: login;\n }\n .icon.world {\n background: url(world.png) no-repeat;\n -sprite-name: login;\n }\n .icon.mars {\n background: url(mars.png) no-repeat;\n /* This does not have a ``-sprite-name``, so it goes into the default\n sprite */\n }\n\n\n``-sprite``\n~~~~~~~~~~~\n\nSpriting can be turned off for individual CSS rules by using the ``-sprite: no``\ndeclaration. ``.gif`` images are not included in a sprite by default as they are\noften used for animated backgrounds. That can be changed by using\n``-sprite: yes``.\n\nExample::\n\n .logo {\n background: url(logo.png) no-repeat;\n -sprite: no;\n }\n .check {\n background: url(check.gif) no-repeat;\n -sprite: yes;\n }\n\n``-sprite-autosize``\n~~~~~~~~~~~~~~~~~~~~\n\nBy default Nikwus will write the width and height of the image into it's CSS\nrule. This can be turned off with ``-sprite-autosize``.\n\nThe width and height are not written into the container if:\n\n- it's exactly the same as specified in the sprite selector rule\n- a width, height, or both have already been specified in this rule\n\nExample::\n\n .icon.world {\n background: url(world.png) no-repeat;\n -sprite-autosize: no;\n }\n .icon.mars {\n /* Sizes won't be specified for this icon either, because it already\n has a width */\n background: url(mars.png) no-repeat;\n width: 10px;\n }\n\n\nRetina Sprites\n--------------\n\nFor mobile devices with higher pixel densities, it's recommended to create\ndifferent sprites to take advantage of that fact.\n\nNikwus supports this by specifying a special ``-sprite-selector``. Start by\nchanging the CSS to something like this::\n\n .icon {\n -sprite-selector: default;\n }\n .icon.world {\n background: url(world.png) no-repeat;\n }\n\n /* Retina Handling */\n @media only screen and (-webkit-min-device-pixel-ratio: 2) {\n .icon {\n -sprite-selector: default 2x;\n }\n }\n\nNow for each image that is specified in the CSS, a separate retina version\nneeds to exist. In the example above ``world.png`` needs to be accompanied by\n``world-2x.png`` image. That second version must be exactly double the size of\nthe original.\n\nNikwus will abort with an error if the ``2x`` version can't be found or if it is\nnot exactly double the size.\n\n\nSupport\n-------\n\nNiwkus was developped by `Patrice Neff `_ for the use at\n`Squirro `_. The project is\n`hosted at GitHub `_.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "Nikwus", "package_url": "https://pypi.org/project/Nikwus/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Nikwus/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/Nikwus/0.5.4/", "requires_dist": null, "requires_python": null, "summary": "Automatically sprite images in CSS files", "version": "0.5.4" }, "last_serial": 1198873, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "e4c195cb0ec7cb3527be7843b3bf8019", "sha256": "fcbef24b4d8c2063f69a98e9c2fe17cc08793d515c7b035aeffb41c6e60ade38" }, "downloads": -1, "filename": "Nikwus-0.5.0.zip", "has_sig": false, "md5_digest": "e4c195cb0ec7cb3527be7843b3bf8019", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44748, "upload_time": "2013-06-27T20:57:28", "url": "https://files.pythonhosted.org/packages/06/53/db4a596df53e58a6075469eae1ae3392676ce8a2c11587dff4e14bddb562/Nikwus-0.5.0.zip" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "e0aa28293fd390d27d515e7ccb202181", "sha256": "8c39487f9d923503d9d6cb4fbff9aa1aaad465ff4cf5317b26747f6f59659fa1" }, "downloads": -1, "filename": "Nikwus-0.5.1.zip", "has_sig": false, "md5_digest": "e0aa28293fd390d27d515e7ccb202181", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44927, "upload_time": "2013-06-28T13:53:39", "url": "https://files.pythonhosted.org/packages/94/76/502fc78dc11cc10b227ecb3261b12bfb2abb05af93b85847259a1ae885be/Nikwus-0.5.1.zip" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "b0ed0f897271bdc2e59a8b443feafdec", "sha256": "6ecf963457c63e2448502a154338fb410b0a93d3cde008583276529bd6944fee" }, "downloads": -1, "filename": "Nikwus-0.5.2.zip", "has_sig": false, "md5_digest": "b0ed0f897271bdc2e59a8b443feafdec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 45309, "upload_time": "2013-12-19T18:19:27", "url": "https://files.pythonhosted.org/packages/1e/30/8c30655f3fbaa470f3fd86084fc4824667d2a1846da782491c294a4e1ac5/Nikwus-0.5.2.zip" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "9918abd8de36481dac26d99c50c89896", "sha256": "13759a3efcb276f6af211392093eceac82f320c0fb6be1969a4f470ef78e653d" }, "downloads": -1, "filename": "Nikwus-0.5.3.zip", "has_sig": false, "md5_digest": "9918abd8de36481dac26d99c50c89896", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50580, "upload_time": "2014-02-27T17:33:01", "url": "https://files.pythonhosted.org/packages/46/ca/7db599ed2a504256581fb39e0ad038e87e99e23835c41bd82272fc1e087b/Nikwus-0.5.3.zip" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "76a08681e93e7926ba25f3b31754bcce", "sha256": "9ea0f1f120cfbd93e7a8cff26d311f7596dc3f038df5dc45e9680c202aaf9406" }, "downloads": -1, "filename": "Nikwus-0.5.4.zip", "has_sig": false, "md5_digest": "76a08681e93e7926ba25f3b31754bcce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50701, "upload_time": "2014-08-22T15:03:27", "url": "https://files.pythonhosted.org/packages/a1/7a/383e0a5afd7c582cc713ed4c7f8ba9995c698aca1973345cea6f2c98268d/Nikwus-0.5.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76a08681e93e7926ba25f3b31754bcce", "sha256": "9ea0f1f120cfbd93e7a8cff26d311f7596dc3f038df5dc45e9680c202aaf9406" }, "downloads": -1, "filename": "Nikwus-0.5.4.zip", "has_sig": false, "md5_digest": "76a08681e93e7926ba25f3b31754bcce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50701, "upload_time": "2014-08-22T15:03:27", "url": "https://files.pythonhosted.org/packages/a1/7a/383e0a5afd7c582cc713ed4c7f8ba9995c698aca1973345cea6f2c98268d/Nikwus-0.5.4.zip" } ] }