I am well aware of mixins feature of stylus. But the language features available seem to be quite limited.

In sass, you can write a function in ruby and make them available directly to sass. So the full power of ruby language is available to mixin author.

Is there an API available for doing something similar with stylus ?

Some interesting use cases would be mixins which can manipulate colors, generate complex gradients etc.

有帮助吗?

解决方案

You can write a function in JavaScript and make it available in Stylus in much the same way as ruby/sass. See the docs here.

you want the section about .define(name, fn)

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