LearnBoost/stylus — pull request #781 by geddesign (2012-08-07 23:34:21+00:00)
Title: Support for @import of JSON variables

Sharing certain variables across JS and Stylus is crazy awesome. For example, store your media queries in queries.json, and bring them in with Stylus:

```
@import "queries.json"

@media large
.main
width: 100%
```

And use the same variables in your JS:

```js
$.ajax({
url: 'queries.json',
method: 'GET',
dataType: 'JSON',
success: function(queries){
var query = window.matchMedia(queries.large);
handleChange(query); //initial match
query.addListener(handleChange.bind(this, query)); //on query match change
}
});

function handleChange(query){
if(query.matches){
//change img src to use large images
}
}
```

They're really more of constants; changing them in JS won't affect the ones set in Stylus obviously. But still extremely useful (media query breakpoints, CSS transitions, etc).

Added new test, `import.json.styl`, all other tests still passing. If y'all dig it I can update the `import` docs page as well.