Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add stylus package. #40

Closed
wants to merge 2 commits into from

4 participants

@heikki

No description provided.

@oscardelben oscardelben commented on the diff
packages/stylus/package.js
@@ -0,0 +1,27 @@
+Package.describe({
+ summary: 'Expressive, dynamic, robust CSS.'
+});
+
+var stylus = require('stylus');
+var fs = require('fs');
+
+Package.register_extension(
+ 'styl', function(bundle, source_path, serve_path, where) {

Did you mean stylus?

@heikki
heikki added a note

Isn't the stylus file extension styl? http://learnboost.github.com/stylus/docs/import.html

My bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@n1mmy n1mmy was assigned
@n1mmy
Owner

Thanks! Can we get a CLA, please? (http://contribute.meteor.com/) @heikki

@heikki

CLA done now.

@mpj

You are awesome!

@n1mmy
Owner

Thanks! df13b72

@n1mmy n1mmy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 21, 2012
  1. @heikki

    Add stylus package.

    heikki authored
  2. @heikki
This page is out of date. Refresh to see the latest.
Showing with 28 additions and 0 deletions.
  1. +1 −0  admin/generate-dev-bundle.sh
  2. +27 −0 packages/stylus/package.js
View
1  admin/generate-dev-bundle.sh
@@ -138,6 +138,7 @@ npm install fibers@0.6.4
npm install useragent@1.0.5
npm install request@2.9.3
npm install http-proxy@0.8.0
+npm install stylus@0.25.0
# unused, but kept in bundle for compatibility for a while.
npm install connect-gzip@0.1.5
View
27 packages/stylus/package.js
@@ -0,0 +1,27 @@
+Package.describe({
+ summary: 'Expressive, dynamic, robust CSS.'
+});
+
+var stylus = require('stylus');
+var fs = require('fs');
+
+Package.register_extension(
+ 'styl', function(bundle, source_path, serve_path, where) {

Did you mean stylus?

@heikki
heikki added a note

Isn't the stylus file extension styl? http://learnboost.github.com/stylus/docs/import.html

My bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ serve_path = serve_path + '.css';
+
+ var contents = fs.readFileSync(source_path);
+
+ stylus.render(contents.toString('utf8'), { filename: source_path }, function(err, css) {
+ if (err) {
+ bundle.error('Stylus compiler error: ' + err.message);
+ return;
+ }
+ bundle.add_resource({
+ type: 'css',
+ path: serve_path,
+ data: new Buffer(css),
+ where: where
+ });
+ });
+ }
+);
Something went wrong with that request. Please try again.