{"id":13496075,"url":"https://github.com/zmoazeni/csscss","last_synced_at":"2025-03-28T17:34:49.996Z","repository":{"id":7206880,"uuid":"8512283","full_name":"zmoazeni/csscss","owner":"zmoazeni","description":"A CSS redundancy analyzer that analyzes redundancy.","archived":true,"fork":false,"pushed_at":"2018-11-27T17:45:20.000Z","size":226,"stargazers_count":2916,"open_issues_count":16,"forks_count":151,"subscribers_count":81,"default_branch":"master","last_synced_at":"2025-03-03T19:40:51.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zmoazeni.github.io/csscss/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmoazeni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-01T23:17:25.000Z","updated_at":"2025-02-14T15:51:04.000Z","dependencies_parsed_at":"2022-08-06T20:01:09.285Z","dependency_job_id":null,"html_url":"https://github.com/zmoazeni/csscss","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoazeni%2Fcsscss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoazeni%2Fcsscss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoazeni%2Fcsscss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoazeni%2Fcsscss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmoazeni","download_url":"https://codeload.github.com/zmoazeni/csscss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246069852,"owners_count":20718803,"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":[],"created_at":"2024-07-31T19:01:41.873Z","updated_at":"2025-03-28T17:34:49.708Z","avatar_url":"https://github.com/zmoazeni.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/zmoazeni/csscss.png?branch=master)](https://travis-ci.org/zmoazeni/csscss)\n[![Code Climate](https://codeclimate.com/github/zmoazeni/csscss.png)](https://codeclimate.com/github/zmoazeni/csscss)\n\n## What is it? ##\n\ncsscss will parse any CSS files you give it and let you know which\nrulesets have duplicated declarations.\n\n## What is it for? ##\n\nOne of the best strategies for me to maintain CSS is to reduce\nduplication as much as possible. It's not a silver bullet, but it sure\nhelps.\n\nTo do that, you need to have all the rulesets in your head at all times.\nThat's hard, csscss is easy. Let it tell you what is redundant.\n\n## How do I use it? ##\n\nFirst you need to install it. It is currently packaged as a ruby gem:\n\n    $ gem install csscss\n\nNote: csscss only works on ruby 1.9.x and up. It will have trouble with ruby 1.8.x.\n\nThen you can run it in at the command line against CSS files.\n\n    $ csscss path/to/styles.css path/to/other-styles.css\n\n    {.contact .content .primary} and {article, #comments} share 5 rules\n    {.profile-picture}, {.screenshot img} and {a.blurb img} share 4 rules\n    {.work h2:first-child, .contact h2} and {body.home h2} share 4 rules\n    {article.blurb:hover} and {article:hover} share 3 rules\n\nRun it in a verbose mode to see all the duplicated styles.\n\n    $ csscss -v path/to/styles.css\n\nRun it against remote files by passing a valid URL.\n\n    $ csscss -v http://example.com/css/main.css\n\nYou can also choose a minimum number of matches, which will ignore any\nrulesets that have fewer matches.\n\n    $ csscss -n 10 -v path/to/style.css # ignores rulesets with \u003c 10 matches\n\nIf you prefer writing in [Sass](http://sass-lang.com/), you can also parse your sass/scss files.\n\n    $ gem install sass\n    $ csscss path/to/style.scss\n\nSass users may be interested in the `--ignore-sass-mixins`\nexperimental flag that won't match duplicate declarations from including mixins.\n\nIf you prefer writing in [LESS](http://lesscss.org/), you can also parse your LESS files.\n\n    $ gem install less\n    $ csscss path/to/style.less\n\nLESS requires an additional javascript runtime.\n[v8/therubyracer](https://rubygems.org/gems/therubyracer) on most\nrubies, and [therubyrhino](https://rubygems.org/gems/therubyrhino) on\njruby.\n\n## Are there any community extensions? ##\n\n* [compass-csscss](https://github.com/Comcast/compass-csscss) integrates csscss with [compass](http://compass-style.org/) projects.\n* [grunt-csscss](https://github.com/peterkeating/grunt-csscss) a [grunt](http://gruntjs.com/) task to automatically run csscss.\n* [gulp-csscss](https://www.npmjs.org/package/gulp-csscss/) a [gulp](http://gulpjs.com/) task to automatically run csscss.\n\n_Please submit [an issue](https://github.com/zmoazeni/csscss/issues/new) if you know of any others._\n\n## Why doesn't csscss automatically remove duplications for me? ##\n\nI have been asked this a lot, but csscss is intentionally designed this\nway. Check out [this\npost](https://connectionrequired.com/blog/2013/04/why-csscss-doesnt-remove-duplication-for-you)\nfor my reasoning.\n\n## I found bugs ##\n\nThis is still a new and evolving project. I heartily welcome feedback.\nIf you find any issues, please report them on\n[github](https://github.com/zmoazeni/csscss/issues).\n\nPlease include the smallest CSS snippet to describe the issue and the\noutput you expect to see.\n\n## I'm a dev, I can help ##\n\nAwesome! Thanks! Here are the steps I ask:\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Make sure the tests pass (`bundle exec rake test`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n","funding_links":[],"categories":["Ruby","目录","2. 调试工具 ##","2. 调试工具"],"sub_categories":["测试/工具/Mock","13.20 视差滚动(Parallax Scrolling) ###","24.3 Web Sockets"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmoazeni%2Fcsscss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmoazeni%2Fcsscss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmoazeni%2Fcsscss/lists"}