Created
December 8, 2011 13:01
-
-
Save craigmdennis/1446936 to your computer and use it in GitHub Desktop.
Simple LESS Grid Calculator
This file contains hidden or 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
| #grid { | |
| /* Consult http://gridulator.com for viable grids */ | |
| @totalColumns: 12; | |
| @siteWidth: 960px; | |
| @margin: 10px; | |
| .container() { | |
| margin-left: auto; | |
| margin-right: auto; | |
| width: @siteWidth; | |
| } | |
| .columns(@columnNumber, @float:left) { | |
| display: inline; | |
| float: @float; | |
| margin-left: @margin / 2; | |
| margin-right: @margin / 2; | |
| width: ((@siteWidth / @totalColumns) * @columnNumber) - @margin; | |
| .clearfix(); | |
| } | |
| } | |
| .container { | |
| #grid > .container(); | |
| } | |
| .content { | |
| #grid > .columns(8); | |
| } | |
| .sidebar { | |
| #grid > .columns(4); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment