Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
aeosynth committed Feb 6, 2011
1 parent b6a5f96 commit 3033d62
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ccss.coffee
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,14 @@
@compile = (ccss) -> @compile = (rules) ->
css = '' css = ''


for selector, pairs of ccss for selector, pairs of rules
# a pair can be a css declaration, or a pair of the child ccss object # a pair is either a css declaration, or a nested rule
child = {}
declarations = '' declarations = ''
nested = {}


for key, value of pairs for key, value of pairs
if typeof value is 'object' if typeof value is 'object'
child["#{selector} #{key}"] = value nested["#{selector} #{key}"] = value
else else
#borderRadius -> border-radius #borderRadius -> border-radius
key = key.replace /[A-Z]/g, (s) -> '-' + s.toLowerCase() key = key.replace /[A-Z]/g, (s) -> '-' + s.toLowerCase()
Expand All @@ -20,6 +20,6 @@
css += declarations css += declarations
css += '}\n' css += '}\n'


css += @compile child css += @compile nested


css css

0 comments on commit 3033d62

Please sign in to comment.