//** The Susy Grid **// // Updated 11.20.2009 by Eric A. Meyer // Your basic settings for the grid. // Override these in base.sass to customize your site. !total_cols ||= 12 !col_width ||= 4em !gutter_width ||= 1em !side_gutter_width ||= !gutter_width // Susy will set your outer shell based on the variables above. !container_width = container(!total_cols, !col_width, !gutter_width, !side_gutter_width) // Set on the outer grid-containing element(s). =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 // 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). // - Context is required on any nested elements. // - Context MUST NOT be declared on a top-level element. // By default a grid-column is floated left with a right gutter. // - Override those with +float("right"), +alpha or +omega =columns(!n, !context = false) // the column is floated left +float("left") // the width of the column is set as a percentage of the context width= columns(!n, !context) // the right gutter is added as a percentage of the context margin-right= gutter(!context) // Set on any element to add empty colums as padding 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 a shortcut for both 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. Recommended that you pass the // actual nested contexts (when nested) rather than a true/false argument // for the sake of consistency. Effect is the same. =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, !dir = "right", !hack = false) !s = side_gutter() @if !dir == "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% // Sets the direction that +omega elements are floated // - Override !omega_float globally or set +float locally to change !omega_float ||= "right" // Set omega on the last element of a row to take side-gutters // and the page edge into account. Set the !nested argument for nested columns. // It is recommended that you pass the actual nested context when nested, // rather than a true/false argument, for the sake of consistency. Effect is the same. =omega(!nested = false) +float(!omega_float) @if !nested margin-right: 0 @else margin-right= side_gutter() @if !hacks /* ugly hacks for IE6-7 */ +ie-omega(!nested, !omega_float, true) /* 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