Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compass Transform Mixin

I have the following CSS:

.progress-bar {
  transform: rotate(0deg) scale(1) skew(-50deg) translate(2px);
  -webkit-transform: rotate(0deg) scale(1) skew(-50deg) translate(2px);
  -moz-transform: rotate(0deg) scale(1) skew(-50deg) translate(2px);
  -o-transform: rotate(0deg) scale(1) skew(-50deg) translate(2px);
  -ms-transform: rotate(0deg) scale(1) skew(-50deg) translate(2px);
}

...and would like to refactor this with the Compass Transform mixin.

There are no examples in the documentation, so I tried this as a shot in the dark:

.progress-bar {
  @include transform (0deg, 1, -50deg, 2px);
}

...and get this error:

Syntax error: Mixin transform takes 2 arguments but 4 were passed.

Is there a way to do this with Compass Transform?

like image 713
Ryan Avatar asked Dec 17 '13 17:12

Ryan


2 Answers

You have to specify what transforms to use, separated by spaces. eg:

@include transform(rotate(-135deg) skew(-10deg, -10deg));
like image 171
RhinoWalrus Avatar answered Nov 16 '22 13:11

RhinoWalrus


I believe it should be space separated list of transforms rather than comma-separated.

.progress-bar {
  @include transform (rotate(0deg) scale(1) skew(-50deg) translate(2px));
}
like image 41
jayarjo Avatar answered Nov 16 '22 13:11

jayarjo