문제

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