I'm creating a mixin that will allow me to do prefix free styles for transform: rotate(45deg). The problem is that I have no idea how to do it in proper Stylus syntax. Here's what I have so far:

transform-rotate()
    -webkit-transform: rotate(arguments)
    -moz-transform: rotate(arguments)
    -o-transform: rotate(arguments)
    -ms-transform: rotate(arguments)
    transform: rotate(arguments)

And then I would like to call it in my .styl sheet using the following:

transform-rotate(45deg)

But when I do that, I get the following error:

Cannot call method 'map' of undefined

I think the problem is that Stylus is trying to treat the native CSS3 rotate() mixin as a custom mixin, and when it tries, it can't find the implementation of rotate(). I'm not entirely sure, but that's my initial thought.

How do I write this out so that it'll compile properly? Any ideas would be greatly appreciated. Thanks in advance.

有帮助吗?

解决方案

You don't need parentheses with Stylus, problem solved !

transform-rotate
    -webkit-transform rotate arguments
    -moz-transform rotate arguments
    -o-transform rotate arguments
    -ms-transform rotate arguments
    transform rotate arguments

And I'd advise you to use Nib, a stylus plug-in that handles browser prefixing : http://visionmedia.github.io/nib/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top