Search code examples
sasscompass-sass

How do I use $rotate3d with create-transform?


I'm trying to use $rotate3d inside of a create-transform block (along with scale-x) and nothing I try is working quite right. If I do just rotate3d like this, it works beautifully:

@include rotate3d(1, 0, 0, 3deg, 800);

But I need to combine this with scale and perspective, so create-transform is my only option.

It's the multiple argument thing for $rotate3d that's getting me. I tried this but it didn't work:

@include create-transform(
    $rotate3d: "1, 0, 0, 30deg, 800"
);

Ideas?


Solution

  • Arguments to mixins are separated by commas, so Sass thinks you are trying to send a single value to the $rotate3d argument. What you're actually wanting to do is send a comma delimited list as the value for a single argument. That can be done by adding parentheses around the list:

    @include create-transform($rotate3d: (1, 0, 0, 30deg, 800));