Created
June 2, 2011 13:58
-
-
Save bchhun/1004490 to your computer and use it in GitHub Desktop.
lessCSS love
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know I could've also made a function to calculate the width/height. :)