{ "info": { "author": "Yann Lanthony", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# QtSASS: Compile SCSS files to Qt stylesheets\n\n[![License - MIT](https://img.shields.io/github/license/spyder-ide/qtsass.svg)](./LICENSE.txt)\n[![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](#backers)\n[![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)
\n[![Travis build status](https://img.shields.io/travis/spyder-ide/qtsass/master.svg)](https://travis-ci.org/spyder-ide/qtsass)\n[![AppVeyor build status](https://img.shields.io/appveyor/ci/spyder-ide/qtsass/master.svg)](https://ci.appveyor.com/project/spyder-ide/qtsass)\n[![Codecov coverage](https://img.shields.io/codecov/c/github/spyder-ide/qtsass/master.svg)](https://codecov.io/gh/spyder-ide/qtsass)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spyder-ide/qtsass/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spyder-ide/qtsass/?branch=master)\n\n*Copyright \u00a9 2015 Yann Lanthony*\n\n*Copyright \u00a9 2017\u20132018 Spyder Project Contributors*\n\n\n## Overview\n\n[SASS](http://sass-lang.com/) brings countless amazing features to CSS.\nBesides being used in web development, CSS is also the way to stylize Qt-based desktop applications.\nHowever, Qt's CSS has a few variations that prevent the direct use of SASS compiler.\n\nThe purpose of this tool is to fill the gap between SASS and Qt-CSS by handling those variations.\n\n\n## Qt's CSS specificities\n\nThe goal of QtSASS is to be able to generate a Qt-CSS stylesheet based on a 100% valid SASS file.\nThis is how it deals with Qt's specifics and how you should modify your CSS stylesheet to use QtSASS.\n\n#### \"!\" in selectors\nQt allows to define the style of a widget according to its states, like this:\n\n```css\nQLineEdit:enabled {\n...\n}\n```\n\nHowever, a \"not\" state is problematic because it introduces an exclamation mark in the selector's name, which is not valid SASS/CSS:\n\n```css\nQLineEdit:!editable {\n...\n}\n```\n\nQtSASS allows \"!\" in selectors' names; the SASS file is preprocessed and any occurence of `:!` is replaced by `:_qnot_` (for \"Qt not\").\nHowever, using this feature prevents from having a 100% valid SASS file, so this support of `!` might change in the future.\nThis can be replaced by the direct use of the `_qnot_` keyword in your SASS file:\n\n```css\nQLineEdit:_qnot_editable { /* will generate QLineEdit:!editable { */\n...\n}\n```\n\n#### qlineargradient\nThe qlineargradient function also has a non-valid CSS syntax.\n\n```css\nqlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.1 blue, stop: 0.8 green)\n```\n\nTo support qlineargradient QtSASS provides a preprocessor and a SASS implementation of the qlineargradient function. The above QSS syntax will be replaced with the following:\n\n```css\nqlineargradient(0, 0, 0, 1, (0.1 blue, 0.8 green))\n```\n\nYou may also use this syntax directly in your QtSASS.\n\n```\nqlineargradient(0, 0, 0, 1, (0.1 blue, 0.8 green))\n# the stops parameter is a list, so you can also use variables:\n$stops = 0.1 blue, 0.8 green\nqlineargradient(0, 0, 0, 0, $stops)\n```\n\n#### qrgba\nQt's rgba:\n\n```css\nrgba(255, 128, 128, 50%)\n```\n\nis replaced by CSS rgba:\n\n```css\nrgba(255, 128, 128, 0.5)\n```\n\n\n## Executable usage\n\nTo compile your SASS stylesheet to a Qt compliant CSS file:\n\n```bash\n# If -o is omitted, output will be printed to console\nqtsass style.scss -o style.css\n```\n\nTo use the watch mode and get your stylesheet auto recompiled on each file save:\n\n```bash\n# If -o is omitted, output will be print to console\nqtsass style.scss -o style.css -w\n```\n\nTo compile a directory containing SASS stylesheets to Qt compliant CSS files:\n\n```bash\nqtsass ./static/scss -o ./static/css\n```\n\nYou can also use watch mode to watch the entire directory for changes.\n\n```bash\nqtsass ./static/scss -o ./static/css -w\n```\n\n## API methods\n\n### `compile(string, **kwargs)`\n\nConform and Compile QtSASS source code to CSS.\n\nThis function conforms QtSASS to valid SCSS before passing it to\nsass.compile. Any keyword arguments you provide will be combined with\nqtsass's default keyword arguments and passed to sass.compile.\n\nExamples:\n\n```bash\n>>> import qtsass\n>>> qtsass.compile(\"QWidget {background: rgb(0, 0, 0);}\")\nQWidget {background:black;}\n```\n\nArguments:\n- string: QtSASS source code to conform and compile.\n- kwargs: Keyword arguments to pass to sass.compile\n\nReturns:\n- Qt compliant CSS string\n\n### `compile_filename(input_file, dest_file, **kwargs)`:\n\nCompile and save QtSASS file as Qt compliant CSS.\n\nExamples:\n\n```bash\n>>> import qtsass\n>>> qtsass.compile_filename('dummy.scss', 'dummy.css') \n```\n\nArguments:\n- input_file: Path to QtSass file.\n- dest_file: Path to destination Qt compliant CSS file.\n- kwargs: Keyword arguments to pass to sass.compile\n\n### `compile_filename(input_file, output_file, **kwargs)`:\n\nCompile and save QtSASS file as Qt compliant CSS.\n\nExamples:\n\n```bash\n>>> import qtsass\n>>> qtsass.compile_filename('dummy.scss', 'dummy.css') \n```\n\nArguments:\n- input_file: Path to QtSass file.\n- output_file: Path to write Qt compliant CSS.\n- kwargs: Keyword arguments to pass to sass.compile\n\n### `compile_dirname(input_dir, output_dir, **kwargs)`:\n\nCompiles QtSASS files in a directory including subdirectories.\n\n```bash\n>>> import qtsass\n>>> qtsass.compile_dirname(\"./scss\", \"./css\")\n```\n\nArguments:\n- input_dir: Path to directory containing QtSass files.\n- output_dir: Directory to write compiled Qt compliant CSS files to.\n- kwargs: Keyword arguments to pass to sass.compile\n\n### watch(source, destination, compiler=None, recursive=True):\nWatches a source file or directory, compiling QtSass files when modified.\n\nThe compiler function defaults to compile_filename when source is a file\nand compile_dirname when source is a directory.\n\nArguments:\n- source: Path to source QtSass file or directory.\n- destination: Path to output css file or directory.\n- compiler: Compile function (optional)\n- recursive: If True, watch subdirectories (default: True).\n\nReturns: \n- watchdog.Observer\n\n\n## Contributing\n\nEveryone is welcome to contribute!\n\n\n## Sponsors\n\nSpyder and its subprojects are funded thanks to the generous support of\n\n[![Quansight](https://static.wixstatic.com/media/095d2c_2508c560e87d436ea00357abc404cf1d~mv2.png/v1/crop/x_0,y_9,w_915,h_329/fill/w_380,h_128,al_c,usm_0.66_1.00_0.01/095d2c_2508c560e87d436ea00357abc404cf1d~mv2.png)](https://www.quansight.com/)[![Numfocus](https://i2.wp.com/numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png?fit=320%2C148&ssl=1)](https://numfocus.org/)\n\n\nand the donations we have received from our users around the world through [Open Collective](https://opencollective.com/spyder/):\n\n[![Sponsors](https://opencollective.com/spyder/sponsors.svg)](https://opencollective.com/spyder#support)\n\nPlease consider becoming a sponsor!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/spyder-ide/qtsass", "keywords": "qt sass qtsass scss css stylesheets", "license": "MIT", "maintainer": "The Spyder Project Contributors", "maintainer_email": "qtsass@spyder-ide.org", "name": "qtsass", "package_url": "https://pypi.org/project/qtsass/", "platform": "", "project_url": "https://pypi.org/project/qtsass/", "project_urls": { "Homepage": "https://github.com/spyder-ide/qtsass" }, "release_url": "https://pypi.org/project/qtsass/0.1.1/", "requires_dist": [ "libsass", "watchdog" ], "requires_python": "", "summary": "Compile SCSS files to valid Qt stylesheets.", "version": "0.1.1" }, "last_serial": 5195504, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "308a81cf9c3a9076ca131638e55142c1", "sha256": "1f70fe1d4b8c1b140edf417f9d868d1665a12efdccaa6b574a9e2e0b8f83f494" }, "downloads": -1, "filename": "qtsass-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "308a81cf9c3a9076ca131638e55142c1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12517, "upload_time": "2019-04-27T00:59:34", "url": "https://files.pythonhosted.org/packages/2e/75/1881c9673e678c9b6937d10294f45d9ffb31a43dae23153a6186d02bd4ae/qtsass-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c62b0e0a627b85584bbf6afc4c8a76f3", "sha256": "cfd516270ec6e531ce83c4abff10ef81aa9b7d924f5812df049373b69a9eec64" }, "downloads": -1, "filename": "qtsass-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c62b0e0a627b85584bbf6afc4c8a76f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11086, "upload_time": "2019-04-27T00:59:41", "url": "https://files.pythonhosted.org/packages/0a/b4/7469278cab7080acfaad842b8d58d8893676294790a13a4cb0163576c498/qtsass-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5a483a351759381616998b28c1cde2ce", "sha256": "c12c6f805b9624994e77d6858219f87a5d80ef3059a48c378cf28b7f6b99b606" }, "downloads": -1, "filename": "qtsass-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a483a351759381616998b28c1cde2ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12515, "upload_time": "2019-04-27T01:23:50", "url": "https://files.pythonhosted.org/packages/5f/2f/7f0b4d98d195523f188be84d362918eaa73cad7b15da5067692ffb294769/qtsass-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72dff0f8fcc8afa77fcb5416354180d4", "sha256": "4b1491e9810c7216365647e416fd7b49aeadc1ac25add8c6131deddf7549a072" }, "downloads": -1, "filename": "qtsass-0.1.1.tar.gz", "has_sig": false, "md5_digest": "72dff0f8fcc8afa77fcb5416354180d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12266, "upload_time": "2019-04-27T01:23:53", "url": "https://files.pythonhosted.org/packages/dc/95/a502fde72db6e31a3e2fcf34b5360a545b99101a51eb2c490b8e240f6949/qtsass-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a483a351759381616998b28c1cde2ce", "sha256": "c12c6f805b9624994e77d6858219f87a5d80ef3059a48c378cf28b7f6b99b606" }, "downloads": -1, "filename": "qtsass-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a483a351759381616998b28c1cde2ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12515, "upload_time": "2019-04-27T01:23:50", "url": "https://files.pythonhosted.org/packages/5f/2f/7f0b4d98d195523f188be84d362918eaa73cad7b15da5067692ffb294769/qtsass-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72dff0f8fcc8afa77fcb5416354180d4", "sha256": "4b1491e9810c7216365647e416fd7b49aeadc1ac25add8c6131deddf7549a072" }, "downloads": -1, "filename": "qtsass-0.1.1.tar.gz", "has_sig": false, "md5_digest": "72dff0f8fcc8afa77fcb5416354180d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12266, "upload_time": "2019-04-27T01:23:53", "url": "https://files.pythonhosted.org/packages/dc/95/a502fde72db6e31a3e2fcf34b5360a545b99101a51eb2c490b8e240f6949/qtsass-0.1.1.tar.gz" } ] }