Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document the compression behaviors in the readme.

  • Loading branch information...
commit 0e8fa5e86b50a30145ba6a0f7b58b374e9c78c4f 1 parent c18bc34
@rstacruz authored
Showing with 36 additions and 10 deletions.
  1. +28 −10 README.md
  2. +8 −0 TODO.md
View
38 README.md
@@ -50,24 +50,42 @@ Some identifiers, like pixel values or colors, can be trimmed to save on space.
``` css
div { color: #ff0000; }
-span { margin: 0px !important; }
+span { margin: 1px !important; }
h1 { background: none; }
a { padding: 0.30em; }
-p { font-family: "Lucida Grande", sans-serif; }
+p { font-family: "Arial Black", sans-serif; }
abbr { background: url("tile.jpg"); }
-ul { padding: 30px 30px 30px 30px; }
```
Can be: (newlines added for readability)
``` css
-div{color:#f00}
-span{margin:0!important}
-h1{background:0}
-a{padding:.3em}
-p{font-family: Lucida Grande,sans-serif}
-abbr{background:url(tile.jpg)}
-ul{padding:30px}
+div{color:#f00} /* Collapsing 6-digit hex colors to 3 */
+span{margin:1px!important} /* Strip space before !important */
+h1{background:0} /* Change border/background/outline 'none' to '0' */
+a{padding:.3em} /* Removing trailing zeroes from numbers */
+p{font-family: Arial Black,sans-serif} /* Font family unquoting */
+abbr{background:url(tile.jpg)} /* URL unquoting */
+```
+
+#### More compressions
+
+``` css
+ul { padding: 30px 30px 30px 30px; }
+li { margin: 0 auto 0 auto; }
+.zero { outline: 0px; }
+a + .b { color: blue; }
+.color { background: rgb(51,51,51); }
+```
+
+Output:
+
+``` css
+ul{padding:30px} /* Collapsing border/padding values */
+li{margin:0 auto} /* Same as above */,
+.zero{outline:0} /* Removing units from zeros */
+a+.b{color:blue} /* Collapse + and > in selectors */
+.color{background:#333} /* Converting rgb() values to hex */
```
#### Selector/declaration sorting
View
8 TODO.md
@@ -3,4 +3,12 @@ Todo
* Remove duplicate keyframes
* Remove duplicate font faces
+ * `[type="submit"]` to `[type=submit]`
+ * `black` to `#000`
+ * `#f00` to `red`, `#d2b48c` to `tan`
+ * `*.foo` to `.foo`
+
+ '#f00': 'red'
+ '#d2b48c': 'tan'
+ '#fffafa': 'snow'
Please sign in to comment.
Something went wrong with that request. Please try again.