From f1a6e280c18b2c32913f610cc6c1312747626d8a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 20 Nov 2010 20:34:35 -0800 Subject: [PATCH] Some adjustments to the PIE module from Jason's code review. --- .../compass/stylesheets/compass/css3/_pie.scss | 14 +++++++++++--- frameworks/compass/templates/pie/pie.scss | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_pie.scss b/frameworks/compass/stylesheets/compass/css3/_pie.scss index b2c6f6ae..40516545 100644 --- a/frameworks/compass/stylesheets/compass/css3/_pie.scss +++ b/frameworks/compass/stylesheets/compass/css3/_pie.scss @@ -11,6 +11,7 @@ $pie-base-class: false !default; // // * relative (default) // * z-index +// * none $pie-default-approach: relative !default; // The location of your PIE behavior file @@ -24,8 +25,12 @@ $pie-behavior: stylesheet-url("PIE.htc") !default; // or before the container's opaque background // should have a z-index set as well to ensure // propert z-index stacking. -@mixin pie-container($z-index: 0) { +// +// The `$position` argument must be some non-static +// value (absolute, relative, etc.) +@mixin pie-container($z-index: 0, $position: relative) { z-index: $z-index; + position: $position; } // PIE elements must have this behavior attached to them. @@ -33,10 +38,13 @@ $pie-behavior: stylesheet-url("PIE.htc") !default; // relative to the stylesheet. It considers them relative // to the webpage. As a result, you cannot reliably use // compass's relative_assets with PIE. +// +// * `$approach` - one of: relative, z-index, or none +// * `$z-index` - when using the z-index approach, this +// is the z-index that is applied. @mixin pie-element( $approach: $pie-default-approach, - $z-index: if($approach == z-index, 0), - $behavior : $pie-behavior + $z-index: 0 ) { behavior: $behavior; @if $approach == relative { diff --git a/frameworks/compass/templates/pie/pie.scss b/frameworks/compass/templates/pie/pie.scss index 7a1fe0d2..1ec82717 100644 --- a/frameworks/compass/templates/pie/pie.scss +++ b/frameworks/compass/templates/pie/pie.scss @@ -58,8 +58,9 @@ $pie-base-class: pie-element; @include pie-element(z-index); } +// This is just a simple example of how to use the z-index approach. .widget { - @extend .pie-container; // This will + @extend .pie-container; h3 { @include pie(z-pie-element); // This will extend .z-pie-element instead of .pie-element }