//** Grid Settings **// //** Your basic units for the grid !grid_unit ||= "em" !total_cols ||= 16 !col_width ||= 4 !gutter_width ||= 1 !side_gutter_width ||= !gutter_width !container_width = container(!total_cols, !col_width, !gutter_width, !side_gutter_width) //** set on the outer grid containing element. =container(!align = "left") // clear all floated columns +clearfix // align the text back to the left (override for other alignments) :text-align= !align // use auto horizontal margins to center your page in the body :margin :left auto :right auto // set the page width based on column settings :width= !container_width + !grid_unit // never exceed 100% of the browser window (no side-scrolling) :max-width 100% //** set on any column element, even nested ones. the first agument [required] is the number of columns to span the second argument is the context (columns spanned by parent) this is required in any nested context by default a grid-col is floated left with a right gutter override that with +float("right"), +first or +last =columns(!n, !context = false) // the width of the column is set as a percentage of the context :width= columns(!n, !context) + "%" // the column is floated left +float("left") // the right gutter is added as a percentage of the context :margin-right= gutter(!context) + "%" //** set on any column to add empty colums before or after =prefix(!n, !context = false) :padding-left= columns(!n, !context) + gutter(!context) + "%" =suffix(!n, !context = false) :padding-right= columns(!n, !context) + gutter(!context) + "%" //** set as shortcut for prefix and suffix =pad(!p = 0, !s = 0, !c = false) @if !p != 0 +prefix(!p,!c) @if !s != 0 +suffix(!s,!c) //** set on any element spanning the first column in non-nested context to take side-gutters into account =alpha(!nested = false) @if !nested == false :margin-left= side_gutter() + "%" //** when global constant !hacks == true: - this will be called automatically with hacks when global constant !hacks == false: - you can call it yourself in ie.sass without the hacks =ie-omega(!nested = false, !right = false, !hack = false) !s = side_gutter() @if !right @if !hack :#margin-left -1% @else :margin-left -1% @else @if !nested @if !hack :#margin-right -1% @else :margin-right -1% @else @if !hack :#margin-right= !s - 1 + "%" @else :margin-right= !s - 1 + "%" //** set on the last element of a row to take side-gutters into account - set !nested for nested columns - set !float for right-floated omega elements =omega(!nested = false, !right = false) !s = side_gutter() @if !nested :margin-right 0 @else :margin-right= !s + "%" @if !hacks /* ugly hacks for IE6-7 */ +ie-omega(!nested, !right,"*") /* end ugly hacks */ //** set on an element that will span it's entire context - no need for +columns, +alpha or +omega on a +full element =full(!nested = false) :clear both @if !nested == false !s = side_gutter() + "%" margin-right= !s margin-left= !s