|
1 | | -# Csscss |
2 | | - |
3 | 1 | [](https://travis-ci.org/zmoazeni/csscss) |
4 | 2 |
|
5 | | -A CSS redundancy analyzer that analyzes redundancy. My first attempt was |
6 | | -in Haskell with https://github.com/zmoazeni/csscss-haskell this is the |
7 | | -second in Ruby. |
| 3 | +## What is it? ## |
| 4 | + |
| 5 | +csscss will parse any CSS files you give it and let you know which |
| 6 | +rulesets have duplicated declarations. |
| 7 | + |
| 8 | +## What is it for? ## |
| 9 | + |
| 10 | +One of the best strategies for me to maintain CSS is to reduce |
| 11 | +duplication as much as possible. It's not a silver bullet, but it sure |
| 12 | +helps. |
8 | 13 |
|
9 | | -## (Not ready yet) Installation |
| 14 | +To do that, you need to have all the rulesets in your head at all times. |
| 15 | +That's hard, csscss is easy. Let it tell you what is redundant. |
10 | 16 |
|
11 | | -(Soon) Install it as: |
| 17 | +## How do I use it? ## |
| 18 | + |
| 19 | +First you need to install it. It is currently packaged as a ruby gem: |
12 | 20 |
|
13 | 21 | $ gem install csscss |
14 | 22 |
|
15 | | -## Usage |
| 23 | +Then you can run it in at the command line against CSS files. |
| 24 | + |
| 25 | + $ csscss path/to/styles.css path/to/other-styles.css |
| 26 | + |
| 27 | +Run it in a verbose mode to see all the duplicated styles. |
| 28 | + |
| 29 | + $ csscss -v path/to/styles.css |
| 30 | + |
| 31 | +You can also choose a minimum number of matches, which will ignore any |
| 32 | +rulesets that have fewer matches. |
| 33 | + |
| 34 | + $ csscss -n 10 -v path/to/style.css # ignores rulesets with < 10 matches |
| 35 | + |
| 36 | +## I found bugs ## |
| 37 | + |
| 38 | +This is still a new and evolving project. I heartily welcome feedback. |
| 39 | +If you find any issues, please report them on |
| 40 | +[github](https://github.com/zmoazeni/csscss/issues). |
| 41 | + |
| 42 | +Please include the smallest CSS snippet to describe the issue and the |
| 43 | +output you expect to see. |
| 44 | + |
| 45 | +## Who are you? ## |
| 46 | + |
| 47 | +My name is [Zach Moazeni](https://twitter.com/zmoazeni). I work for [an |
| 48 | +awesome company](http://www.getharvest.com/), which [is |
| 49 | +hiring!](http://www.getharvest.com/careers). |
16 | 50 |
|
17 | | -TODO: Write usage instructions here |
| 51 | +## I'm a dev, I can help ## |
18 | 52 |
|
19 | | -## Contributing |
| 53 | +Awesome! Thanks! Here are the steps I ask: |
20 | 54 |
|
21 | 55 | 1. Fork it |
22 | 56 | 2. Create your feature branch (`git checkout -b my-new-feature`) |
23 | 57 | 3. Commit your changes (`git commit -am 'Add some feature'`) |
| 58 | +4. Make sure the tests pass (`bundle exec rake test`) |
24 | 59 | 4. Push to the branch (`git push origin my-new-feature`) |
25 | 60 | 5. Create new Pull Request |
0 commit comments