{"issue":{"pull_request":{"diff_url":"https://github.com/jverkoey/nimbus/pull/106.diff","html_url":"https://github.com/jverkoey/nimbus/pull/106","patch_url":"https://github.com/jverkoey/nimbus/pull/106.patch"},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/fc1038c8a378ba3816041b7ce9776323?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fc1038c8a378ba3816041b7ce9776323","url":"https://api.github.com/users/dbarden","login":"dbarden","id":104456},"milestone":null,"labels":[],"assignee":null,"updated_at":"2011-11-08T21:38:47Z","comments":9,"closed_at":null,"url":"https://api.github.com/repos/jverkoey/nimbus/issues/106","body":"Here is a first version for your review :)\r\n\r\nThese patches enable a user to describe the CSS Stylesheets using the [Stylus](http://learnboost.github.com/stylus/) format.\r\n\r\nThe Chameleon server was modified to handle the request for any file with an extension '.styl' as a Stylus stylesheet. It will compile the CSS and return the request with the CSS in the standard format, one that can be parsed by Nimbus.\r\n\r\nThere are some tricks to make it work, since the Stylus format is not parsed by Nimbus:\r\n* The user must have the Chameleon server running, or else he won't be able to perform the format translation;\r\n* When initializing the NIStyleSheet, it must be initialized with `loadFromDisk:NO`. Or else Nimbus will try to parse the Stylus format and will break;\r\n* After initializing the NIStyleSheet, the user must fetch the stylesheet from the server. It should be used to avoid not having the stylesheet in a first moment and be dependent on the file modification for Nimbus to load the stylesheet. Due to this reason I modified the file `src/css/src/NIChameleonObserver.h` to expose the method `(void)downloadStylesheetWithFilename:(NSString *)path`\r\n\r\nBasically, the initialization must be done as (the complete example can be seen in `examples/css/StylusDemo/StylusDemo/ViewController.m`):\r\n\r\n    NIStylesheet* stylesheet = [stylesheetCache stylesheetWithPath:@\"root/root.styl\" loadFromDisk:NO];\r\n    _dom = [[NIDOM alloc] initWithStylesheet:stylesheet];\r\n    NIChameleonObserver *chameleon = [(AppDelegate *)[UIApplication sharedApplication].delegate chameleonObserver];\r\n    [chameleon downloadStylesheetWithFilename:@\"root/root.styl\"];\r\n\r\nPlease let me know your thoughts. This implementation was the result of some tests that I did, but I hope that it can lead to something cool :)","html_url":"https://github.com/jverkoey/nimbus/issues/106","number":106,"title":"CSS Stylesheets in Stylus notation","id":2128673,"created_at":"2011-11-03T01:52:12Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/fc1038c8a378ba3816041b7ce9776323?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fc1038c8a378ba3816041b7ce9776323","url":"https://api.github.com/users/dbarden","login":"dbarden","id":104456},"updated_at":"2011-11-08T21:38:47Z","url":"https://api.github.com/repos/jverkoey/nimbus/issues/comments/2674000","body":"I'm almost certain that is likely to be completely possible.\r\n\r\nThe CSS extensions comes with a bin file, that is a node script (https://github.com/LearnBoost/stylus/blob/master/bin/stylus, for example). Having this in mind, maybe we can reuse some functions used in the Chameleon to create this script.\r\n\r\nI'm checking how the 'run script' phase works, how the user would specify the input directory and output directory, etc. I'll try to do it as simple as I can.\r\n\r\nThe only external dependency would be node.js and the respective packages.\r\n\r\nI don't know how it could be done right now, but I'll figure it out.","id":2674000,"created_at":"2011-11-08T21:38:47Z"}}