Permalink
Browse files

better readme

  • Loading branch information...
1 parent e1b76fd commit fa096eda06efda9d0f1ca2d9a857c62d5485314f @chjj committed Nov 28, 2011
Showing with 94 additions and 20 deletions.
  1. +94 −20 README.md
View
114 README.md
@@ -1,20 +1,94 @@
-# csslike
-
-__csslike__ is a CSS preprocessor designed to follow the latest www-style
-proposals from Tab Atkins for CSS variables, mixins, and nested rules (a lot of
-which appears to be based on LESS and SASS' curly brace syntax, but with some
-differences).
-
-It's a work in progress. I wanted to make sure the lexer was extremely robust
-for forward compatibility, in case there are anymore additions. So, the lexer
-is pretty verbose, it wasn't built for speed, but it will tokenize anything,
-nothing is hardcoded.
-
-It also includes some small features like auto-base64'ing images, pretty
-printing, minifying, as well as imported stylesheets, but for the most part, I
-want to keep it in line with potential standards.
-
-## License
-
-Copyright (c) 2011, Christopher Jeffrey. (MIT Licensed)
-See LICENSE for more info.
+# csslike
+
+__csslike__ is a CSS preprocessor designed to follow the latest www-style
+[proposals from Tab Atkins][tab] for CSS [variables][vars], [mixins][mixins],
+and [nested rules][nest] (a lot of which appears to be based on LESS and SASS'
+curly brace syntax, but with some differences).
+
+It's a work in progress. I wanted to make sure the lexer was extremely robust
+for forward compatibility, in case there are anymore additions. So, the lexer
+is pretty verbose, it wasn't built for speed, but it will tokenize anything,
+nothing is hardcoded.
+
+It also includes some small features like auto-base64'ing images, pretty
+printing, minifying, as well as imported stylesheets, but for the most part, I
+want to keep it in line with potential standards.
+
+[tab]: http://www.xanthir.com/blog/b49w0
+[vars]: http://lists.w3.org/Archives/Public/www-style/2011Feb/0311.html
+[mixins]: http://lists.w3.org/Archives/Public/www-style/2011Mar/0478.html
+[nest]: http://lists.w3.org/Archives/Public/www-style/2011Jun/0022.html
+
+[var-draft]: http://lists.w3.org/Archives/Public/www-style/2011Jun/0329.html
+
+## Syntax
+
+``` css
+@var $green #00ff00
+
+@trait bg {
+ background: $green;
+}
+
+@trait content($t) {
+ content: $t;
+}
+
+article {
+ color: black;
+ & > header {
+ border: 1px solid;
+ & > h1 {
+ background: orange;
+ }
+ }
+ @mixin bg;
+ @mixin content("hello world");
+}
+```
+
+output:
+
+``` css
+article {
+ color: black;
+ background: #00ff00;
+ content: "hello world";
+}
+ article > header {
+ border: 1px solid;
+ }
+ article > header > h1 {
+ background: orange;
+ }
+```
+
+## Middleware Usage
+
+``` js
+app.use(
+ csslike.handle({
+ dir: __dirname,
+ minify: true,
+ cache: true
+ })
+});
+```
+
+or for a specific file:
+
+``` js
+app.use('/my_stylesheet',
+ csslike.handle({
+ file: __dirname + '/static/style.css',
+ dir: __dirname,
+ minify: true,
+ cache: true
+ })
+});
+```
+
+## License
+
+Copyright (c) 2011, Christopher Jeffrey. (MIT Licensed)
+See LICENSE for more info.

0 comments on commit fa096ed

Please sign in to comment.