Skip to content

Instantly share code, notes, and snippets.

@tj
Created February 22, 2011 14:26
Show Gist options
  • Save tj/838736 to your computer and use it in GitHub Desktop.
Save tj/838736 to your computer and use it in GitHub Desktop.
custom properties with Stylus
fix-to(pos...)
position fixed
if length(pos) == 2
{pos[0]} 0
{pos[1]} 0
else if length(pos) == 4
a = pos[0..1]
b = pos[2..3]
{a[0]} a[1]
{b[0]} b[1]
else
error('invalid arguments. fix-to: <pos> [n] <pos> [n];')
a#login
fix-to bottom right
a#login
fix-to top 5px left 5px
a#login {
position: fixed;
bottom: 0;
right: 0;
}
a#login {
position: fixed;
top: 5px;
left: 5px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment