Last active
March 7, 2023 23:38
-
-
Save barryvdh/2834636 to your computer and use it in GitHub Desktop.
custom grid
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
/* ===== Primary Styles ===================================================== | |
Author: Fruitcake Studio (Barry vd. Heuvel) | |
========================================================================== */ | |
//Generate a custom (semantic) grid | |
.customGrid(@gridColumnWidth, @gridGutterWidth){ | |
#header, #main { | |
.row(); | |
} | |
.block { | |
.span(3); | |
} | |
#content{ | |
.span(9); | |
} | |
footer { | |
#copyright { | |
.span(12); | |
} | |
} | |
.thumbnails > li { | |
.span(3); | |
} | |
/* ===== Custom grid mixins ================================================= | |
Do not change this mixin below this line! | |
========================================================================== */ | |
.row() when( isnumber(@gridColumnWidth) ) { | |
margin-left: @gridGutterWidth * -1; | |
.clearfix(); | |
} | |
.row() when(@gridColumnWidth = auto){ | |
margin-left: 0; | |
} | |
.span(@columns: 1, @offset: 0) when( isnumber(@gridColumnWidth) ) { | |
float: left; | |
margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2); | |
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); | |
min-height: 1px; // prevent collapsing columns | |
} | |
.span (@columns, @offset: 0) when(@gridColumnWidth = auto){ | |
float: none; | |
display: block; | |
width: 100%; | |
margin-left: 0; | |
.box-sizing(border-box); | |
} | |
} | |
// Custom grid (default size) | |
.customGrid(@gridColumnWidth, @gridGutterWidth); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Left out the two troublesome lines… sorry about that:
.customGrid(@gridColumnWidth768, @gridGutterWidth768);
and
.customGrid(@gridColumnWidth1200, @gridGutterWidth1200);