Skip to content
Browse files

Initial commit.

  • Loading branch information...
0 parents commit afe6fcf74e414f17f86556c8b868a1ecc0d65b05 @johnyanarella johnyanarella committed Feb 26, 2011
Showing with 119 additions and 0 deletions.
  1. 0 README
  2. +119 −0 grid.less
0 README
No changes.
119 grid.less
@@ -0,0 +1,119 @@
+////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2011 CodeCatalyst, LLC - http://www.codecatalyst.com/
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////
+// Grid.less
+//
+// A grid system implemented as less.js (http://lesscss.org/) mixins to promote
+// the definition of semantic, rather than grid-system specific, CSS classes.
+//
+// Based on the 960 Grid System (http://960.gs) by Nathan Smith (http://sonspring.com/).
+// Based on similar implementation by Mark McConachie (http://www.markmcconachie.com/).
+//
+// @author John Yanarella (http://www.codecatalyst.com/)
+// @version 1.0
+////////////////////////////////////////////////////////////////////////////////
+
+/* Grid.less 1.0 */
+
+#grid {
+
+ // ========================================
+ // Configuration
+ // ========================================
+
+ @column-count: 12;
+ @column-width: 60px;
+ @gutter-width: 20px;
+
+ // ========================================
+ // Precalculated constants
+ // ========================================
+
+ @page-width: (@column-count * @column-width) + (@column-count * @gutter-width);
+
+ @margin-left: @gutter-width / 2;
+ @margin-right: @gutter-width / 2;
+
+ // ========================================
+ // Mixins
+ // ========================================
+
+ .body() {
+ min-width: @page-width;
+ }
+
+ .container() {
+ margin-left: auto;
+ margin-right: auto;
+ width: @page-width;
+ }
+
+ .grid(@grid-index: 1)
+ {
+ display: inline;
+ float: left;
+ width: (@page-width / @column-count) * @grid-index - @gutter-width;
+ margin-left: @margin-left;
+ margin-right: @margin-right;
+ }
+
+ .prefix(@prefix-count: 1) {
+ padding-left: (@page-width / @column-count) * @prefix-count;
+ }
+
+ .suffix(@suffix-count: 1) {
+ padding-right: (@page-width / @column-count) * @suffix-count;
+ }
+
+ .push(@push-count: 1) {
+ position: relative;
+ left: (@page-width / @column-count) * @push-count;
+ }
+
+ .pull(@pull-count: 1) {
+ .push(0 - @pull-count);
+ }
+
+ .alpha() {
+ margin-left: 0;
+ }
+
+ .omega() {
+ margin-right: 0;
+ }
+
+ .clearfix() {
+ &:after {
+ content: '\0020';
+ clear: both;
+ display: block;
+ overflow: hidden;
+ width: 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+ visibility: hidden;
+ zoom: 1;
+ }
+ }
+}

0 comments on commit afe6fcf

Please sign in to comment.
Something went wrong with that request. Please try again.