[Blueprint] Split the push and pull mixins into sub-mixins that separate the common styles from the ones that vary.

Added the following mixins:
  +push-base
  +push-margins
  +pull-base
  +pull-margins

The generated css when using presentational class names will be smaller as a result.
This commit is contained in:
Chris Eppstein 2009-04-13 18:51:20 -07:00
parent 5d4a885671
commit 3f16225556

View File

@ -56,12 +56,16 @@
+prepend(!n) +prepend(!n)
// Use these classes on an element to push it into the // Use these classes on an element to push it into the
// next column, or to pull it into the previous column. // next column, or to pull it into the previous column.
#{enumerate(".pull", 1, !blueprint_grid_columns)}
+pull-base
@for !n from 1 through !blueprint_grid_columns @for !n from 1 through !blueprint_grid_columns
.pull-#{!n} .pull-#{!n}
+pull(!n) +pull-margins(!n)
#{enumerate(".push", 1, !blueprint_grid_columns)}
+push-base
@for !n from 1 through !blueprint_grid_columns @for !n from 1 through !blueprint_grid_columns
.push-#{!n} .push-#{!n}
+push(!n) +push-margins(!n)
// Columns // Columns
@ -107,24 +111,32 @@
=prepend(!n) =prepend(!n)
:padding-left = (!blueprint_grid_outer_width) * !n :padding-left = (!blueprint_grid_outer_width) * !n
// mixin to a column to move it n columns to the left =pull-base
=pull(!n, !last = false)
+float-left +float-left
:position relative :position relative
=pull-margins(!n, !last = false)
@if !last @if !last
:margin-left = (-!blueprint_grid_outer_width * !n) + !blueprint_grid_margin :margin-left = (-!blueprint_grid_outer_width * !n) + !blueprint_grid_margin
@else @else
:margin-left = -!blueprint_grid_outer_width * !n :margin-left = -!blueprint_grid_outer_width * !n
// mixin to a column to push it n columns to the right // mixin to a column to move it n columns to the left
=push(!n) =pull(!n, !last = false)
+pull-base
+pull-margins(!n, !last)
=push-base
+float-right +float-right
:position relative :position relative
:margin
:top 0 =push-margins(!n)
:right = -!blueprint_grid_outer_width * !n :margin= 0 (-!blueprint_grid_outer_width * !n) 1.5em (!blueprint_grid_outer_width * !n)
:bottom 1.5em
:left = !blueprint_grid_outer_width * !n // mixin to a column to push it n columns to the right
=push(!n)
+push-base
+push-margins(!n)
// Border on right hand side of a column. // Border on right hand side of a column.
=border =border