LearnBoost/stylus — pull request #1466 by kizu (2014-04-14 15:48:07+00:00)
Title: [WIP] `+cache` mixin

This is a work-in-progress PR for `+cache` bif. It is expected to ship with the next minor release — `0.44.0`.

This PR also adds one new bif — `current-media()` and one new property in function scope — `called-from`. The `current-media()` returns the string for, well, the current `@media`, while `called-from` returns the list of functions the current function has been called from.

### TODO:

- [ ] Add better example on the `+cache` in docs.
- [ ] Fix the stringifying of the `@media`.
- [ ] Fix `current-media()` to work inside block mixins.

### Questions:

- Should we make the `current-media()` a property, like the `called-from`?
- Is it possible to get the length of the block and compare it to the selector, so we could be smarter on when to use `@extend`? We'd need the proper stringify for the `block`, other than the current `[object Object]`. But wouldn't it be slow?