Skip to content

Instantly share code, notes, and snippets.

@fastner
Created December 20, 2010 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fastner/748328 to your computer and use it in GitHub Desktop.
Save fastner/748328 to your computer and use it in GitHub Desktop.
// This is supposed to be changed without warning. See original gist for a overview.
// Declare a mixin with parameters (clones content and patches values in-place like in Sass @include)
=pos($left, $top)
left: $left
top: $top
// Declare a Mixin (is used like Sass @extend as it has no parameters)
=fancylist
font-weight: bold
translate: skew(3deg)
// Defines a variable
$maincolor = red
body
// Use color variable
background-color: $maincolor
// Add URL to stripes.png from project "unify"
background-image: url(unify/stripes.png)
// Automatically fixes cross-browser support with vendor prefixes
text-shadow: 1px 1px 1px rgba(255,255,255,0.5)
// Assembles names when line ends with a "-" symbol
font-
size: 12px
weight: normal
// Supports children which result in "body #mainsection" in CSS
#mainsection
// Supports various built-in function calls
background-color: brighten(blue, 10%)
// Allows for basic compution of values
left: calc(5em - 9px)
li
// Embeds the mixin "fancylist". Results into a copying the current selector
// into the list of selectors for the styles in "fancylist"
+fancylist
list-style-image: embed(unify/dot.png)
.toolbar
position: absolute
// Calls mixin with parameters. Copy all patched content into this section
+pos(10px, 100px)
// Automatically changes property name as needed for output platform
transform: rotate(30deg)
// Media query like pre-compiler directive. May be filtered out at compile time.
@platform android
bottom: 0px
// Supports cross browser values support as well (without using some ugly mixin call)
background: gradient(darkblue, blue 30%, white)
@platform iphone
top: 0px
background: gradient(black, grey 30%, white)
height: 50px
@version >= 4
// Overwrites the 50px at compile time
height: 60px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment