From 941e79d9ce696a071f25aa33c08a667f17006ced Mon Sep 17 00:00:00 2001 From: Grady Kuhnline Date: Sun, 22 Apr 2012 16:23:35 -0800 Subject: [PATCH] Removing the enhanced precision and relying on the defualt Sass precision of 3. Seems to fix some issues in Firefox and Chrome. --- lib/compass-grid.rb | 2 +- stylesheets/grid/_fluid.scss | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/compass-grid.rb b/lib/compass-grid.rb index ecdeddd..14d6d28 100644 --- a/lib/compass-grid.rb +++ b/lib/compass-grid.rb @@ -2,4 +2,4 @@ require 'compass/grid' # Ensure maximum useful precision -Sass::Script::Number.precision = 8 \ No newline at end of file +# Sass::Script::Number.precision = 8 \ No newline at end of file diff --git a/stylesheets/grid/_fluid.scss b/stylesheets/grid/_fluid.scss index 4111835..d76a782 100644 --- a/stylesheets/grid/_fluid.scss +++ b/stylesheets/grid/_fluid.scss @@ -17,16 +17,21 @@ width: fluid-column-width($i, $plus, $parent, $parent-plus); } -// return a percentage width relative to columns +// return a percentage width relative to a column width @function fluid-column-width($i, $plus: 0, $parent: $grid-columns, $parent-plus: 0) { - @return percentage(grid-column-width($i, $plus) / grid-column-width($parent, $parent-plus + $grid-gutter-width)); + @return fluid-width(grid-column-width($i, $plus), grid-column-width($parent, $parent-plus + $grid-gutter-width)); } -// return a percentage width relative to lengths +// return a percentage width relative to a parent width @function fluid-width($width, $parent-width: grid-column-width($grid-columns, $grid-gutter-width)) { @return percentage($width / $parent-width); } +// return a percentage for a half-pixel +@function fluid-nudge($parent-width: grid-column-width($grid-columns, $grid-gutter-width), $vendor: webkit) { + @return percentage(if($vendor == ie, -0.5px, 0.5px) / $parent-width); +} + //----------------------------------- // Containers