Failed to locate nib in stylus file
Asked Answered
L

2

7

I am trying to use Nib CSS3 extensions in stylus. Installed stylus and nib (tried local & global -g). But none works, when I do

stylus styles.styl > build/styles.css

# styles.styl
@import "nib"

I get

/usr/lib/node_modules/stylus/bin/stylus:502
              throw err;
                    ^
Error: styles.styl:1
 > 1| @import "nib"
   2| 
   3| body 
   4|   background: linear-gradient(top, white, black)

failed to locate @import file nib.styl

    at Evaluator.visitImport (/usr/lib/node_modules/stylus/lib/visitor/evaluator.js:659:21)
    at Evaluator.Visitor.visit (/usr/lib/node_modules/stylus/lib/visitor/index.js:28:40)
    at Evaluator.visit (/usr/lib/node_modules/stylus/lib/visitor/evaluator.js:75:18)
    at Evaluator.visitRoot (/usr/lib/node_modules/stylus/lib/visitor/evaluator.js:521:27)
    at Evaluator.Visitor.visit (/usr/lib/node_modules/stylus/lib/visitor/index.js:28:40)
    at Evaluator.visit (/usr/lib/node_modules/stylus/lib/visitor/evaluator.js:75:18)
    at Evaluator.evaluate (/usr/lib/node_modules/stylus/lib/visitor/evaluator.js:150:15)
    at Renderer.render (/usr/lib/node_modules/stylus/lib/renderer.js:69:26)
    at /usr/lib/node_modules/stylus/bin/stylus:496:15
    at fs.readFile (fs.js:176:14)
Luben answered 17/8, 2012 at 14:12 Comment(3)
whats the command you're running?Offstage
@JonathanOng, stylus styles.styl > build/styles.cssLuben
try stylus -u nib stylus.styl -o build/. i have issues with using stdin/out.Offstage
L
5

Yes I think I missed out the -u flag as @Jonathan pointed out

Luben answered 19/8, 2012 at 7:24 Comment(0)
O
0

the complete line of code for automatic transpilation would be :

stylus -w -u nib test.styl -o test.css
Oidea answered 18/3, 2020 at 20:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.