Skip to content

Instantly share code, notes, and snippets.

@bbttxu
Forked from chriseppstein/gist:471826
Created July 12, 2010 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbttxu/472433 to your computer and use it in GitHub Desktop.
Save bbttxu/472433 to your computer and use it in GitHub Desktop.
@import 'blueprint/grid'
/*
requires compass gem
usage: compass compile path/to/grid.sass -e production --output-style nested
//
defines Blueprint grid variables
$blueprint-grid-columns: 24
$blueprint-grid-width: 30px
$blueprint-grid-margin: 10px
$blueprint-grid-outer-width: $blueprint-grid-width + $blueprint-grid-margin
$blueprint-container-size: $blueprint-grid-outer-width * $blueprint-grid-columns - $blueprint-grid-margin
//
defines column widths for #left, #right. #main is calculated off these values
$grid-left: 5
$grid-right: 6
=body-columns( $left: 4, $right: 5, $columns: $blueprint-grid-columns )
@if $left > 0
#left
+span( $left )
@if ( ( $left + $right ) < $columns )
#main
+span( $columns - $left - $right )
@if ( $right <= 0 )
@if ( $blueprint-grid-margin > 0px )
+last
@if $right > 0
#right
+span( $right )
@if ( $blueprint-grid-margin > 0px )
+last
body
/*
These class names are used by Drupal to indicate what kind of layout we have
Handles visibility of #left, #right individually plus both hidden or both visible
&.sidebar-left
+body-columns( $grid-left, 0 )
&.sidebar-right
+body-columns( 0, $grid-right )
&.two-sidebars
+body-columns( $grid-left, $grid-right )
&.no-sidebars
+body-columns( 0, 0 )
#left, #main, #right
+column-base
#page
+span( 24 )
margin: 0 auto
+clearfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment