Skip to content

Instantly share code, notes, and snippets.

@bchhun
Created June 2, 2011 13:58
Show Gist options
  • Save bchhun/1004490 to your computer and use it in GitHub Desktop.
Save bchhun/1004490 to your computer and use it in GitHub Desktop.
lessCSS love
/* LessCSS Variables */
@padding-left: 10px;
@padding-right: 15px;
@padding-top:48px;
@padding-bottom:11px;
@width: 328px;
@height: 113px;
/* the magic happens here */
a {
background-color: red;
display: block;
padding: @padding-top @padding-right @padding-bottom @padding-left;
/* recalculating the width/height depending on the padding */
width: @width - @padding-left - @padding-right;
height: @height - @padding-top - @padding-bottom;
}
@bchhun
Copy link
Author

bchhun commented Jun 2, 2011

I know I could've also made a function to calculate the width/height. :)

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