Skip to content
Browse files

Include Nib plugin path in stylus @import lookups

In order to use the Nib plugin for Stylus, files must use the following
syntax:

    @import 'nib';

This ensures that the proper Stylus directives will be included in those
files that request them.
  • Loading branch information...
1 parent 323565a commit af093b01a406b0069e85d5ef6f7e7437f9e4fab2 @jugglinmike jugglinmike committed Oct 12, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 tasks/server.js
  2. +6 −0 tasks/styles.js
View
2 tasks/server.js
@@ -78,7 +78,7 @@ module.exports = function(grunt) {
fs.readFile(file, function(err, contents) {
grunt.helper("stylus", contents.toString(), {
- paths: ["assets/css/"]
+ paths: ["assets/css/", require("nib").path]
}, function(css) {
res.header("Content-type", "text/css");
res.send(css);
View
6 tasks/styles.js
@@ -34,6 +34,12 @@ module.exports = function(grunt) {
return log.write("No css imports defined.");
}
+ if (!options.paths) {
+ options.paths = [];
+ }
+
+ options.paths.push(require("nib").path);
+
// Iterate over the CSS rules, reducing to only @imports, then apply the
// correct prefixed path to each file. Finally, process each file and
// concat into the output file.

0 comments on commit af093b0

Please sign in to comment.
Something went wrong with that request. Please try again.