Skip to content

Commit

Permalink
Some adjustments to the PIE module from Jason's code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Nov 21, 2010
1 parent a4774bd commit f1a6e28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 11 additions & 3 deletions frameworks/compass/stylesheets/compass/css3/_pie.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,19 +25,26 @@ $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.
// IE is broken -- it doesn't think of behavior urls as
// 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 {
Expand Down
3 changes: 2 additions & 1 deletion frameworks/compass/templates/pie/pie.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f1a6e28

Please sign in to comment.