Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Nib support for protos #108

Merged
merged 2 commits into from

2 participants

@panos-kosmidis

Added Nib support for stylus compiler in protos.

Canvas feature in Nib is not supported because of a bug in canvas module. Once it is fixed I'll add the support for it.

test results:

root@dev:/usr/local/lib/node_modules/protos# vows --spec test/middleware/asset_compiler.js 

  ♢ Asset Compiler (middleware) 

    ✓ Forbids access to asset sources
    ✓ Successfully compiles LESS assets
    ✓ Successfully compiles Stylus assets
    ✓ Successfully compiles CoffeeScript assets
    ✓ Successfully minifies supported assets
    ✓ Blocks access to minify sources
    ✓ Watches for source file changes (when enabled)
    ✓ Does not compile ignored files
    ✓ LESS @import works as expected
    ✓ Stylus @import works as expected

✓ OK » 10 honored (1.558s)
Panagiotis K... added some commits
Panagiotis Kosmidis added nib support
Added dependencies:
- nib 0.41.1
- canvas 0.12.0

Updated dependencies
- Stylus 0.24.0 -> 0.27.0
62af140
Panagiotis Kosmidis Added tests for nib support
Removed canvas dependency because of bug in canvas module.

Created tests for stylus/nib
4e521c1
@panos-kosmidis

also updated stylus to latest version (0.27.0)

@derdesign derdesign merged commit 0f7d717 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 20, 2012
  1. added nib support

    Panagiotis Kosmidis authored
    Added dependencies:
    - nib 0.41.1
    - canvas 0.12.0
    
    Updated dependencies
    - Stylus 0.24.0 -> 0.27.0
  2. Added tests for nib support

    Panagiotis Kosmidis authored
    Removed canvas dependency because of bug in canvas module.
    
    Created tests for stylus/nib
This page is out of date. Refresh to see the latest.
View
8 middleware/asset_compiler/compilers.js
@@ -3,6 +3,7 @@
var less = require('less'),
stylus = require('stylus'),
+ nib = require('nib'),
coffee = require('coffee-script'),
pathModule = require('path');
@@ -17,7 +18,12 @@ module.exports = {
},
styl: function(source, file, callback) {
- stylus.render(source, {filename: file}, callback);
+ stylus(source)
+ .set('filename', file)
+ .use(nib())
+ .import('nib')
+ .render(callback)
+ ;
},
coffee: function(source, file, callback) {
View
3  package.json
@@ -34,7 +34,8 @@
"underscore.string" : ">= 1.1.6",
"coffee-script" : ">= 1.2.0",
"less" : ">= 1.2.2",
- "stylus" : ">= 0.24.0",
+ "stylus" : ">= 0.27.0",
+ "nib" : ">= 0.4.1",
"socket.io" : ">= 0.8.7",
"hogan.js" : ">= 1.0.2",
"ejs" : ">= 0.6.1",
View
11 test/fixtures/compiled-assets/stylus.txt
@@ -1,10 +1,21 @@
body {
font: 12px Helvetica, Arial, sans-serif;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000));
+ background: -webkit-linear-gradient(top, #fff 0%, #000 100%);
+ background: -moz-linear-gradient(top, #fff 0%, #000 100%);
+ background: -o-linear-gradient(top, #fff 0%, #000 100%);
+ background: -ms-linear-gradient(top, #fff 0%, #000 100%);
+ background: linear-gradient(top, #fff 0%, #000 100%);
}
a.button {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
border-radius: 5px;
+ position: fixed;
+ bottom: 0;
+ right: 0;
}
a.button body {
font: 12px Helvetica, Arial, sans-serif;
View
11 test/fixtures/compiled-assets/stylus2.txt
@@ -1,10 +1,21 @@
body {
font: 12px Helvetica, Arial, sans-serif;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000));
+ background: -webkit-linear-gradient(top, #fff 0%, #000 100%);
+ background: -moz-linear-gradient(top, #fff 0%, #000 100%);
+ background: -o-linear-gradient(top, #fff 0%, #000 100%);
+ background: -ms-linear-gradient(top, #fff 0%, #000 100%);
+ background: linear-gradient(top, #fff 0%, #000 100%);
}
a.button {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
border-radius: 5px;
+ position: fixed;
+ bottom: 0;
+ right: 0;
}
a.button body {
font: 12px Helvetica, Arial, sans-serif;
View
2  test/fixtures/stylus.styl.orig
@@ -1,10 +1,12 @@
body
font: 12px Helvetica, Arial, sans-serif
+ background: linear-gradient(top, white, black);
a.button
-webkit-border-radius: 5px
-moz-border-radius: 5px
border-radius: 5px
+ fixed: bottom right;
border-radius()
-webkit-border-radius arguments
View
2  test/fixtures/test.skeleton/public/assets/stylus.styl
@@ -1,10 +1,12 @@
body
font: 12px Helvetica, Arial, sans-serif
+ background: linear-gradient(top, white, black);
a.button
-webkit-border-radius: 5px
-moz-border-radius: 5px
border-radius: 5px
+ fixed: bottom right;
border-radius()
-webkit-border-radius arguments
Something went wrong with that request. Please try again.