Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update README.md

  • Loading branch information...
commit 42afc0d0ec40f7a124fddaa608b6e2c925422652 1 parent a57b412
ven vendethiel authored
Showing with 57 additions and 51 deletions.
  1. +57 −51 README.md
108 README.md
View
@@ -8,65 +8,71 @@ install: `npm install ccss`
main.coffee:
- ccss = require 'ccss'
+```coffee
+ccss = require 'ccss'
- template = require './template.coffee'
- css = ccss.compile template
- require('fs').writeFileSync 'main.css', css
+template = require './template.coffee'
+css = ccss.compile template
+require('fs').writeFileSync 'main.css', css
- #or all at once: ccss.compileFile './template.coffee', 'main.css'
+#or all at once: ccss.compileFile './template.coffee', 'main.css'
+```
template.coffee:
- borderRadius = (str) ->
- WebkitBorderRadius: str
- MozBorderRadius: str
- borderRadius: str
-
- boxShadow = (str) ->
- WebkitBoxShadow: str
- MozBoxShadow: str
- boxShadow: str
-
- module.exports =
- form:
- input:
- padding: '5px'
- border: '1px solid'
- mixins: borderRadius '5px'
- '#id .className': do ->
- opaque = 1
- translucent = opaque / 2
- img:
- mixins: [
- borderRadius '5px'
- boxShadow '5px'
- ]
- opacity: translucent
- 'img:hover':
- opacity: opaque
+```coffee
+borderRadius = (str) ->
+ WebkitBorderRadius: str
+ MozBorderRadius: str
+ borderRadius: str
+
+boxShadow = (str) ->
+ WebkitBoxShadow: str
+ MozBoxShadow: str
+ boxShadow: str
+
+module.exports =
+ form:
+ input:
+ padding: '5px'
+ border: '1px solid'
+ mixins: borderRadius '5px'
+ '#id .className': do ->
+ opaque = 1
+ translucent = opaque / 2
+ img:
+ mixins: [
+ borderRadius '5px'
+ boxShadow '5px'
+ ]
+ opacity: translucent
+ 'img:hover':
+ opacity: opaque
+```
main.css:
- form input {
- padding: 5px;
- border: 1px solid;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- }
- #id .className img {
- opacity: 0.5;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- -webkit-box-shadow: 5px;
- -moz-box-shadow: 5px;
- box-shadow: 5px;
- }
- #id .className img:hover {
- opacity: 1;
- }
+```css
+form input {
+ padding: 5px;
+ border: 1px solid;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+#id .className img {
+ opacity: 0.5;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ -webkit-box-shadow: 5px;
+ -moz-box-shadow: 5px;
+ box-shadow: 5px;
+}
+#id .className img:hover {
+ opacity: 1;
+}
+```
the core of the compiler is simply this:
Please sign in to comment.
Something went wrong with that request. Please try again.