https://github.com/matthewhague/sat-css-tool Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} matthewhague / sat-css-tool Public * Notifications * Fork 1 * Star 98 * Minify CSS files through refactoring 98 stars 1 fork Branches Tags Activity Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights matthewhague/sat-css-tool This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 43 Commits Vienna Vienna benchmarks benchmarks satcss satcss .gitignore .gitignore NOTES.md NOTES.md README.md README.md main.py main.py poetry.lock poetry.lock pyproject.toml pyproject.toml requirements.txt requirements.txt test.py test.py View all files Repository files navigation * README SatCSS Minimise CSS files through semantics-preserving refactoring. E.g. .a { color: red } .b { color: red } can be refactored .a, .b { color: red } but .a { color: red } .c { color: blue } .b { color: red } cannot, since .a, .b { color: red } .c { color: blue } changes the color of an element with class="b c". Can also be used to test whether two selectors may match the same node in some DOM. Can also be used as a tool/library for building an abstract representation of a CSS file as a set of pairs (selector, declaration) with an ordering (representing the order selectors must appear in the CSS file to maintain the overriding semantics). Requirements: Python 3.7 or compatible. * cssselect 1.2.0 * docopt 0.6.2 * lxml 4.9.2 * tinycss2 1.2.1 * toposort 1.10 * z3-solver 4.12.2.0 Borrowed and modified code from * cssselect 0.9.1 The recommended build system is Poetry. Tested with version 1.7.0. External Requirements In the same directory as satcss/main.py, ensure that running ./z3 runs the Z3 SMT solver. For example, this can be a symlink to the Z3 installed on your machine. The tool was last tested with Z3 v4.12.2.0. Running with Poetry To setup and run the project with Poetry, from the root directory run poetry install Then poetry run satcss --help To try a benchmark: poetry run satcss benchmarks/dblp-2015-07-09-stripmq.css To output the file: poetry run satcss -o --file=blah.min.css benchmarks/dblp-2015-07-09-stripmq.css Running without Poetry Two scripts main.py and test.py are provided in the root directory for running without Poetry. First install the requirements manually. You can use requirements.txt. pip install -r requirements.txt Then run python main.py --help where "python" is your python 3.7 or above command. TOPLAS Version The version current as of the TOPLAS paper is tagged TOPLAS-Release. About Minify CSS files through refactoring Resources Readme Activity Stars 98 stars Watchers 2 watching Forks 1 fork Report repository Releases 1 tags Packages 0 No packages published Contributors 3 * @matthewhague matthewhague * @yourealwaysbe yourealwaysbe * @anthonywlin anthonywlin Anthony W. Lin Languages * Python 84.9% * Roff 9.0% * HTML 6.1% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.