Skip to content

Commit

Permalink
Include Nib plugin path in stylus @import lookups
Browse files Browse the repository at this point in the history
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
jugglinmike committed Oct 12, 2012
1 parent 323565a commit af093b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/server.js
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions tasks/styles.js
Expand Up @@ -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.
Expand Down

0 comments on commit af093b0

Please sign in to comment.