Skip to content

Instantly share code, notes, and snippets.

@zamoose
Created November 26, 2012 20:59
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 zamoose/4150576 to your computer and use it in GitHub Desktop.
Save zamoose/4150576 to your computer and use it in GitHub Desktop.
LESS
/*
New and improved solution, available in a master LESS file for use anywhere.
*/
.setwidth(@width, @defaultw) when (isnumber(@width)){
width: @width;
}
.setwidth(@width, @defaultw) when not(isnumber(@width)){
width: @defaultw;
}
/*
Then, the layout stylesheet.
*/
#container{.setwidth(@containerwidth, 960px);margin:0 auto;}
#primarysb{.setwidth(@primarysbwidth, 350px);float:left;}
#secondarysb{.setwidth(@secondarysbwidth, 350px);float:right;}
#footer{.setwidth(@footerwidth, 100%);clear:both;}
@noeltock
Copy link

Nice one :)

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