Question

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.

Was it helpful?

Solution

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top