Skip to content

Instantly share code, notes, and snippets.

@irae
Created March 24, 2011 19:17
Show Gist options
  • Save irae/885661 to your computer and use it in GitHub Desktop.
Save irae/885661 to your computer and use it in GitHub Desktop.
Idea for CSS Compiler
/* My wish for a new CSS parser/compiler */
/* input */
@define avatar-float {
variable:$direction;
float:$direction;
margin-$direction:5px;
padding:5px;
}
#conversation
.from-me {avatar-float:left;background:#ffd;}
.from-friend {avatar-float:right;background:#fdf;}
/* output */
#conversation .from-me {float:left;margin-left:5px;padding:5px;background:#ffd;}
#conversation .from-friend {float:right;margin-right:5px;padding:5px;background:#fdf;}
@irae
Copy link
Author

irae commented Mar 24, 2011

Also, sprites could be done inline with output defined with css sintax:
background:url('/images/assets/h-feed.png') sprite('/images/production/icons.png') no-repeat 0 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment