Skip to content

Commit

Permalink
Update transform module
Browse files Browse the repository at this point in the history
  • Loading branch information
mirisuzanne committed Mar 6, 2013
1 parent 625c0d3 commit 8577a28
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 606 deletions.
7 changes: 7 additions & 0 deletions doc-src/content/CHANGELOG.markdown
Expand Up @@ -17,6 +17,13 @@ The Documentation for the [latest preview release](http://beta.compass-style.org
-------------------------

* [CSS3] All browser-support functions and mixins use same `-moz, -webkit, -ms, -o, -khtml, official` order. This is a change to `experimental()`, `experimental-only-for()`, and `experimental-value()`, which had `-o` listed before `-ms`.
* [CSS3] Updated `transform` module browser-support matrix.
* [CSS3] Remove `legacy-transform` module. Please use the current `transform` module.
* [CSS3] Remove `$only3d` argument from all `$transform` mixins. We switch to 3d-only support in the few cases we can test for, but it's not enough different for the toggle to be useful as a feature-support check. Use modernizr instead.
* [CSS3] Deprecate `transform2d` in favor of `transform`.
* [CSS3] Combine `$default-origin-` variables into single `$default-origin` variable.
* [CSS3] `transform-origin` now takes a single space-sperated argument, using the official w3c syntax.
* [CSS3] Deprecate `apply-origin` in favor of `transform-origin`.

0.13.alpha.2 (02/07/2012)
-------------------------
Expand Down
88 changes: 2 additions & 86 deletions frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss
@@ -1,87 +1,3 @@
@import "shared";
// 404 Not Found.

@warn "This version of the transform module has been deprecated and will be removed.";

// CSS Transform and Transform-Origin

// Apply a transform sent as a complete string.

@mixin apply-transform($transform) {
@include experimental(transform, $transform,
-moz, -webkit, not -ms, -o, not -khtml, official
);
}

// Apply a transform-origin sent as a complete string.

@mixin apply-origin($origin) {
@include experimental(transform-origin, $origin,
-moz, -webkit, not -ms, -o, not -khtml, official
);
}

// transform-origin requires x and y coordinates
//
// * only applies the coordinates if they are there so that it can be called by scale, rotate and skew safely

@mixin transform-origin($originx: 50%, $originy: 50%) {
@if $originx or $originy {
@if $originy {
@include apply-origin($originx or 50% $originy);
} @else {
@include apply-origin($originx);
}
}
}

// A full transform mixin with everything you could want
//
// * including origin adjustments if you want them
// * scale, rotate and skew require units of degrees(deg)
// * scale takes a multiplier, rotate and skew take degrees

@mixin transform(
$scale: 1,
$rotate: 0deg,
$transx: 0,
$transy: 0,
$skewx: 0deg,
$skewy: 0deg,
$originx: false,
$originy: false
) {
$transform : scale($scale) rotate($rotate) translate($transx, $transy) skew($skewx, $skewy);
@include apply-transform($transform);
@include transform-origin($originx, $originy);
}

// Transform Partials
//
// These work well on their own, but they don't add to each other, they override.
// Use them with extra origin args, or along side +transform-origin

// Adjust only the scale, with optional origin coordinates

@mixin scale($scale: 1.25, $originx: false, $originy: false) {
@include apply-transform(scale($scale));
@include transform-origin($originx, $originy);
}

// Adjust only the rotation, with optional origin coordinates

@mixin rotate($rotate: 45deg, $originx: false, $originy: false) {
@include apply-transform(rotate($rotate));
@include transform-origin($originx, $originy);
}

// Adjust only the translation

@mixin translate($transx: 0, $transy: 0) {
@include apply-transform(translate($transx, $transy));
}

// Adjust only the skew, with optional origin coordinates
@mixin skew($skewx: 0deg, $skewy: 0deg, $originx: false, $originy: false) {
@include apply-transform(skew($skewx, $skewy));
@include transform-origin($originx, $originy);
}
@warn "Transform-legacy has been removed. Please import the main transform module instead.";

0 comments on commit 8577a28

Please sign in to comment.