{"id":19855770,"url":"https://github.com/jcs-elpa/com-css-sort","last_synced_at":"2025-05-02T01:31:14.044Z","repository":{"id":97567881,"uuid":"131587347","full_name":"jcs-elpa/com-css-sort","owner":"jcs-elpa","description":"Common way of sorting the CSS attributes.","archived":false,"fork":false,"pushed_at":"2025-04-23T00:06:08.000Z","size":3728,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T01:20:07.316Z","etag":null,"topics":["attribute","css","element","emacs","handy"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcs-elpa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["jcs-elpa","jcs090218"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-04-30T11:25:23.000Z","updated_at":"2025-04-23T00:06:12.000Z","dependencies_parsed_at":"2024-01-20T10:40:47.662Z","dependency_job_id":"40e17f69-5177-4a26-9356-d7b08c1718b3","html_url":"https://github.com/jcs-elpa/com-css-sort","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcs-elpa%2Fcom-css-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcs-elpa%2Fcom-css-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcs-elpa%2Fcom-css-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcs-elpa%2Fcom-css-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcs-elpa","download_url":"https://codeload.github.com/jcs-elpa/com-css-sort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251969385,"owners_count":21673193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attribute","css","element","emacs","handy"],"created_at":"2024-11-12T14:13:40.659Z","updated_at":"2025-05-02T01:31:14.039Z","avatar_url":"https://github.com/jcs-elpa.png","language":"Emacs Lisp","readme":"[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![MELPA](https://melpa.org/packages/com-css-sort-badge.svg)](https://melpa.org/#/com-css-sort)\n[![MELPA Stable](https://stable.melpa.org/packages/com-css-sort-badge.svg)](https://stable.melpa.org/#/com-css-sort)\n\n# com-css-sort\n\u003e Common way of sorting the CSS attributes.\n\n[![CI](https://github.com/jcs-elpa/com-css-sort/actions/workflows/test.yml/badge.svg)](https://github.com/jcs-elpa/com-css-sort/actions/workflows/test.yml)\n\n| Before Sorting                                  |  Type Sorting                                      |  Alphabetic Sorting                                      |\n|:-----------------------------------------------:|:--------------------------------------------------:|:--------------------------------------------------------:|\n|\u003cimg src=\"./etc/com-css-sort-before.png\"/\u003e|\u003cimg src=\"./etc/com-css-sort-type-sort.png\"/\u003e|\u003cimg src=\"./etc/com-css-sort-alphabetic-sort.png\"/\u003e|\n\n## ❓ How to use?\n\n### Alphabetic Order\n\n1. Just set `com-css-sort-sort-type` to alphabetic-sort.\n\n```el\n(setq com-css-sort-sort-type 'alphabetic-sort)\n```\n\n### Type Order / Customize Order Your Own\n\n1. Set `com-css-sort-sort-type` to type-sort.\n\n```el\n(setq com-css-sort-sort-type 'type-sort)\n```\n\n2. Create `sort-order.config` file at the version control root directory.\nYou can grab a config file from `./config_examples/` directory in this \nrepository. If the file does not exists, variable list \n`com-css-sort-default-attributes-order`  will be use as default sorting\norder list.\n\n3. Look at the .config file, the order in the file will be the order that\nthe CSS attributes will be sorted.\n\n## 🧪 Configuration\n\nType of sorting algorithm you want used when sorting CSS attributes.\n\n* type-sort : Sort in group type. Use 'sort-order.config' if there is one in the \nversion control root directory. (Default)\n\n* alphabetic-sort : Sort in alphabetic order. The 'sort-order.config' file will be \nignore and will not do anything.\n\n```el\n(setq com-css-sort-sort-type 'type-sort)        ; Type Sorting\n(setq com-css-sort-sort-type 'alphabetic-sort)  ; Alphabetic Sorting\n```\n\nIf you don't like the path or file name, you can change it too. This variable is\nrelative path to version control root directory.\n\n```el\n(setq com-css-sort-sort-file \"sort-order.config\")\n```\n\nCustomize your own sorting order programmatically. If you do not have the\n`sort-order.config' file in the version control root directory then this will be use!\n\n```el\n;; Default sorting order list.\n(setq com-css-sort-default-attributes-order '(\"display\" \"position\" \"top\" \"right\" \"bottom\" \"left\" \"float\" \"clear\"\n                                              \"visibility\" \"opacity\" \"z-index\" \"margin\" \"margin-top\" \n                                              \"margin-right\" \"margin-bottom\" \"margin-left\" \"outline\" \"border\" \n                                              \"border-top\" \"border-right\" \"border-bottom\" \"border-left\" \n                                              \"border-width\" \"border-top-width\" \"border-right-width\" \n                                              \"border-bottom-width\" \"border-left-width\" \"border-style\" \n                                              \"border-top-style\" \"border-right-style\" \"border-bottom-style\" \n                                              \"border-left-style\" \"border-color\" \"border-top-color\" \n                                              \"border-right-color\" \"border-bottom-color\" \"border-left-color\" \n                                              \"background\" \"background-color\" \"background-image\" \n                                              \"background-repeat\" \"background-position\" \"cursor\" \"padding\" \n                                              \"padding-top\" \"padding-right\" \"padding-bottom\" \"padding-left\" \n                                              \"width\" \"min-width\" \"max-width\" \"height\" \"min-height\" \"max-height\" \n                                              \"overflow\" \"list-style\" \"caption-side\" \"table-layout\" \n                                              \"border-collapse\" \"border-spacing\" \"empty-cells\" \"vertical-align\" \n                                              \"text-align\" \"text-indent\" \"text-transform\" \"text-decoration\" \n                                              \"line-height\" \"word-spacing\" \"letter-spacing\" \"white-space\" \"color\" \n                                              \"font\" \"font-family\" \"font-size\" \"font-weight\" \"content\" \"quotes\"))\n```\n\n## ⌨️ Key Bindings\n\nJust bind the key if to whatever you feel comfortable with.\n\n```el\n;; Sort attributes inside block.\n(define-key css-mode-map (kbd \"C-k s\") #'com-css-sort-attributes-block)\n\n;; Sort attributes through the whole document.\n(define-key css-mode-map (kbd \"C-k d\") #'com-css-sort-attributes-document)\n```\n\n## 🛠️ Contribute\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![Elisp styleguide](https://img.shields.io/badge/elisp-style%20guide-purple)](https://github.com/bbatsov/emacs-lisp-style-guide)\n[![Donate on paypal](https://img.shields.io/badge/paypal-donate-1?logo=paypal\u0026color=blue)](https://www.paypal.me/jcs090218)\n[![Become a patron](https://img.shields.io/badge/patreon-become%20a%20patron-orange.svg?logo=patreon)](https://www.patreon.com/jcs090218)\n\nIf you would like to contribute to this project, you may either \nclone and make pull requests to this repository. Or you can \nclone the project and establish your own branch of this tool. \nAny methods are welcome!\n\n### 🔬 Development\n\nTo run the test locally, you will need the following tools:\n\n- [Eask](https://emacs-eask.github.io/)\n- [Make](https://www.gnu.org/software/make/) (optional)\n\nInstall all dependencies and development dependencies:\n\n```sh\neask install-deps --dev\n```\n\nTo test the package's installation:\n\n```sh\neask package\neask install\n```\n\nTo test compilation:\n\n```sh\neask compile\n```\n\n**🪧 The following steps are optional, but we recommend you follow these lint results!**\n\nThe built-in `checkdoc` linter:\n\n```sh\neask lint checkdoc\n```\n\nThe standard `package` linter:\n\n```sh\neask lint package\n```\n\n*📝 P.S. For more information, find the Eask manual at https://emacs-eask.github.io/.*\n\n## ⚜️ License\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\nSee [`LICENSE`](./LICENSE.txt) for details.\n","funding_links":["https://github.com/sponsors/jcs-elpa","https://github.com/sponsors/jcs090218","https://www.paypal.me/jcs090218","https://www.patreon.com/jcs090218"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcs-elpa%2Fcom-css-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcs-elpa%2Fcom-css-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcs-elpa%2Fcom-css-sort/lists"}